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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.