I have been working on my first plugin, and things haven't been going well
I was wondering if there was any "expert" out there that could help me..I have attached my most recent version...
I have got the settings to be added, and the global_wm template but it doesn't add anything to the header( Even though I want it on the forum index, I am just doing what seems easier). And when I add my $wm variable, the box shows but it is displayed wrong...
Any help with any of these problems will be
GREATLY appreciated....
PS: I AM very new to this and would appreciate instructions that are in "english" to me
eval("\$wmmsg = \"".$templates->get('global_wm')."\";");
should be
eval("\$wm = \"".$templates->get('global_wm')."\";");
you've defined it global (good
)
global $mybb, $templates, $wm;
and inserted it into the template
find_replace_templatesets('header', '#<navigation>#', "\$wm\n\t\t\t<navigation>");
but called it something when eval'ing in your wm() function.
Unfortunatly it still doens't work...It still doesn't add it to the header template and it also is black when you add $wm to the template...You can view it here at
http://www.e-xarx.net/nboard/
The thing at the top is my big problem
Ok. Numerous problems.
Change the template sid to -2 and not -1.
(mentioned above) The eval code needs to be $wm
Your template code had $settings[wmessage]. You used $wmessage = $mybb->settings['wmessage'] in your php code.
The same with the title.
I've attached a file that should work. Take a look at the template code to see what is different.
Okay Now we're getting somewhere
Still a few problems though..Nothing is still added to the header template( that can be done right?) and the back of the message is black but it is there now
Thanks so much for helping me with this
Change the color parameters?
Okay...The only problem I have is that it doesn't add the $wm into the header template...I would actually like it to go into the forum index template so ...Can any one help
PS: I also can't get that darn collapsed image to work...It shows up as [-]
EDIT: Also, for some strange reason most of the variables don't work like $theme[border] and others like that...Do I have to do a defining thing?
The $wm is added to the template just fine for me. Gets added to the right template in the right place.
You need to define global variables that are needed in the theme. So yes, you will need to define global $theme in yourwm function.
Can you help me get the code to go into the forum index template instead of the header? Do I just put like index instead of header?
Try these:
Activate:
find_replace_templatesets("index", '#\$header(\r?)\n#', "\$header\n\$wm\n");
Deactivate:
find_replace_templatesets("index", '#\$wm(\r?)\n#', "", 0);