// for every certain number of posts, gain a point
if ($vboptions['pcpower'])
{
$postfactor = intval($post['posts'] / $vboptions['pcpower']);
}
else
{
$postfactor = 0;
}
// for every certain number of reputation points, gain a point
if ($vboptions['kppower'])
{
$reputationfactor = intval($post['reputation'] / $vboptions['kppower']);
}
else
{
$reputationfactor = 0;
}
// for every certain number of days registered, gain a point
$timepassed = intval((TIMENOW - $repjoindate) / 86400);
if ($vboptions['rdpower'])
{
$timefactor = intval($timepassed / $vboptions['rdpower']);
}
else
{
$timefactor = 0;
}
// compute the user's total reputation power
$score = $score + $postfactor + $timefactor + $reputationfactor;
# the following only matters for admin
$perms = fetch_permissions(0, $post['userid'], $post);
if ($perms['adminpermissions'] & CANCONTROLPANEL AND $vboptions['adminpower'])
{
$score = $vboptions['adminpower'];
}
else if (($post['posts'] < $vboptions['minreputationpost']) OR ($post['reputation'] < $vboptions['minreputationcount']))
{
$score = 0;
}
#####
// for every certain number of posts, gain a point
if ($vboptions['pcpower'])
{
$postfactor = intval($rawposts / $vboptions['pcpower']);
}
else
{
$postfactor = 0;
}
// for every certain number of reputation points, gain a point
if ($vboptions['kppower'])
{
$reputationfactor = intval($post['reputation'] / $vboptions['kppower']);
}
else
{
$reputationfactor = 0;
}
// for every certain number of days registered, gain a point
$timepassed = intval((TIMENOW - $repjoindate) / 86400);
if ($vboptions['rdpower'])
{
$timefactor = intval($timepassed / $vboptions['rdpower']);
}
else
{
$timefactor = 0;
}
// compute the user's total reputation power
$score = $score + $postfactor + $timefactor + $reputationfactor;
# the following only matters for admin
$perms = fetch_permissions(0, $post['userid'], $post);
if ($perms['adminpermissions'] & CANCONTROLPANEL AND $vboptions['adminpower'])
{
$score = $vboptions['adminpower'];
}
else if (($rawposts < $vboptions['minreputationpost']) OR ($post['reputation'] < $vboptions['minreputationcount']))
{
$score = 0;
}
That works for me. Good luck.
It actually work well now. Actually it works extremely well. Thanks for fixing it hambil!
Guys, I think I found a MUCH simpler way to do this. I assumed there was a function in vB to compute the reputation power, and there is. Why not use this function?
if I've installed the way the first post says to, am I supposed to update anything. I've read the thread and several people say to change several things.
if I've installed the way the first post says to, am I supposed to update anything. I've read the thread and several people say to change several things.
My change is a complete replacement of the first post. I was hoping somone could validate it, so I knew I wasn't just being crazy...then I'd post it as a completely different mod.