https://www.icyphoenix.com/viewtopic.php?f=4&t=1606&p=32527#p32527
-----------------------------------
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...

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

...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.


