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
Rating Plugin: How to ONLY display the rating for the topic (not the internal posts)
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 11, 2013 - 11:59 am

So at the moment, the displayed 'star rating' in the forum includes an average of all of the rated posts within a thread.

I would like to either:

a. Display the rating for the threadstarter post only

b. If this is not possible, to remove the ratings from all posts except the main threadstarter post. 

Any help is appreciated,

thank you

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 11, 2013 - 12:17 pm

which average?  on forum view (list of topics) or topic view (list of posts)?

not sure what you mean either by rating for the threadstarter???  the rating is on a post, not a user...  are  you trying to say you only want to show the rating on the first post in a topic????

Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 11, 2013 - 2:20 pm

Mr Papa said
which average?  on forum view (list of topics) or topic view (list of posts)?

not sure what you mean either by rating for the threadstarter???  the rating is on a post, not a user...  are  you trying to say you only want to show the rating on the first post in a topic????

Yes correct. I want to disable the ratings for all other posts within the thread. I want to leave the rating just for the very first post. That is one option.

Alternatively, another option, is to simply display the rating for the first post. Here is an image to illustrate what i mean

View post on imgur.com

See the star ratings? That rating represents an average score of ALL of the posts within the thread. NOT just the very first post. Essentially, people are rating eachother's comments within each thread, then it takes all of the ratings from the entire thread, and creates a new total average rating. That new total average rating is displayed in the forum. I would like for the rating that is displayed to be the one that is for the first post only.

Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 11, 2013 - 6:01 pm

bump

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 11, 2013 - 6:08 pm

bump????  after a few hours?  come on now... that wont get you an answer any faster...

to do this, you will have to user our api and filter template function and if its not the first post in a topic, just exit...

the picture you give however, is forum view and not topic view...  if you do the first part on topic view, that forum view will take care of itself...

are you able to handle adding a bit of code?

Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 12, 2013 - 12:28 pm

Sorry! I just noticed that you seem to everyone's issues in big swooping waves, and I thought you missed mine. Sorry again, i dont mean to be annoying.

I do not know how to do either one of your solutions.

I can add code if you tell me exactly where to put it and what to put.. can you help?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 12, 2013 - 8:28 pm

Its a national holiday here today, so wont have a chance until Monday some time to look at...  If you dont hear back on Tuesday, please tweak us again...

Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 12, 2013 - 8:46 pm

No problem. I will wait until tuesday. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 13, 2013 - 11:54 am

This should help you do what you want...  Only allows the first post in a topic to be rated... and thus the averages will only be for the first post...

however, it wont (and cannot) go back and take care of already cast votes... so you may want to consider starting the ratings over...  if so, just go to forum - options - display settings and switch the rating style to the other and back... that will reset all rating data...

add_filter('sph_PostIndexRatePost', 'my_rating_check');
function my_rating_check($out) {
    global $spThisPost;
    if ($spThisPost->post_index != 1) $out = '';
    return $out;
}

this code would go in the spFunctions.php file of your sp theme...

Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
May 13, 2013 - 5:08 pm

Worked great! Thanks Steve!

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