View Full Version : Possible to put stats in headers/ footer?
JohnBee
10-27-2004, 05:27 PM
I was looking at my homepage and my goal is to design a page
with intereactive header /footer information from the forum etc.
Is this easilly done? can I just copy & paste panel info's in there?
Your help is appreciated,
John B.
Brian
10-27-2004, 05:33 PM
You would also have to add the code in your vBulletin files.
JohnBee
10-27-2004, 05:34 PM
What about using the custom page option
if I did this is there an existing templates I could use the code
to get a head start and customize it from there?
Damned fast responses on this forum ;)
Brian
10-27-2004, 05:58 PM
The code would have to be added in global.php file, or whatever file you want it to appear in as well. It's more than just editing a template.
JohnBee
10-27-2004, 06:26 PM
is it complicated?
Say I want to display Active users, total registered members, new threads
today etc, etc. in the footer
as far as the layout is concerned I'm okay with it all but how would
I add the necessary support code to get it to work in the footer?
can you give me an example?
JohnBee
10-30-2004, 09:50 PM
Okay I get the feeling this is not an easy question to answer.
so...
Can anyone point me in the right direction?
I will work through it myself.
Brian
10-30-2004, 09:52 PM
Copy the code from the stats.php file, place it in your global.php file, and play around with things.
Fargo
11-03-2004, 09:19 AM
I added the following information into my phpincludeStart template:
// forum stats start
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);
// forum stats end
// total online start
$datecut = TIMENOW - $vboptions['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");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end
now you can use the '$xxx' variables found above within your templates. Works like a charm :)
Information was found in this thread:
http://www.vbulletin.org/forum/showthread.php?t=68941
JohnBee
11-17-2004, 05:47 PM
FANTASTIC!
thank you very much :D
cdembek
02-11-2006, 10:28 PM
bump.. can't figure this out.. tried to move things in the global.php and nothing..
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.