Comment Author Ranks – Close to being done, need help!
-
Hi, I am trying to do the following idea:
Every Comment Poster (Only Comment poster), will have a LEVEL from 1 to 50 based on how many COMMENTs they have posted since registration. As well as show the current total of comment posts.
I managed to get far with this!
Guests have a ELSE { } call, that gives then all a Level 1.
However, my problem is finding the COMMENT POSTER ID.
I downloaded a Plugin called: Bainternet User Ranks (https://en.bainternet.info/2011/wordpress-user-ranking) that does this for POST AUTHORS, and is supposed to collect information from ALL registered Users with an ID, collecting their total of Posts and Comments.
However, I cant manage to find a way to collect the ID of all the Commment Authors from a Particular Post.
Here comes your help! Please, I lie not when saying I lost over 20 hours trying already.
Here is the code I am using right now:
<?php $user = ""; if ($comment->user_id) { $user=get_userdata($comment->user_id); $baur_plugin = new baur_Plugin(); $user_rank = $baur_plugin->ba_get_user_points($user->ID); echo "". $user_rank['title']; echo "". $user_rank['points']; echo $user->ID; } else { echo "1"; } ?>
If you look at echo user->ID, that code DOES return ID 1 and ID 2 perfectly to the respective Comment Posters on my page, but, when addressed for this plugin, the Comment Loop ends up calculating wrong Ranks…. It should show Level 11 for ID 2, and Level 50 for ID 1, but it shows level 2, and level 22, then shows level 661… Its strangely broken.
Link to the Page:
https://demolishman.com/diablo/about-us/feedback/Just look at it.. First its Level 1 (Blue post is me). Then its Level 661?
I configured ranks like this:
Rank 1 = Level 1 = 1 post.
rank 5 = Level 5 = 50 posts.
Rank 50 = Level 50 = 500 posts.I have over 500 posts, so I should ALWAYS show as level 50.
Help?
- The topic ‘Comment Author Ranks – Close to being done, need help!’ is closed to new replies.