AVS and Googlebot FIx

Discuss of AVS script, custom modifications or anything related to this video script

AVS and Googlebot FIx

Postby nuevolab » Wed Oct 20, 2010 11:12 pm

If you set your videos can be watched by registered users only or make use of badwidth control, you can be sure that Googlebot won't ever index any of your video pages.
Here's a quick fix for AVS 2.x

Edit file "classes/auth.class.php" and find code:
Code: Select all
    public function check()
    {
        if ( isset($_SESSION['uid']) && isset($_SESSION['email']) ) {
            if ( $_SESSION['uid'] != '' && $_SESSION['email'] != '' ) {
                return true;
            }
        }

After it from new line you can add some code to check for googlebot.
Code: Select all
   $ip = $_SERVER['REMOTE_ADDR'];
   $name = gethostbyaddr($ip);
   if(preg_match("/Googlebot/i",$name)){ return true; }


Edit file "classes/bandwidth.class.php", find code:
Code: Select all
        global $config, $conn, $lang;

enter in new line:
Code: Select all
   $ip = $_SERVER['REMOTE_ADDR'];
   $name = gethostbyaddr($ip);
   if(preg_match("/Googlebot/i",$name)){ return true; }


Good luck.
nuevolab
Site Admin
 
Posts: 99
Joined: Sun Sep 06, 2009 2:32 am

Return to AVS

Who is online

Users browsing this forum: No registered users and 0 guests

cron