
11-04-2005, 10:55 PM
|
|
|
Join Date: Oct 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by funkmeister
How do I correct the guest count? In otherwords, it's adding the total number of guests and spiders together and places that total in the parentheses for the guests.
So it looks like guests (6), MSNbot (4) when in fact there are are only 2 guests and 4 spiders. It doesn't effect the spider reporting, so in other words, in this example, MSNbot (4), is shown correctly.
Thanks in advance.
|
After some experimentation I was able to figure it out....just the change the code in index.php in this chunk....to this, if you want the same desired effect:
Quote:
$spiderlist = array();
while ($spidercand = $db->fetch_array($spiders))
{
$userid = $spidercand['userid'];
if (!empty($vbulletin->wol_spiders))
{
if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', $spidercand['useragent'], $agent))
{
$agent = strtolower($agent[1]);
$spider = $vbulletin->wol_spiders['agents']["$agent"];
$key = $spider['name'];
if(array_key_exists($key,$spiderlist))
{
$spiderlist[$key] = $spiderlist[$key] + 1;
}
else
{
$spiderlist[$key] = 1;
}
$numberspiders++;
}
}
}
$numberguest = $numberguest - $numberspiders;
if ($numberguest > 0)
{
if ($numberguest > 1)
{
$loggedin['musername'] = "Guest (".$numberguest.")" ;
}
else
{
$loggedin['musername'] = "Guest";
}
$loggedin['userid'] = 0;
eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
}
while ($spidername = current($spiderlist))
{
if ($spidername > 1) {
$loggedin['musername'] = key($spiderlist) . " (" . $spidername.")";
}
else
{
$loggedin['musername'] = key($spiderlist);
}
$loggedin['userid'] = 0;
eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
next($spiderlist);
}
// memory saving
unset($userinfos, $loggedin);
$activeusers = substr($activeusers, 2); // get rid of initial comma
$db->free_result($forumusers);
$totalonline = $numberregistered + $numberguest + $numberspiders;
$numberinvisible = $numberregistered - $numbervisible;
|
|