MyBB Community Forums

Full Version: [solved] update plugin to mybb1.4 help.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi to everybody,
I am trying to update some plugins to the version 1.4 (beta 4) but already with the first one I have some problems.
The installation and the change / insertion of the themplates perfectly work but they don't appear me the messages.

I post you the part of code.
function my_bb_it_msg()
{

	global $mybb, $templates, $my_bb_it_msg, $current_page, $header, $cache, $page;
	
	
	if($mybb->settings['mostra_news']=="1")
	{
		$newsmessage = $mybb->settings['news_msg'];
		$bg_n=$mybb->settings['bg_news'];
		$bor_n=$mybb->settings['bord_news'];
		eval("\$newsmsg=\"".$templates->get('global_msg_newsmsg')."\";");
	}
	
	if($mybb->settings['mostra_upgrade']=="1")
	{
		$upgrademessage = $mybb->settings['upgrade_msg'];
		$bg_u=$mybb->settings['bg_up'];
		$bor_u=$mybb->settings['bord_up'];
		eval("\$upgrademsg=\"".$templates->get('global_msg_upgrademsg')."\";");
	}
	
	if($mybb->settings['mostra_warning']=="1")
	{
		$warningmessage = $mybb->settings['warning_msg'];
		$bg_w=$mybb->settings['bg_wa'];
		$bor_w=$mybb->settings['bord_wa'];
		eval("\$warningmsg=\"".$templates->get('global_msg_warningmsg')."\";");
	}
	eval("\$messaggi=\"".$templates->get('global_messaggi')."\";");

}

if I insert later
eval("\$messaggi=\"".$templates->get('global_messaggi')."\";");

echo" $messaggi";

the messages appear correctly.

{$messaggi} it is correctly present inside Header
Can you try
function my_bb_it_msg()
{
    global $mybb, $templates, $theme, $newsmsg, $upgrademsg, $warningmsg, $messaggi;
    
    if($mybb->settings['mostra_news'] == 1)
    {
        $newsmessage = $mybb->settings['news_msg'];
        $bg_n = $mybb->settings['bg_news'];
        $bor_n = $mybb->settings['bord_news'];
        eval("\$newsmsg=\"".$templates->get('global_msg_newsmsg')."\";");
    }
    if($mybb->settings['mostra_upgrade'] == 1)
    {
        $upgrademessage = $mybb->settings['upgrade_msg'];
        $bg_u = $mybb->settings['bg_up'];
        $bor_u = $mybb->settings['bord_up'];
        eval("\$upgrademsg=\"".$templates->get('global_msg_upgrademsg')."\";");
    }
    if($mybb->settings['mostra_warning'] == 1)
    {
        $warningmessage = $mybb->settings['warning_msg'];
        $bg_w = $mybb->settings['bg_wa'];
        $bor_w = $mybb->settings['bord_wa'];
        eval("\$warningmsg=\"".$templates->get('global_msg_warningmsg')."\";");
    }
    eval("\$messaggi=\"".$templates->get('global_messaggi')."\";");
} 
not work ...

it seems that I don't recognize the variable {$messaggi} in the themplates header

p.s. my themplates is created in Global Templates
All custom templates are located in Global Templates;
Have you tried other plugins which create custom templates ? Do they work ?
I have tried the plugin board message by Musicalmidget and work, but not make a Global Templates