PHP / MySQL : Google Spider & DB Commands

Discussion in 'Web Design & Coding' started by D Schrute, Dec 12, 2004.

  1. D Schrute

    D Schrute Assistant Sensei VIP Member

    Joined:
    Aug 31, 2004
    Messages:
    1,201
    Likes Received:
    19
    Location:
    VA & NC
    I am trying to run a database command to allow google to spider my forum topics but i keep getting errors when running this one in particular:

    Code:
       ##############################################################  
       ## MOD Title: enhance-google-indexing 
       ## MOD Author: Showscout & R. U. Serious 
     ## MOD Description: If the User_agent includes the string 'Googlebot', then no session_ids are appended to links, which will (hopefully) allow google to index more than just your index-site. 
       ## MOD Version: 0.9.1  
       ##  
       ## Installation Level: easy 
       ## Installation Time: 2 Minutes  
       ## Files To Edit: includes/sessions.php  
       ## Included Files: n/a 
       ##############################################################  
       ## Author Notes: There may be issues with register globals on newer  
       ##	   PHP version. If you know for sure and also how to fix it post in 
       ##	   this thread: http://www.phpbb.com/phpBB/viewtopic.php?t=32328 
       ## 
       ##	   Obviously, if someone thinks it's funny to surf around with a 
       ##	   user_agent containing Googlebot and at the same time does not 
       ##	   allow cookies, he will loose his session/login on every pageview. 
       ##	   Should he complain to you, tell him to eat your shorts. 
       ## 
       ##	   If you want to add further crawlers look at the appropiate line and  
       ##	   feel free to add part of the user_agent which should be _unique_ 
       ##	   unique to that, so a user is never confused with a bot. 
       ##  
       ##############################################################  
       ## Version History: 0.9.0 initial release, only googlebot 
     ##				 	 0.9.1 added inktomi (MSN-search/crawler-bot) 
       ##############################################################  
       ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD  
       ##############################################################  
        
       #-----[ OPEN  ]------------------------------------------  
       includes/sessions.php 
        
       #-----[ FIND ]------------------------------------------  
          global $SID; 
        
          if ( !empty($SID) && !eregi('sid=', $url) ) 
        
       #-----[ REPLACE WITH ]------------------------------------------  
          global $SID, $HTTP_SERVER_VARS; 
        
     if ( !empty($SID) && !eregi('sid=', $url) && !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') && !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'[email protected];')) 
        
       #  
       #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------  
       #  
       # EoM  
      
    I get this error message :
    Any ideas?
     
    D Schrute, Dec 12, 2004
    #1
    1. Advertisements

  2. D Schrute

    James Photojournalist

    Joined:
    Dec 24, 2002
    Messages:
    6,662
    Likes Received:
    35
    I would think by now, in the latest version of phpBB, they would include this hack. They didn't back in 2.0.3. I'm glad we are away from that software now.

    I'd have to see the original and changed file you edited.
     
    James, Dec 12, 2004
    #2
    1. Advertisements

  3. D Schrute

    D Schrute Assistant Sensei VIP Member

    Joined:
    Aug 31, 2004
    Messages:
    1,201
    Likes Received:
    19
    Location:
    VA & NC
    Thanks James... I went in and manually changed the files... I was under the impression that I could run that text file in SQL, that is where I got the error.
     
    D Schrute, Dec 13, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.