stevew Posted June 24, 2007 Share Posted June 24, 2007 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) 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.