The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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?
|
#2
|
|||
|
|||
anyone?
|
#3
|
|||
|
|||
[sql]SELECT SUM(fieldx) from userfield[/sql]
|
#4
|
|||
|
|||
Is there a way for this total to show on one of my pages on the site (home page for example)?
|
#5
|
|||
|
|||
On any vB powered page (script) you could add a:
PHP Code:
|
#6
|
|||
|
|||
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?
|
#7
|
|||
|
|||
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.
|
#8
|
|||
|
|||
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? |
#9
|
|||
|
|||
Change that query to:
PHP Code:
|
#10
|
|||
|
|||
Thanks!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|