Here is a small code for the top5 video, can be used like exemple (easy to do the same for music for exemple):
<?phprequire_once('inc/db.inc.php');
// next, query for a list of titles, files and links.
$result = mysql_query("select * from RayMovieFiles, gvideo_rating where ID = gal_id order by gal_rating_sum DIV gal_rating_count desc limit 5");
// third, build the playlist
header("content-type:text/xml;charset=utf-8");
echo "<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\">\n";
echo "<channel>\n";
echo "<title>RSS Top5 playlist</title>\n";
echo "<link>http://www.yoursite.com</link>\n";
while($row < mysql_numrows($result)) {
echo "\t<item>\n";
echo "\t\t<title>". mysql_result($result,$row,'Title')."</title>\n";
echo "\t\t<description>" . mysql_result($result,$row,'Description') . "</description>\n";
echo "\t\t<media:content url=\""."viewVideo.php?=" . mysql_result($result,$row,'Uri') . "\" type=\"video/x-flv\" />\n";
echo "\t</item>\n";
$row++;
}
echo "</channel>\n";
echo "</rss>\n";
?>
Hope that this small exemple can help somebody :-)
Thanks. :)
Go to yourdomain.com/rss.php and you will have the result :-)