Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Thanks Plugin
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 29, 2014 - 2:23 pm

How do you set to actually show how many points one has with this plugin?

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 29, 2014 - 2:38 pm

Hey Alex,

Just take a look at the post thanks codex document.

About half way down you have multiple methods of displaying thanks reputation detailed using template tags such as 'displaying number of thanks', 'displaying thanks reputation', displaying thanks reputation on profile pages' and 'displaying top thanked users'.

Shout if you need any further help!

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 29, 2014 - 2:55 pm

I cannot find the sp-thanks-thanks-for-post.php template file?  Below are the templates found when I click editor.

    • spDefault.php
    • spFoot.php
    • spForumView.php
    • spFunctions.php
    • spGroupView.php
    • spHead.php
    • spListView.php
    • spMembersView.php
    • spNewPostsView.php
    • spProfileEdit.php
    • spProfilePopupShow.php
    • spProfileShow.php
    • spSearchView.php
    • spTopicView.php

     

 

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 29, 2014 - 3:01 pm

If you're referring to the 'displaying thanks' section, the reference to the template file is simply that it is the function file the template function uses. It's really just a reference and to be honest threw me a little bit when I read it.

You don't need to access this file at all. If you read further on it explains that you use the function

sp_thanks_thanks_for_post().

And also explains where to place the function in the themes template files.

However - this will just display in topic which user (by name) thanked a post, and won't display a users 'thanks stats' so to speak. See further down at 'Displaying Thanks Reputation' for this.

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 29, 2014 - 3:10 pm

I've read that page, however it is a bit difficult to understand.  Here's what it says to Display the number of thanks:

These variables are passed to the function along with any surrounding text. The sp-thanks-user-stats.php template file is where the function is found and the function used is sp_thanks_user_stats() to create this display and it’s default setting is:

According to this, i'm reading it as I have to add the function to sp-thanks-user-stats.php?  I'm not sure why you guys didn't just add these options into the plugin's options?

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 29, 2014 - 4:14 pm

The reason these options are not included in the plugin is because template functions with arguments placed in the theme templates (which drive the display) allow far more flexibility. In order for these options to be included in the plugin options, the template functions would need to already exist in the theme templates using 'if' statements which is no simple task given how many options and combinations there actually are. Also, if these template functions did exist, given the flexibility in displaying exactly what you want where you want it, you might not be happy with where we have put them, and would need to move and customise the function anyway.

We include the basic template functions in the theme files such as actually thanking someone - so the plugin can be used straight out of the box, but further customisation is of course optional.

Anyway!.. Basically the reference to the php template file is irrelevant, it's simply telling you that the sp-thanks-user-stats.php template file is the code that drives the function.

'the function used is sp_thanks_user_stats() to create this display' is far more relevant - as stated it creates the display which is what you are aiming for. Assuming you are familiar with template functions (exactly the same as WP) then that is all this is.

Simply put sp_thanks_user_stats() into your theme template - wherever you like, and in the format outlined in the Codex article. You could put the function into your spTopicView.php template - possibly underneath the users avatar and username. It would look like

sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times in %POSTS% posts')
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 29, 2014 - 4:17 pm

I see that I have to edit this in topicview.php.  Took a couple of times in reading this.  Another question, is there a way to have that button show up twice?  For instance, one to thank and another for something else? 

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 29, 2014 - 4:21 pm

It depends what you mean.. Firstly, what button? and secondly, what would that something else be?

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 29, 2014 - 4:26 pm

Ike said
It depends what you mean.. Firstly, what button? and secondly, what would that something else be?

The actual "Thank" button.  I saw that you are able to change the "Thank" to something like "Like" instead.  Is there a way to add a second button for people to, let's say..."Dislike"?  

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 29, 2014 - 6:43 pm

I don't think so, if you look at the way the thanks plugin works in the plugin options on the admin page, it only really caters for additional points, although I could be wrong. You can certainly duplicate the button, and it might be possible to get it to subtract points but I'd rather have this clarified before looking into it.

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: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626