MyBB Community Forums

Full Version: Thank You/Like System v3.4.5 + MyAlerts and Tapatalk support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, I'm glad the fix worked.

Re your missing custom CSS as mentioned in the thread on your forum: when you uninstalled the plugin, the thankyoulike.css stylesheet would have been deleted from all themes too, so if that's where you had customised the styling of the list of likers, then unfortunately it is now lost. Hopefully you can recover it from a backup or recreate it.
How can we show the like part with avatar.
Like the picture below.

[Image: 5uYyiy.png]
The plugin currently doesn't support this out-of-the-box, but you can hack it to achieve it. Here's a start at that hack. Line numbers assume you've got the latest version of the plugin, 3.3.6, installed.

In the file inc/plugins/thankyoulike.php:
  1. Append , u.avatar to line 1673 (which is the first line of a SELECT database query).
  2. Insert around line 1695 the line $avatar = format_avatar($tyl['avatar']);
Make corresponding changes in the thankyoulike.php file in the base directory:
  1. Append , u.avatar to line 419 (which is the first line of a SELECT database query).
  2. Insert around line 433 the line $avatar = format_avatar($tyl['avatar']);
Then edit the thankyoulike_users template and replace its contents with something like this (tinker to get your preferred look):

<a href="{$profile_link}" class="smalltext" title="{$tyl['username']}"><img alt="" src="{$avatar['image']}" style="width: 25px; height: 25px; border-radius: 12.5px;" /></a>

You can probably take it from there, but if you need more help with getting it exactly right then just ask.
There is one more problem.
When hovering over the avatar, only the username appears. What time and date does not appear.
Try this:

In both files you previously edited, just a few lines below where you added the line starting with $avatar, you'll see a couple of lines starting with $datedisplay_. Insert this line after them in each file:

$datedisplay_plain = my_date($mybb->settings[$prefix.'dtformat'], $tyl['dateline']);

Then update the same thankyoulike_users template that you edited previously so that it now consists in this:

<a href="{$profile_link}" class="smalltext" title="{$tyl['username']} ({$datedisplay_plain})"><img alt="" src="{$avatar['image']}" style="width: 25px; height: 25px; border-radius: 12.5px;" /></a>
(2020-09-26, 03:32 PM)Laird Wrote: [ -> ]Try this:

In both files you previously edited, just a few lines below where you added the line starting with $avatar, you'll see a couple of lines starting with $datedisplay_. Insert this line after them in each file:

$datedisplay_plain = my_date($mybb->settings[$prefix.'dtformat'], $tyl['dateline']);

Then update the same thankyoulike_users template that you edited previously so that it now consists in this:

<a href="{$profile_link}" class="smalltext" title="{$tyl['username']} ({$datedisplay_plain})"><img alt="" src="{$avatar['image']}" style="width: 25px; height: 25px; border-radius: 12.5px;" /></a>

It looks good now. Thank you man.
No problem. If I get motivated I'll try to add out of the box support for this to the plugin, otherwise next time you upgrade you'll need to add the same lines of code again.
@Laird - I had been busy, so thank you for your great support! I really like this idea, maybe we should add it into the TYL Smile
Yes, I think we should, @Eldenroot. Nice to hear from you!
New version 3.3.7 is released!

This release contains quite a lof of fixes, enhancements and two new features. We recommend everybody to update.

Changelog:
[FEATURE] - Add coloration of thx/like counter based on amount of received thx/like (postbit and member_profile), including simple settings with CSS support - by @lairdshaw
[FEATURE] - Display users' avatars instead of usernames in thx/like list - by @lairdshaw
[ENHANCEMENT] - Display date and time (User's profile - Top liked/thanked post) - by @lairdshaw
[ENHANCEMENT] - Display "Continue reading" for post content (User's profile - Top liked/thanked post) - by @lairdshaw
[ENHANCEMENT] - Improve displaying of thx/like counter, including support for coloration feature (User's profile - Top liked/thanked post) - by @lairdshaw
[ENHANCEMENT] - Do not display unwanted links in member profile page - if the user has no thx/likes -> no "Search" link is displayed - by @lairdshaw
[FIX] - Do not use hard-coded comma for $comma variable - by @lairdshaw
[FIX] - Eliminate duplicate code in thankyoulike.php - by @lairdshaw
[FIX] - Move the creation of the Master stylesheet from installation to activation - by @lairdshaw

Thank you very much @Laird (aka @lairdshaw) for your great contribution and time, without you this would not be possible!


DOWNLOAD from the MyBB Extend site:
Extend MyBB - Download Thank You/Like System+MyAlerts & Tapatalk support

If you like our work, please add a "STAR" on MyBB Extend site Smile