Oh good! I couldn't get carefree's code to work with 2.7 so I took RAMMSTEINS code, which looks like this and it works for me in 2.7:
Code:
<?php
header("content-type:text/xml;charset=utf-8");
require 'include/config.php';
$url = VSHARE_URL;
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'>";
# channels
$sql = "SELECT channel_id, channel_name FROM `channels`
ORDER BY `channel_sort_order` ASC";
$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(6,7);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","_", $info[1]));
echo "<url><loc>$url/channel/".$info[0]."/".$info[1]."/</loc>";
echo "<changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}
# videos
$sql = "SELECT video_id, video_title, video_add_date FROM `videos` WHERE
`video_active`='1' AND
`video_approve`='1' AND
`video_type`='public'
ORDER BY `video_id` DESC";
$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(4,6);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","-", $info[1]));
echo "<url><loc>$url/view/".$info[0]."/".$SefUrl."/</loc>";
echo "<lastmod>".$info[2]."</lastmod><changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}
# tags
$sql = "SELECT tag FROM `tags` WHERE
`active`='1' AND
`tag_count` > 0
ORDER BY `tag_count` DESC";
$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(1,4);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","_", $info[1]));
echo "<url><loc>$url/tag/".$info[0]."/</loc>";
echo "<changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}
mysql_close($conn);
echo "</urlset>";
?>
The only thing I had to do to my site was remove the ampersand (&) from my channel titles in vShare which caused the same problem as it did with 2.6. I'm weeding thru this to see what I did last time to fix it, but for now I just took that out of my channel titles in vShare admin panel.
Bookmarks