View Full Version : Members, threads, posts, and online users
LanciaStratos
11-23-2001, 04:06 AM
How exactly can I display the number of registered members, threads, posts, and online users in my forum header?
Sinecure
11-23-2001, 05:51 AM
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 :D
LanciaStratos
11-25-2001, 04:20 AM
Up! :noid:
tubedogg
11-26-2001, 04:46 AM
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 ##################
LanciaStratos
11-27-2001, 04:03 AM
Originally posted by tubedogg
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 ################## Great, thanks Kevin! :D I've got one more question, though. Which lines of code must I copy (from index.php into global.php) for the total number of online users? It appears to be a bit more complicated than the other three... :confused:
Admin
11-27-2001, 11:47 AM
As done on this forum:
// 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];
LanciaStratos
11-27-2001, 10:26 PM
Thanks Chen! :D
James Cridland
12-08-2001, 04:57 PM
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).
Admin
12-08-2001, 06:05 PM
https://vborg.vbsupport.ru/showthread.php?s=&threadid=33048 :)
James Cridland
12-08-2001, 07:19 PM
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.