MyBB Community Forums

Full Version: problem with plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guis, I'm creating a plugin but I can't continue.
With my plugin I insert in headerinclude this text:
{$stylesheets}
<!-- start: Full PM --><script>
   var fullpm_language = {
       title: \'{$lang->fullpm_title}\',
       text: \'{$lang->fullpm_text}\'
   };
   var showmsg = \'{$showmsg}\';
   </script><script type="text/javascript" src="{$mybb->asset_url}/jscripts/fullpm.js"></script><!-- end: Full PM -->

Now I need to change the variable showmsg when a user connect to forum.
I tried to do it adding hook global_start and using the eval below but it don't work
$showmsg = "1";
eval('$showmsg = "'.$showmsg.'";');

How I can do it?
(2015-07-30, 09:18 PM)chack1172 Wrote: [ -> ]
$showmsg = "1";
eval('$showmsg = "'.$showmsg.'";');

This eval is evaluating nothing but itself, with a little luck the outcome is $showmsg = "1".

I have no idea what you try to evaluate here, but I should think that there must be a template involved.

Also don't forget to make $showmsg a global variable in the plugin function.
Thanks Ad Bakker now it works