MyBB Community Forums

Full Version: Incorperate thank you like into mobile theme?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is one thing I really miss in the mobile theme. http://mods.mybb.com/view/thank-you-like-system

It's almost a deal breaker for me, but I'm guessing there's a way to incorporate this.

I attempted to simply plug this code into postbit_classic in the PM DELETE EDIT QUOTE line, but it's not working out.

<tr id="tyl_{$post['pid']}">
	{$post['thankyoulike_data']}
</tr>

I'm also having trouble locating the variable which displays the amount of Likes received, so I can show it after their handle.

Any ideas?
below code is required in showthread template so that referred code added to postbit can work
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/thankyoulike.js?ver=150"></script>
<script type="text/javascript">
<!--
	var tylEnabled = "{$mybb->settings['g33k_thankyoulike_enabled']}";
	var tylCollapsible = "{$mybb->settings['g33k_thankyoulike_collapsible']}";
	var tylUser = "{$mybb->user['uid']}";
-->
</script>

The plugin has good documentation on the plugin page & in a text file of the plugin package.

Quote:- To customize the postbit block, you can use the following variables:
$post['tyl_unumtyls']: Number of thanks given
$post['tyl_unumrtyls']: This is fully formatted string (xx in yy posts)
$post['tyl_unumrcvtyls']: Number of thanks received
$post['tyl_unumptyls']: Number of posts in which the thanks were received
Okay, I'm getting this worked out. Quite a large issue here is the 'Loading' box after tapping is just sticking there. The like (or taking away the like) is recorded properly, but it just sticks after (the like button doesn't change to '- Like' and vice versa) and the big loading box just sits there.

The page doesn't lock up, it just doesn't refresh and get rid of the box or change the image.

Any ideas?
have you rechecked the code in the postbit_classic template

thankyou/like system button code :
{$post['button_tyl']}

thankyou/like display code is like below (before bottom </table> code)
<tr style="{$post['tyl_display']}" id="tyl_{$post['pid']}">
	{$post['thankyoulike_data']}
</tr>
okay. Got it fixed now.

Biggest issue now is that funky box. (See pic)
I have tried span and p instead of table tr and it gives the same result.

It's 4am here. I gotta let this go for now. Thanks for your help .m. Looking forward to the answer regarding the funky box. Cheers.
^ test user account is required to check that ..
It shows up in advanced sidebox as well. In place of the + and - . It's like it can't find, or can't display the gif for some reason. The missing image icon functions fine (collapses and expands) in both ASB and TYL, but just doesn't show the gif / + / -
Global Templates >> thankyoulike_button_add
<img src="{$imgdir}/postbit_{$pre}_add.gif" border="0" alt="{$lang->add_tyl}" id="tyl_i{$post['pid']}" />
above code can be replaced with text Thanks +

Global Templates >> thankyoulike_button_del
<img src="{$imgdir}/postbit_{$pre}_del.gif" border="0" alt="{$lang->del_tyl}" id="tyl_i{$post['pid']}" />
above code can be replaced with text Thanks -

I forgot that tables html code is not used in the mobile theme. earlier suggested
codes require modifying ! also mobile theme does not use expand & collapse images

Edit:
you can add below style code at the bottom of mobile theme's global.css to fix expand / collapse symbol for side boxes
.expcolimage {float: right;}
Yes, I tried with TABLE/TR, P, SPAN. They all work fine except for the + / - gif. The ADD/DEL button is showing fine. It's the collapse/expand images that are the issue.

Okay. I uploaded the collapse and collapse_collapsed gifs to the mobile theme. fixed. Thanks again. Excellent. Will post a screen shot of the "final" result

okay. There's one more issue, the - + gif is showing even when there's no likes. It adds an extra unnecessary line to the bottom of each post.

Maybe an if conditional statement to not process the code if no likes accumulated?
<span style="font-family:Georgia; font-size:6px" id="tyl_{$post['pid']}">
			{$post['thankyoulike_data']}
		 </span>

ahhhh... Fixed. I had removed the initial
"{$post['tyl_display']}"
when changing font and size. Added it back in.
<span style="{$post['tyl_display']}; font-family:Georgia; font-style:italic; font-size:7px" id="tyl_{$post['pid']}">
			{$post['thankyoulike_data']}
		 </span>
Now 100%

Note, uploaded spinner.gif and spinner_big.gif to mobile theme as well. Excellent, the spinner now shows.