MyBB Community Forums

Full Version: Thanks button?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2014-01-28, 09:16 AM)Tallon Wrote: [ -> ]Okay, I've found the thanks location, it's in global templates.
I'm assuming it's: thanks_postbit_outline?

i am afraid you are at the wrong place... can you post the thanks_postbit_inline_classic template....
(2014-06-09, 08:05 AM)mmadhankumar Wrote: [ -> ]i am afraid you are at the wrong place... can you post the thanks_postbit_inline_classic template....

Hi my bro...
i have problem same as TS..
[Image: 0nmInD9.png]

here my thanks_postbit_inline_classic template
<tr id="thx{$post['pid']}" style="{$display_style}" class="trow2 tnx_style tnx_classic"><td><span class="smalltext">{$lang->thx_givenby}</span></td><td class="trow2 tnx_style" id="thx_list{$post['pid']}">$entries</td></tr>

How to fix it?? Sad
thanks to @owenks666 for letting me check the templates. after looking at the templates i didnt find any template which includes the thanks button.

hence i thought of looking at the plugin and file.... if you are using the Thanks plugin then in inc/plugins/thx.php around line 310 we have the codes to add the button to postbit...


if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return thx({$post['pid']});\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\">
			<img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_thx.gif\" border=\"0\" alt=\"$lang->thx_main\" title=\"$lang->thx_main\" id=\"i{$post['pid']}\" /></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_rthx.gif\" border=\"0\" alt=\"$lang->thx_remove\" title=\"$lang->thx_remove\" id=\"i{$post['pid']}\" /></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}



i guess changing it as following shoud fix this....
NOTE: have a backup of the original thx.php file before making this changes. And remember the below modification is for the theme used by owenks666 and the css selector might vary from theme to theme.

if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return thx({$post['pid']});\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}
i'm using plugin Hide Until Thanks my bro.
and i have see inc/plugins/thx.php, however i can't find the code that you're wrote above.

now, i have tired modified and do many setting, and the problem stiil can't be fix Sad
(2014-06-10, 10:09 AM)owenks666 Wrote: [ -> ]i'm using plugin Hide Until Thanks my bro.

Oh.. in that case you need to look into thx.php around line 563 and find the below codes....

 	if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			        $post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"var uno = thx({$post['pid']});var dos = hideuntilthanks_reload(); return uno && dos;\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span id=\"i{$post['pid']}\" />-Thanks</span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}


change that to....

 	if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			        $post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"var uno = thx({$post['pid']});var dos = hideuntilthanks_reload(); return uno && dos;\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span id=\"i{$post['pid']}\" />-Thanks</span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}
(2014-06-10, 10:52 AM)mmadhankumar Wrote: [ -> ]
(2014-06-10, 10:09 AM)owenks666 Wrote: [ -> ]i'm using plugin Hide Until Thanks my bro.

Oh.. in that case you need to look into thx.php around line 563 and find the below codes....

 	if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			        $post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"var uno = thx({$post['pid']});var dos = hideuntilthanks_reload(); return uno && dos;\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span id=\"i{$post['pid']}\" />-Thanks</span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}


change that to....

 	if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			        $post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"var uno = thx({$post['pid']});var dos = hideuntilthanks_reload(); return uno && dos;\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\"><span id=\"i{$post['pid']}\" />+Thanks</span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" class=\"buttons\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span id=\"i{$post['pid']}\" />-Thanks</span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}

Thanks for your help my bro..
Now, problem solved using code, that you're wrote above. Smile

Rep added Big Grin
Pages: 1 2