Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 726

PostPosted: Mon Apr 04, 2005 1:12 pm Reply with quote

I noticed that counter.php is counting yahoo's spider as a user with a netscape browser.
The reason is, is it sees mozilla in the user agent and counts it as netscape and moves on without checking if it is a spider.

Here is the fix...
Open includes/counter.php

Find...
 /* Get the Browser data */

if((ereg("Nav"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Gold"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("X11"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Mozilla"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Netscape"$_SERVER["HTTP_USER_AGENT"])) AND 
(!
ereg("MSIE"$_SERVER["HTTP_USER_AGENT"]) AND 
(!
ereg("Konqueror"$_SERVER["HTTP_USER_AGENT"])) $browser "Netscape"


Change to...

 /* Get the Browser data */

if((ereg("Nav"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Gold"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("X11"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Mozilla"$_SERVER["HTTP_USER_AGENT"])) || 
(
ereg("Netscape"$_SERVER["HTTP_USER_AGENT"])) AND 
(!
ereg("MSIE"$_SERVER["HTTP_USER_AGENT"]) AND 
(!
ereg("Konqueror"$_SERVER["HTTP_USER_AGENT"])) AND 
(!
eregi("Yahoo"$_SERVER["HTTP_USER_AGENT"])))) $browser "Netscape"


I added AND (!eregi("Yahoo", $_SERVER["HTTP_USER_AGENT"]))

This will keep the yahoo spider from being counted as netscape and start being counted as a search engine
View user's profile Send private message Visit poster's website
Guardian
Mr. Awesome



Joined: Dec 09, 2006
Posts: 238

PostPosted: Sun Dec 10, 2006 11:48 am Reply with quote

Wasn't this fixed circa nuke 7.6?
Here's the full code to also include the Firefox browser
Code:
/* Get the Browser data */

if ((ereg("Nav", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Gold", $_SERVER['HTTP_USER_AGENT'])) || (ereg("X11", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Mozilla", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Netscape", $_SERVER['HTTP_USER_AGENT'])) AND (!ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) AND (!ereg("Konqueror", $_SERVER['HTTP_USER_AGENT'])) AND (!ereg("Yahoo", $_SERVER['HTTP_USER_AGENT'])) AND (!ereg("Firefox", $_SERVER['HTTP_USER_AGENT']))) $browser = "Netscape";
elseif(ereg("Firefox", $_SERVER['HTTP_USER_AGENT'])) $browser = "FireFox";
elseif(ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) $browser = "MSIE";
elseif(ereg("Lynx", $_SERVER['HTTP_USER_AGENT'])) $browser = "Lynx";
elseif(ereg("Opera", $_SERVER['HTTP_USER_AGENT'])) $browser = "Opera";
elseif(ereg("WebTV", $_SERVER['HTTP_USER_AGENT'])) $browser = "WebTV";
elseif(ereg("Konqueror", $_SERVER['HTTP_USER_AGENT'])) $browser = "Konqueror";
elseif((eregi("bot", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Google", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Slurp", $_SERVER['HTTP_USER_AGENT'])) || (ereg("Scooter", $_SERVER['HTTP_USER_AGENT'])) || (eregi("Spider", $_SERVER['HTTP_USER_AGENT'])) || (eregi("Infoseek", $_SERVER['HTTP_USER_AGENT']))) $browser = "Bot";
else $browser = "Other";
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 726

PostPosted: Sun Dec 10, 2006 1:37 pm Reply with quote

this fix was out before 7.6
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT + 10 Hours
Forums ©