The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How exactly can I display the number of registered members, threads, posts, and online users in my forum header?
|
#2
|
||||
|
||||
This is going to involve modifying global.php or functions.php, I am not sure which one. Basicly the header template is parsed before almost every other template, so basicly your going to have to move those functios/variables around. I am unfamiliar with doing this, but hopefully some of the smarter members here will be able to help
|
#3
|
||||
|
||||
Up! :noid:
|
#4
|
||||
|
||||
You have to put the code somewhere before line 278 in global.php (the one in your main forums directory). I'd recommend putting it right before
// parse PHP include ################## |
#5
|
||||
|
||||
Quote:
|
#6
|
||||
|
||||
As done on this forum:
Code:
// get online users $datecut=time()-$cookietimeout; $headerguests=$DB_site->query_first("SELECT COUNT(*) AS count FROM session WHERE userid=0 AND lastactivity>$datecut"); $headerusers=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lastactivity>$datecut"); $headeronline=$headerguests[count]+$headerusers[count]; |
#7
|
||||
|
||||
Thanks Chen!
|
#8
|
|||
|
|||
I'd like to install this hack, Firefly: would you like to document it as a proper hack? (If not, I'm happy to do so).
|
#9
|
||||
|
||||
|
#10
|
|||
|
|||
What a star.
Now, to find out how I get rid of the "register" link in my top bar, if the user's registered. That's got to be pretty easy. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|