Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Post thanks plugin ?
Avatar
sptab
Member
sp_UserOfflineSmall Offline
Sep 22, 2012 - 2:05 pm

Hello,

I have just updated my SP to latest 5.1.4, added and activate Post Thanks plugin. 

I have also updated the default theme but I don't see where the "Thanks" feature appears on each post, have I missed something ?

Thank you.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 22, 2012 - 2:46 pm

have you added the template tag to make it show up where you want it??

http://codex.simple-press.com/.....st-thanks/

Avatar
sptab
Member
sp_UserOfflineSmall Offline
Sep 22, 2012 - 4:21 pm

It looks like I missed it, thanks for the link.

I've just added the tags, I'll report here after a few days run.

Cheers.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 22, 2012 - 5:18 pm

okay, please do...

Avatar
Erich
Rookie
Free Members
sp_UserOfflineSmall Offline
Sep 22, 2012 - 10:15 pm

What is the call within spTopicView.php to display something like "Thanked: xxx" after "Forum Posts: xxx" in the profile area of the topic? I couldn't find it in the Codex section (in the link you mentioned above).

thanks! (no pun intended)

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Sep 22, 2012 - 10:20 pm

To show the number of thanks you can use

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times in %POSTS% posts')

Will be adding more info on that tomorrow but that's the basic setting for putting in the display. Like under the member's avatar in TopicView, Default Theme.

Avatar
Erich
Rookie
Free Members
sp_UserOfflineSmall Offline
Sep 22, 2012 - 10:27 pm

perfect! thanks so much!!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 23, 2012 - 3:34 am

You're welcome

andy-signature.png
YELLOW
SWORDFISH
Avatar
veritasnoctis
Member
Free Members
sp_UserOfflineSmall Offline
Sep 23, 2012 - 11:13 pm

Brandon C said
To show the number of thanks you can use

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times in %POSTS% posts')

Will be adding more info on that tomorrow but that's the basic setting for putting in the display. Like under the member's avatar in TopicView, Default Theme.

I wanted to show thanks given as well as thanks earned, so I had to add some custom code to a couple of files.

Here's the code I added to spTopicView.php right after the forum posts line:

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanks Given: %THANK%');
sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanks Earned: %THANKED%');

 

I added lines 1 and 4 below to the sp-thanks-user-stats.php file like so:

    if (empty($user->thank)) $user->thank = 0;
    if (empty($user->thanked)) $user->thanked = 0;
     
  $label = str_ireplace('%THANK%', $user->thank, $label);
  $label = str_ireplace('%THANKED%', $user->thanked, $label);
  $label = str_ireplace('%POSTS%', $user->posts, $label);

Can y'all add the thank code to sp-thanks-user-stats.php in the next update?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 23, 2012 - 11:38 pm

reading/replying via email, so cannot see everything you are doing... but did you try using the built in hooks/filters to that function to get the desire result? would save editing the core plugin files...

will read it in more detail tomorrow when I can visit the site...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625