Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post CMS - How To Create New HTML Block To Add In Your CMS 
 
Introduction
With the CMS system you can add each kind of block in every page of your Icy Phoenix board. If, for example, you have a particular block that you must put in a lot of personal page (like a footer or sponsor), is very useful to create a custom block in a block file, because you can edit .tpl file only one time and upload it: all your pages will then get the changes!


Instructions
  1. Create yoursite/blocks/blocks_imp_YOURBLOCK.php

    Code: [Download] [Hide]
    1. <?php  
    2. /***************************************************************************  
    3. *           blocks_imp_YOURBLOCK.php  
    4. *             -------------------  
    5. *   begin                : 2007/02/06  
    6. *   copyright            : Mighty Gorgon  
    7. *   website              : http://www.mightygorgon.com  
    8. *   email                : mightygorgon@mightygorgon.com  
    9. *  
    10. ***************************************************************************/  
    11.  
    12. /***************************************************************************  
    13. *  
    14. *   This program is free software; you can redistribute it and/or modify  
    15. *   it under the terms of the GNU General Public License as published by  
    16. *   the Free Software Foundation; either version 2 of the License, or  
    17. *   (at your option) any later version.  
    18. *  
    19. ***************************************************************************/  
    20.  
    21. if ( !defined('IN_PHPBB') )  
    22. {  
    23.     die('Hacking attempt');  
    24. }  
    25. if(!function_exists(imp_YOURBLOCK_func))  
    26. {  
    27.     function imp_YOURBLOCK_func()  
    28.     {  
    29.         global $lang, $template, $board_config;  
    30.  
    31.         $template->assign_vars(array(  
    32.             )  
    33.         );  
    34.     }  
    35. }  
    36.  
    37. imp_YOURBLOCK_func();  
    38.  
    39. ?> 


  2. Create yoursite/templates/xxx/blocks/YOURBLOCK_block.tpl and put in it your personal HTML code.

  3. P.S.: replace YOURBLOCK with your personal name! That's all, good work!

 



 
Edited by Mighty Gorgon, Thu 12 Apr, 2007 01:08: Edited By MG
hplSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
I try to search there but there isn't this doc, I'm right?....

If for you is ok, I can put on public forum!
 



 
hplSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
Thanks hpl, this tutorial is useful as well as the other you have created .

When you have some free time, can you also show how to include some text in a lang file and then how to show it in this block?

Thank you very much.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
Ok, I tried in many ways but I didn't manage to see my variable recalled in the template  


I am creating a block for my java chat. I am not using the simple html in CMS because I want the login of the chat to recall the username.

Here are my files:


root/blocks/blocks_imp_kopechat.php

Code: [Download] [Hide] [Select]
if ( !defined('IN_PHPBB') )
{
    die('Hacking attempt');
}
if(!function_exists(imp_kopechat_func))
{
    function imp_kopechat_func()
    {
        global $userdata, $template, $board_config, $lang, $db, $phpEx;

        $template->assign_vars(array(
            'CHAT_USERNAME' => $username
            )
        );
    }
}

imp_kopechat_func();

?>



and here's the template file:


root/templates/TEMPLATE/blocks/kopechat_block.tpl


Code: [Download] [Hide] [Select]
...java applet html code...

<param name="name" value="{CHAT_USERNAME}">

...java applet html code...




But it doesn't work. I tried with an echo, to see what happens and it seems to be an empty variable... the error must be in the .php file. I think it is just a stupid thing, it's just that I don't know phpBB enough  

How do I recall the plain username of a user? (avoiding the colorizing function).


Thanks for your help.
 



 
VortexSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
FIND
Code: [Download] [Hide] [Select]
        $template->assign_vars(array(
            'CHAT_USERNAME' => $username
            )
        );


REPLACE WITH
Code: [Download] [Hide] [Select]
        $template->assign_vars(array(
            'CHAT_USERNAME' => $userdata['username']
            )
        );

 



 
hplSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
Damn I was sure I did try that! Anyway, now it works.

Thanks for your precious help, hpl.
 



 
VortexSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
Many thanks to HPL, I really appreciate the topic.

IP rules!!!

 
 




____________
My main IP 1.3 site
My IP 1.3 styles test site
 
gearheadSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Create New HTML Block To Add In Your CMS 
 
Hello, I tried the block and works, but is not necessary to include the code, which should show this is

Link
    
but it just shows me the pictures, I guess not include the php code ...... someone could tell me if possible?

Code: [Download] [Hide] [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h**p://***.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="h**p://***.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" href="wg_images/wgstyle.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>WINDGURU PRO - MARDECANARIAS</title>
</head>

<body>
<div align="center"><img src="h**p://***.mardecanarias.com/windguru/wind_mar.png" longdesc="windguru_mardecanarias" />
<?php
require_once('windguru.inc.php');  // this will load the necessary classes
windguru_forecast(169675,'5212a649cd','es'); // Arucas
windguru_forecast(170133,'49767b3ce6','es'); // Agaete
windguru_forecast(170134,'448f82ac54','es'); // Melenara
 ?>    

</div>
</body>
</html>


Thanks
 



 
sunbloquerSend private message  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events