![]() |
How to display the average value of two field in postbit
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? |
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.
|
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. |
You would write the php to do this and probably use a hook location like postbit_display_complete. Plugin System
|
All times are GMT. The time now is 05:29 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|