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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.