Thanks for posts

Thank Count - Thanks for posts

Thank Count

by Stese » Fri Jul 21, 2023 10:57 am

TL:DR - I'd like to show a simple thank count on a post, rather than a list of thankers? how can I do this?

It doesn't seem immediately possible to do this? I'm not worried about showing images... all I need is a number somewhere on the post...

I'm going to be running a suggestions topic, and I need a way of monitoring which suggestions are preferred.

Many thanks,

Steve D.
Stese
Registered User
Posts: 4
Joined: Tue Jul 23, 2013 8:37 pm

Re: Thank Count

by rxu » Fri Jul 21, 2023 12:44 pm

Well, if you're familiar with the old MOD edits instructions era, here's just a quick hack:

Code: Select all

OPEN
ext\gfksx\thanksforposts\core\helper.php

FIND
'THANKS_FROM'				=> $this->language->lang('THANK_FROM'),

AFTER, ADD
'POST_THANKS_COUNT'			=> $this->get_thanks_number($row['post_id']) ?: '',

OPEN
ext\gfksx\thanksforposts\styles\prosilver\template\event\viewtopic_body_postrow_post_notices_after.html

FIND
			<dt>{{ postrow.THANK_TEXT }}{{ postrow.POST_AUTHOR_FULL }}{{ postrow.THANK_TEXT_2 }}</dt>
			<dd>{{ postrow.THANKS }}</dd>

REPLACE WITH
			<a href=# class="button" title="{{ lang('THANK_POST_SHORT') }}">
				<i class="icon fa-heart fa-fw" style="color: red" aria-hidden="true"></i>{{ postrow.POST_THANKS_COUNT }}
			</a>
Save both files, purge the cache. Expected result is like that:

image.jpg
rxu
Extensions Development Team
Posts: 3951
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Thank Count

by halil16 » Fri Aug 11, 2023 3:28 am

😮 Thanks.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1447
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Thank Count

by wingmanfoilclub » Wed Apr 03, 2024 3:32 am

This is a great hack, but if I'm correct, it makes the heart a clickable link that just sends you to the top of the screen? Ideally this link would show a list of all the users that have liked that post. Or not be a link at all and just an image... maybe I'm missing something.

The other thing that would make this extension much better would be if there was a way to easily disable notifications for Thanks removal. I have seen the option to disable all notifications, but I would still like notifications of Thanks. Currently, the user can choose not to receive notifications for Thanks removal, but it should be an Admin setting.
wingmanfoilclub
Registered User
Posts: 2
Joined: Tue Apr 02, 2024 6:50 am

Re: Thank Count

by halil16 » Fri Apr 05, 2024 2:26 am

wingmanfoilclub wrote:Ideally this link would show a list of all the users that have liked that post.
This can be done with html vs css edits. I thought about it too, but then it didn't seem so necessary. But at first this idea excited me like you. So this can be done with some edits right now.

But the extension asks you to enter a certain number for the list of likes. Maybe typing 99999999 will work :)
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1447
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Thank Count

by defvenom » Sun Jul 28, 2024 4:27 pm

rxu wrote:Well, if you're familiar with the old MOD edits instructions era, here's just a quick hack:

Code: Select all

OPEN
ext\gfksx\thanksforposts\core\helper.php

FIND
'THANKS_FROM'				=> $this->language->lang('THANK_FROM'),

AFTER, ADD
'POST_THANKS_COUNT'			=> $this->get_thanks_number($row['post_id']) ?: '',

OPEN
ext\gfksx\thanksforposts\styles\prosilver\template\event\viewtopic_body_postrow_post_notices_after.html

FIND
			<dt>{{ postrow.THANK_TEXT }}{{ postrow.POST_AUTHOR_FULL }}{{ postrow.THANK_TEXT_2 }}</dt>
			<dd>{{ postrow.THANKS }}</dd>

REPLACE WITH
			<a href=# class="button" title="{{ lang('THANK_POST_SHORT') }}">
				<i class="icon fa-heart fa-fw" style="color: red" aria-hidden="true"></i>{{ postrow.POST_THANKS_COUNT }}
			</a>
Save both files, purge the cache. Expected result is like that:

image.jpg
I would love to use this, thank you! Where do we put this?

Edit: oh do I just follow the instructions as written?
defvenom
Registered User
Posts: 6
Joined: Thu Jul 11, 2024 1:44 am

Re: Thank Count

by rxu » Sun Jul 28, 2024 7:05 pm

defvenom wrote:oh do I just follow the instructions as written?
Yes.
rxu
Extensions Development Team
Posts: 3951
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Thank Count

by romeo_piter » Fri Aug 09, 2024 2:40 pm

rxu wrote:Well, if you're familiar with the old MOD edits instructions era, here's just a quick hack:
Could you please help with ajax compatibility. This number ({{ postrow.POST_THANKS_COUNT }}) doesn't change when clicking "like" or "take like back". Is it posible to make it work?
romeo_piter
Registered User
Posts: 130
Joined: Mon Nov 09, 2009 7:11 pm
Location: Paraguay