https://www.icyphoenix.com/viewtopic.php?f=4&t=1606 ----------------------------------- hpl Wed 11 Apr, 2007 18:25 CMS - How To Create New HTML Block To Add In Your CMS ----------------------------------- [cell class=mg_quotetitle][size=16]Introduction[/size][/cell][cell class=mg_quotediv][size=14][font=Trebuchet MS]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 [u]only one time[/u] and upload it: all your pages will then get the changes![/font][/size][/cell] [cell class=mg_quotetitle][size=16]Instructions[/size][/cell][cell class=mg_quotediv][list=1][*]Create yoursite/blocks/blocks_imp_YOURBLOCK.php [code]assign_vars(array( ) ); } } imp_YOURBLOCK_func(); ?>[/code] [*]Create yoursite/templates/xxx/blocks/YOURBLOCK_block.tpl and put in it your personal HTML code. [*]P.S.: replace YOURBLOCK with your personal name! That's all, good work![/list][/cell] ----------------------------------- hpl Wed 11 Apr, 2007 18:27 Re: How To Create New HTML Block To Add In Your CMS ----------------------------------- I try to search [url=http://www.icyphoenix.com/viewforum.php?f=4]there but there isn't this doc, I'm right?.... :oops: If for you is ok, I can put on public forum! :mricy: ----------------------------------- Mighty Gorgon Thu 12 Apr, 2007 01:10 Re: How To Create New HTML Block To Add In Your CMS ----------------------------------- Thanks [b]hpl[/b], this tutorial is useful as well as the other you have created :wink: . 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? :wink: Thank you very much. ----------------------------------- Vortex Wed 01 Oct, 2008 00:10 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 linenumbers=false]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(); ?>[/code] and here's the template file: root/templates/TEMPLATE/blocks/kopechat_block.tpl [code linenumbers=false]...java applet html code... ...java applet html code...[/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 :mricy: How do I recall the plain username of a user? (avoiding the colorizing function). Thanks for your help. ----------------------------------- hpl Wed 01 Oct, 2008 15:56 Re: How To Create New HTML Block To Add In Your CMS ----------------------------------- FIND [codeblock] $template->assign_vars(array( 'CHAT_USERNAME' => $username ) ); [/codeblock] REPLACE WITH [codeblock] $template->assign_vars(array( 'CHAT_USERNAME' => $userdata['username'] ) ); [/codeblock] ----------------------------------- Vortex Wed 01 Oct, 2008 16:22 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, [b]hpl[/b]. ----------------------------------- gearhead Thu 02 Oct, 2008 04:19 Re: How To Create New HTML Block To Add In Your CMS ----------------------------------- Many thanks to HPL, I really appreciate the topic. IP rules!!! :mrgreen: ----------------------------------- sunbloquer Tue 20 Jan, 2009 15:32 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 [url=http://www.mardecanarias.com/windguru/windguru.php]Link but it just shows me the pictures, I guess not include the php code ...... someone could tell me if possible? [code linenumbers=false] WINDGURU PRO - MARDECANARIAS
[/code] Thanks