View Full Version : how can i add forum stats to header ?
fSpeeD
07-23-2007, 10:04 AM
how can i add forum stats to header ?
https://vborg.vbsupport.ru/attachment.php?attachmentid=67402&stc=1&d=1185188647
fSpeeD
07-24-2007, 10:01 AM
any answer pls? this not impossible because one more forum use that stats.
ragtek
07-24-2007, 10:12 AM
this is a translation from a post of merlin http://www.my-vb.de/board/hacks-addons-fuer-vbulletin-3-6-x/194-forum-statistik-ueberall-verfuegbar.html#post1766
at hook init_start: $datastore_fetch[] = "'userstats'";
hook: global_start
// Themen & Beitr?ge
$counters = $db->query_first("SELECT SUM(threadcount) AS threads, SUM(replycount) AS replies FROM " . TABLE_PREFIX . "forum");
$totalposts = vb_number_format($counters['replies']);
$totalthreads = vb_number_format($counters['threads']);
// Neuester Benutzer
$numbermembers = vb_number_format($vbulletin->userstats['numbermembers'];
$newusername =& $vbulletin->userstats['newusername'];
$newuserid =& $vbulletin->userstats['newuserid'];
// User/G?ste Online
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests = 0;
$headerusersq = $db->query_read("SELECT userid, lastactivity FROM " . TABLE_PREFIX . "session WHERE lastactivity > $datecut");
$headeruserinfos = array();
while ($headeruser = $db->fetch_array($headerusersq))
{
if (!headeruser['userid'])
{
$headerguests++;
}
else if (empty($headeruserinfos["$headeruser[userid]"]) OR ($headeruserinfos["$headeruser[userid]"]['lastactivity'] < $headeruser['lastactivity']))
{
$headeruserinfos["$headeruser[userid]"] = $headeruser;
}
}
if (!$vbulletin->userinfo['userid'] AND $headerguests == 0)
{
$headerguests++;
}
$headerguests = count($headeruserinfos);
$totalonline=$headerguests+$headerusers;
unset($headeruserinfos);
$db->free($headerusersq);
then insert the variables into the headertemplate
fSpeeD
07-24-2007, 06:47 PM
thank you (:
vishal.garg
08-12-2007, 10:07 AM
what is "at hook init_start:"
Opserty
08-12-2007, 10:24 AM
It is the hook Location.
AdminCP -> Plugin Manager -> Add New Plugins
For the "Hook Location" set it to init_start.
vishal.garg
08-12-2007, 04:30 PM
i did that but itz not working :(. Any expert plz help...
thnks in advance
GameWizard
10-17-2007, 03:19 AM
I too attempted to use the code above without any luck.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.