MyBB Community Forums

Full Version: using templates in plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi

i want to create e plugin and i want to use {$welcomeblock} variable in my plugin
but i don't know how should I do?
Thanks, but i dont want to use eval function

i want to use {$welcomeblock} inside of html codes like this

$myvar .='<div>Somethings here</div>'.$welcomeblock.'<div>nothing</div>';

is this possible?
Then u don't use templates you wan to modify a var, then you have to search a value of that var and then if you use maybe the original var value, then add new value.

i think, if the value is $welcomeblock

i add a value like:

$welcomeblock .='<div>Somethings here</div>'.$welcomeblock.'<div>nothing</div>';

i think this works, but you have to know the original var value, because i change some values of vars on another templates and i have to go to the original template and search for te value, then take that and on that way i can modify as i wish xD.
(2013-07-07, 04:57 PM)Wildcard Wrote: [ -> ]http://community.mybb.com/thread-141819.html

I did by this way, but there is 2 problems!

1. When I change the template, the output don't changes! I think the template includes from another theme!

2. The internal language variables not working. I mean this variables:
"Current time: {1} Welcome back, Admin."
why "{1}" not working?

How i can fix this problems?

I found the reason, I have to assign a value for $theme['templateset']

there is a column in mybb_themes in DB of MyBB, Its contents is:
a:6:{s:11:"templateset";i:2;s:11:"editortheme";s:7:"default";s:6:"imgdir";s:15:"images/foldername";s:4:"logo";s:15:"images/logo.gif";s:10:"tablespace";i:15;s:11:"borderwidth";i:0;}

I know the value of "templateset" is "2" in this codes, but I want to extract the value with sql queries!
Please help me

Best Regards