Top 5 video RSS

unlimeet posted 28th of July 2008 in Community Voice. 3 comments.

Here is a small code for the top5 video, can be used like exemple (easy to do the same for music for exemple):

<?php
require_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 :-)

 
Comments
·Oldest
·Top
Please login to post a comment.
lrepton
In what file should it be posted?
thinklucky13
Can you give me more details on filename (or can i make it up), what needs to be changed in the script to make it work, etc...

Thanks. :)
unlimeet
Just creat a file name rss.php and copy all this script inside.
Go to yourdomain.com/rss.php and you will have the result :-)
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.048534870147705