![]() |
Help Needed
Does anyone know a way to take the numerical value of a custom profile field of all the members and add them up and print it out?
|
anyone?
|
[sql]SELECT SUM(fieldx) from userfield[/sql]
|
Is there a way for this total to show on one of my pages on the site (home page for example)?
|
On any vB powered page (script) you could add a:
PHP Code:
|
in a template would I just need to put '$sum_suerfield' where I want it to show up or do I need to use something like $post?
|
If you make sure the above code is in the script that evaluate the template, and that it is executed before the template is called, then yes.
|
Sorry to be a pain but yes to which one - using $sum_userfield by itself or using it like $post[sum_userfield] ?
My plans for now (while the board is smaller) to put this in the Navigational Bar - I will add your code to the global.php file. Can you tell me what I would need to use based on that info? Anyone? |
Change that query to:
PHP Code:
|
Thanks!
|
All times are GMT. The time now is 03:05 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:
|