Needed Video Sitemap for PHPVibe Video CMS


#1

Hi,

I am using PHPVibe on my video website , for that I needs a video sitemap which should be as the Google Video Sitemap Markup . https://developers.google.com/webmasters/videosearch/sitemaps#adding-video-content-to-a-sitemap

Can any one make a video sitemap for me ,


#2

make a file called “sitemap.php”, and insert the following code:

    <?
    require_once("load.php"); 
     
    header("Content-Type: text/xml"); 
     
    if(! isset($_GET[sayfa])) $sayfa=1; else $sayfa=$_GET[sayfa]; 
     
    if($sayfa=="index"): 
     
     
    $index_sayi=mysql_num_rows(mysql_query("SELECT `id` FROM `vibe_videos`")); 
     
    $index_sayi=ceil($index_sayi / 5000); 
     
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> 
       <sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n"; 
     
    for($i=0; $i<$index_sayi; $i++){ 
    echo "<sitemap> 
          <loc>".SITE_URL."sitemap.php?sayfa=".($i+1)."</loc> 
          <lastmod>".str_replace(' ', 'T', $sonuc['date'])."+01:00</lastmod> 
       </sitemap>\n"; 
    } 
     
     
    echo "</sitemapindex>"; 
     
    else: 
     
    $sorgu=mysql_query ( "SELECT  * FROM vibe_videos WHERE pub > 0 ORDER BY `date` DESC" );
    $date = str_replace(" ", "T", $sonuc['date']);
     
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> 
    <urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" 
     xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">\n"; 
     
    while($sonuc=mysql_fetch_assoc($sorgu)): 
     
    echo "  <url> 
                    <loc>".SITE_URL."video/". $sonuc['id']."/".nice_url($sonuc['title'])."/</loc> 
                    <lastmod>".str_replace(' ', 'T', $sonuc['date'])."+01:00</lastmod> 
                    <changefreq>daily</changefreq> 
                    <priority>0.5</priority> 
            </url>\n"; 
     
    endwhile; 
    echo '</urlset>'; 
     
    endif; 
    ?>

then insert these two lines in your .htaccess file (follow this line: “RewriteRule ^index.php$ - [L]”)

RewriteRule ^sitemap.xml sitemap.php
RewriteRule ^sitemap(.*).xml?$ sitemap.php?sayfa=$1 [L]