Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Voting Plugin: User Score

Hi there,
I'm currently integrating your plugin into a forum for one of our clients, one question we have is does the plugin maintain an overall score for each user? I was half expecting it to update the user's score field in the DB but it doesn't seem to. Is there a way of pulling out the user's accumulative score?

Thanks for any help you can offer.

Cheers,

K

Tagged:

Answers

  • ToddTodd Vanilla Staff

    We don't summarize the user score so you'd have to do that calculation yourself. We are moving away from the voting mechanic and going more with a like/reaction mechanic so we will most likely not be updating the voting plugin anymore.

  • Thanks Todd, so is there a new project released? What we're effectively trying to achieve is a user "reputation". I think I may just do that calculation for now but consider revising the method long term.

  • ToddTodd Vanilla Staff

    We'll take pull requests if you want to add the user score. The new project needs a lot more development and testing before we release it so I can't give any timelines.

  • I was going for the same functionality as well and came up with this. Hope it helps:

    //***** Get the User's Total Votes he recieved from others ******
                                    $CommentID = $Object->CommentID;
                                    $UserID = $Object->InsertUserID;
                                    $CommentModel = new CommentModel();
                                    $Data = $CommentModel->GetID($CommentID, DATASET_TYPE_ARRAY);
    
                                    //Get the score of each Users vote in comments
                                      $ScoreComment = $CommentModel->SQL
                                        ->Select('Score')
                                        ->From('Comment')
                                        ->Where('InsertUserID', $UserID)
                                        ->Get()->ResultArray();
                                      $ScoreComment = ConsolidateArrayValuesByKey($ScoreComment, 'Score');
    
                                      /*Get the score of each Users vote in discussion because the voting
                                      plugin doesn't count the main discussion as a comment*/
                                      $ScoreDiscussion = $CommentModel->SQL
                                        ->Select('Score')
                                        ->From('Discussion')
                                        ->Where('InsertUserID', $UserID)
                                        ->Get()->ResultArray();
                                      $ScoreDiscussion = ConsolidateArrayValuesByKey($ScoreDiscussion, 'Score');
                                      $TotalVoteScore = array_sum($ScoreComment) + array_sum($ScoreDiscussion);
    
                                      echo $TotalVoteScore;
    
  • Where would that be put?

  • @Todd said:
    We don't summarize the user score so you'd have to do that calculation yourself. We are moving away from the voting mechanic and going more with a like/reaction mechanic so we will most likely not be updating the voting plugin anymore.

    I hope we see more usable results from the reaction mechanic. The voting mechanic was useful for sorting helpful topics. The current reaction mechanic, while cleverly implemented, seems to fail in the overall end result. The only real filtering of content is the best of page, which is hidden in the left column and doesn't add much value for people looking for answers here.

    Maybe the voting mechanic page structure needs to be combined with the reactions mechanic so that reactions actually have some impact on how content is viewed.

Sign In or Register to comment.