MyBB Community Forums

Full Version: Thank Plugin: use with several themes [MyBB 1.2.1]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use the "Thank You" plug-in, but I have a problem in my forum. I use different themes on my forum. For example, /images/simpleblue contains a self-inserted theme. The default theme has stayed in /images in order not to ruin something. Toungue I have got new thank buttons especially for those other themes, but they aren't selected, by something in the scripts that seems to select /images/[chosen language]/postbit_thx.gif, nevertheless the theme you selected. Now off course, I want to see selected for example /images/simpleblue/[chosen language]/postbit_thx.gif when Simple Blue is the chosen theme. Big Grin

Included is the plug-in I'm talking about. Can someone help me, please? Wink
Answer, please!
Inside inc/plugins/thx.php
global $db, $mybb, $lang , $altbg,$templates;
Replace with:
global $db, $mybb, $lang , $altbg,$templates, $theme;
then find:
$post['thanks'] = "<a href=\"javascript:thx({$post['pid']})\"><img 
		src=\"images/{$lang->language}/postbit_thx.gif\" border=\"0\" alt=\"$lang->thx_main\" /></a>";
Replace with:
$post['thanks'] = "<a href=\"javascript:thx({$post['pid']})\"><img 
		src=\"{$theme['imgdir']}/{$lang->language}/postbit_thx.gif\" border=\"0\" alt=\"$lang->thx_main\" /></a>";

And please don't bump the thread.
But what if your default theme (MyBB Default) has stayed in the folder ./images in contrary to the other themes that have a separate folder?
I updated the code and will work with any theme.