camperjohn64 |
10-17-2008 10:43 AM |
I put it there!
Code:
// If its a crawler looking for content
$agentlist = array("Web Indexer","crawlerinfo","TurnitinBot","Mediapartners-Google","Googlebot","genieBot","YahooYSMcm","picsearch","[email protected]","Slurp",
"Yahoo!","Sidewinder","Scooter","InfoSeek","Ultraseek","vscooter","Gulliver","Crawler",
"Baiduspider","RealWebCrawler","Gigabot","Ask Jeeves","Dead Link Checker","msnbot",
"Robot","knowledge agent","ArchitextSpider","Offline Explorer");
if (in_array ($_SERVER['HTTP_USER_AGENT'],$agentlist))
{
// When Google crawls, Google gets everything
$a = USER_CATEGORY_SFW | USER_CATEGORY_STRAIGHT | USER_CATEGORY_GAY;
}
if (cookie_set('ov18'))
{
// If the user has previously clicked the over 18 button, show him everything
$a = USER_CATEGORY_SFW | USER_CATEGORY_STRAIGHT | USER_CATEGORY_GAY;
}
else
{
// Show users mainstream content as they may be at work
$a = USER_CATEGORY_SFW;
}
Do you see the bug?
Code:
if (in_array ($_SERVER['HTTP_USER_AGENT'],$agentlist))
{
}
if (cookie_set('ov18'))
{
}
else
{
}
// Here is the correct code, with the correct else statement
if (in_array ($_SERVER['HTTP_USER_AGENT'],$agentlist))
{
}
// !!!!!!!!!!!!!
else if (cookie_set('ov18'))
{
}
else
{
}
I don't need the bug fixed, I was just so disappointed when I saw it!! The second set of if/else was overrriding anything to do with the browser check.
|