![]() |
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 :) |
You will need to do the calculation in a plugin.
|
Any idea how this is done? I'm a n00b at this sort of thing lol
|
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 :p
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:
|
Is anyone able to help with this? :)
|
They did?
|
They did what?
|
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. |
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.
|
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; |
All times are GMT. The time now is 06:49 PM. |
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:
|