Jump to content

php modification for vbulletin


stevew

Recommended Posts

I want to have a members reputation points be divided by their post# to get an average rating. (I will be calling "average"  "user rating" instead)

 

 

index.php?action=dlattach;topic=146527.0;attach=2049

 

 

The average comment below the dot is my modification which was the result of the code in red

 

 

<div>Average = $post[reputation] / $post[posts]

 

Here is the postbit code from the template I edited to give you an idea of the functions:

 

['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div>  </if>

 

<if condition="$show['reputation']"><div><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><br />$vbphrase[reputation]: $post[reputation]<br /><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay] 

</span></div>

</if>

 

 

 

I also tried some php with similar results.

 

$post[reputation]/$post[posts]

<?php $userrating = $post[reputation]/$post[posts]; echo $userrating; ?>

 

 

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 also attempted javascript:

 

<SCRIPT LANGUAGE="JavaScript">

 

DIVIDE <$a> =$post[reputation]/$post[posts];

 

 

// - End of JavaScript - -->

</SCRIPT>

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/56915-php-modification-for-vbulletin/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.