Support Forum
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!
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
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.
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?
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')
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"?
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.
1 Guest(s)