![]() |
User rating calculated via reputation points/post count
With the rep system currently, new members are lost in the sea of reputation totals from senior members, and its impossible to determine if they are low rep for any reason..it undermines the whole rep system because it's ambiguous.
Why not have a rep display that determines your average rep per post...this way a new member can get in on the game and get noticed as a substantial contributor immediately. These ratio's are reached by:Reputation/posts Member 1 Posts: 2190 Reputation: 1256 Average: .57 Member 2 Posts: 710 Reputation: 1219 Average: 1.71 Member 3 Posts: 66 Reputation: 278 Average: 4.20 As you can see clearly member 3 is on course to being the most reputable of the bunch, whereas without the average displayed, he would go virtually un-noticed. Is this something that can be implemented easily? |
1 Attachment(s)
So far I've managed this result. Anyone php saavy able to have the calculations done hidden, and make "average" a variable (quotient ) to display in the postbit?
<div>Average = $post[reputation] / $post[posts] (see screen shot) |
$post[reputation]/$post[posts]
<?php $userrating = $post[reputation]/$post[posts]; echo $userrating; ?> eg this puts: 220/93 in the postbit, below the reputation points total - I just can't get it to calculate and place the quotient instead. Suggestions? Do I have to run the php function from reputation.php and then call up the variable from the postbit template? I see there may be other issues: http://www.vbulletin.com/forum/showthread.php?t=234222 so I guess I need a plugin. How would I know where the hook location is for this modification? reputation.php? |
Use this in the template:
Code:
<if condition="$post[average] = $post[reputation] / $post[posts]">$post[average]</if> |
I get this error when I attempt to save the template after changes.
Warning: Division by zero in /includes/adminfunctions_template.php(3596) : eval()'d code on line 64 If I wanted to have [User rating] instead of [average], which [] would be [userrating] and which would be [User rating] ? Thanks btw! UPDATE Ok, I ignored the warning as it has to do with members starting with 0 posts. Anyway, it calculates correctly as long as the amount of reputation being divided is greater than the total posts. ie 1200 reputation/400 posts is ok - except it brings it to the 8th decimal..can I limit it to 2 decimal points? 400 reputation/1200 posts would result in an incorrect number (sometimes just repeats the reputation points # again) |
Code:
<if condition="$post[reputation] != 0"><if condition="$post[average] = $post[reputation] / $post[posts]">$post[average]</if></if> |
1 Attachment(s)
OK. I no longer got the error message about dividing by zero...:)
This is the result. There are a lot of decimals, and when the reputaion points are less than the post count, it just repeats the reputation number. I appreciate your help. Any fix for these two things? |
Code:
<if condition="$post[reputation] != 0"><if condition="$post[average] = vb_number_format($post[reputation] / $post[posts], 2)">$post[average]</if></if> |
I received this error when trying to save the changes:
Quote:
|
Damn, you might have to add a plugin then. Put this in your template:
Code:
$post[average] PHP Code:
|
Ok. This did limit the quotients to 2 decimal points... but it still produced the wrong results as before when dealing with members having less reputation points than post count.
(it just repeats the reputation points #) :cool: |
What do you want it to do? It's performing the calculation you told it to do.
|
Quote:
http://www.vbulletin-faq.com/forum/a...7&d=1182758611 959/1546 = 959 ??? > > > |
Heh, I don't know what's wrong with it, what hacks have plugins hooked at postbit_display_complete?
|
1. vB Ad Management - Ads in Postbit (disabled)
2. Remove popup rep (I believe this refers to the User Defined Reputation Points hack) |
Sorry man..that's works perfectly. I didn't realize before that part of the code was a plugin.
Thanks! UPDATE: This calculation works perfectly unless the members post count is 1000 or more. In that case it just repeats the users reputation points in the "User rating" location. Join Date: Jan 2007 Posts: 999 Rep points: 300 User rating: 0.30 Join Date: Jan 2007 Posts: 1,000 Rep points: 300 User rating: 300.00 |
Just in case anybody wants to apply this mod, this link explains how to make it work. Thanks for your help Dismounted. :up:
http://www.vbulletin.com/forum/showthread.php?t=235180 |
All times are GMT. The time now is 06:18 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|