The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to work out a formula from custom fields and display in postbit
Hi, I'm wondering if anyone knows how to do a formula from the vales of certain custome profile fields and display it in the post bit.
I know Code:
$post[fieldx] Is this even possible? Thanks |
#2
|
||||
|
||||
You will need to do the calculation in a plugin.
|
#3
|
|||
|
|||
Any idea how this is done? I'm a n00b at this sort of thing lol
|
#4
|
|||
|
|||
You can't do it in a template unless you figure a way to make it work in the if conditional, but its not supposed to be there
Best bet would be to make a plugin in one of the postbit hooks, postbit_display_complete? I think or something, can't remember off the top of my head. EDIT: Whoops forgot to refresh. You can try maybe: PHP Code:
|
#5
|
|||
|
|||
Is anyone able to help with this?
|
#6
|
|||
|
|||
They did?
|
#7
|
|||
|
|||
They did what?
|
#8
|
|||
|
|||
Help. If you are still having problems, you need to post what they are.
We can't help unless we know what problems you are having. |
#9
|
|||
|
|||
Well the whole thing, I have no idea how to create a plugin or how the formula should be layed out, and thern getting it to display on the postbit.
|
#10
|
||||
|
||||
Create a plugin on the postbit_display_start hook and add the code posted by Opserty:
Code:
$percentage = (intval($post['field7']) / intval($post['field6'])) * 100; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|