The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Asume that my user table has two columns .One is votetotal and the other is votenum.I can print the value of them in postbit just using : post[votetotal],and post[votenum].However,i only want to print the average value of them when votenum>0 and 0 when votenum<0.
How can i do that? |
#2
|
||||
|
||||
![]()
Are you using a plugin to get the votetotal and votenum? If so, just add the php to get the average. If you aren't using a plugin, you may be able to do the math in the template just take a look at this article - Perform simple calculations inside templates!. If you can't do it in the template, then you'll have to add a plugin.
|
#3
|
|||
|
|||
![]()
I tried to do it in the templates.
Quote:
Example if the votetotal is 11,the votenum is 3.It will print 3.6666666666667 . I just want to get the value 3.67 or 4. --------------- Added [DATE]1245564040[/DATE] at [TIME]1245564040[/TIME] --------------- Quote:
However,if i want to use the plugin,how can i do that? Thanks. |
#4
|
||||
|
||||
![]()
You would write the php to do this and probably use a hook location like postbit_display_complete. Plugin System
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|