Results 1 to 3 of 3

Thread: [addon] Video Sitemap for VShare

  1. #1
    Join Date
    Feb 2008
    Location
    Greece
    Posts
    235

    Default [addon] Video Sitemap for VShare

    Webmasters will now be happy as you can help Google index your videos and make it more searchable through Google Video Search. You can now tell Google where are your video files and they will be gladly added into their web crawler, that is if you submit with a sitemap which is compliance to Google Sitemap Protocols, which has been standardize by Google, Microsoft and Yahoo! since year 2006.

    To get you started:

    1) Create a Video Sitemap

    I have managed to build a Video Sitemap for Vshare.

    This is what I am currently using. I submitted it to Google and he liked it. No problems so far.

    Just edit your MySQL Details and your site name in the script, then save it in your site root as "video-sitemap.php" .

    Code:
    <?php
    echo "<?xml version='1.0' encoding='iso-8859-1'?>";
    echo "<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:video='http://www.google.com/schemas/sitemap-video/1.0'>";
    
    // hostname on which MySQL is (usally localhost)
    $dbhost = "localhost";
    // Database name
    $dbname = "my_database_name";
    // Username
    $dbuser = "my_user_name";
    // Password
    $dbpass = "my_password";
    
    // mysql_connect() fnction
    $conn = mysql_connect($dbhost,$dbuser,$dbpass)
    or die("Unable to connect to MySQL.");
    
    // mysql_select_db() function
    mysql_select_db($dbname,$conn)
    or die("Unable to connect to Database $dbname");
    
    $sql = "Select  VID, title, description, adddate, flvdoname, duration from video where approve=1 and active=1";
    
    // execute SQL Command
    $res = mysql_query($sql,$conn)
    or die( "Error: " . mysql_error() );
    
    // Retrieve Results
    while ($info = mysql_fetch_row($res)) {
    $SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","-", $info[1]));
    
    $title=str_replace("&","e", $info[1]);
    $title=str_replace("\"","", $title);
    
    $desc=str_replace("&","e", $info[2]);
    $desc=str_replace("\"","'", $desc);
    $desc=str_replace("<","", $desc);
    $desc=str_replace(">","", $desc);
    
    echo "<url>
    <loc>http://www.yoursite.com/view/".$info[0]."/".$SefUrl."/</loc>
    <video:video>
    <video:content_loc>http://www.yoursite.com/flvideo/".$info[4]."</video:content_loc>
    <video:player_loc allow_embed='yes'>http://www.yoursite.com/player.swf</video:player_loc>
    <video:title>".$title."</video:title>
    <video:description>".$desc."</video:description>
    <video:thumbnail_loc>http://www.yoursite.com/thumb/".$info[0].".jpg</video:thumbnail_loc>
    //change the following line if your site contains adult videos
    <video:family_friendly>Yes</video:family_friendly>
    <video:duration>".$info[5]."</video:duration>
    </video:video></url>";
    }  
    echo "</urlset>";
    
    // mysql_close() function
    mysql_close($conn);
    ?>
    2) Sign into Google webmaster tools with your Google Account.
    3) Add your site to your account. Your site will be the URL to the directory at which you’ve placed your Video Sitemap. For example, if the URL to your Sitemap is “http://www.example.com/videofeed.xml”, you will need to add a site “http://www.example.com”.
    4) Click Add a Sitemap beside the site.
    5) Select Video Sitemap.
    6) Type the URL to your Video Sitemap in the provided field. Make sure you include the entire URL, such as “http://www.example.com/video-sitemap.php”.
    7) Click Add Video Sitemap.

  2. #2
    Join Date
    Jan 2009
    Posts
    8

    Default Re: [addon] Video Sitemap for VShare

    Great, works perfectly, thxs :D

  3. #3

    Default Re: [addon] Video Sitemap for VShare

    i get thsi error when i try to validate it.
    Encoding within XML declaration iso-8859-1 must be 'UTF-8

Similar Threads

  1. [addon] Google Sitemap Generator
    By RAMMSTEIN in forum Template Modifications
    Replies: 5
    Last Post: 11-07-2008, 04:25 AM
  2. Google Video Sitemap
    By CliftonH in forum Web Site Promotion
    Replies: 6
    Last Post: 08-10-2008, 10:20 PM
  3. [ADD ON] VShare Video Sitemap (FREE)
    By ramius in forum Template Modifications
    Replies: 8
    Last Post: 04-22-2008, 11:25 PM
  4. New Google video sitemap !!!
    By chadon in forum Feature Requests
    Replies: 2
    Last Post: 12-21-2007, 06:48 PM
  5. Sitemap Generator for vShare
    By autodafe in forum General Discussions
    Replies: 14
    Last Post: 10-24-2007, 03:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •