The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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) |
#3
|
|||
|
|||
$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? |
#4
|
||||
|
||||
Use this in the template:
Code:
<if condition="$post[average] = $post[reputation] / $post[posts]">$post[average]</if> |
#5
|
|||
|
|||
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) |
#6
|
||||
|
||||
Code:
<if condition="$post[reputation] != 0"><if condition="$post[average] = $post[reputation] / $post[posts]">$post[average]</if></if> |
#7
|
|||
|
|||
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? |
#8
|
||||
|
||||
Code:
<if condition="$post[reputation] != 0"><if condition="$post[average] = vb_number_format($post[reputation] / $post[posts], 2)">$post[average]</if></if> |
#9
|
|||
|
|||
I received this error when trying to save the changes:
Quote:
|
#10
|
||||
|
||||
Damn, you might have to add a plugin then. Put this in your template:
Code:
$post[average] PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|