GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I couldn't figure out why google wasn't indexing my site...then... (https://gfy.com/showthread.php?t=862703)

camperjohn64 10-17-2008 10:33 AM

I couldn't figure out why google wasn't indexing my site...then...
 
So I checked and double checked my code and found that I had some code that checked for a cookie to show adult content. This was supposed to check if the browser was Google and let Google see everything even if the "over 18 button" was not clicked.

But the code had a bug, and was refusing to show Google any HTML at all since the Google crawler had not clicked on the "over 18 button" and set the cookie. My override code, to check if Google was coming had a bug.

My heart sank when I saw this. Months of Google crawling and never indexing wasted.

TheStout 10-17-2008 10:38 AM

What was the code and how did it get there?

pussyserver - BANNED FOR LIFE 10-17-2008 10:40 AM

Quote:

Originally Posted by camperjohn64 (Post 14914424)
So I checked and double checked my code and found that I had some code that checked for a cookie to show adult content. This was supposed to check if the browser was Google and let Google see everything even if the "over 18 button" was not clicked.

But the code had a bug, and was refusing to show Google any HTML at all since the Google crawler had not clicked on the "over 18 button" and set the cookie. My override code, to check if Google was coming had a bug.

My heart sank when I saw this. Months of Google crawling and never indexing wasted.

Can you please post the exact code that caused the error thanks

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.


All times are GMT -7. The time now is 03:42 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123