In this thread: posting.php?mode=reply&f=3&t=220 there's php code that will display the RSS Feeds from vShare sites into html format:
I figured out that if I put the above PHP code into something like videos.php and then call it from an <iframe> on an html page, it works really, really nice, however, what I can't figure out is how to control the lay-out of what's being displayed. For instance, I only want to display the last 3 videos uploaded and also not have margins for the video descriptions and details indented quite as far as is being displayed.Code:<table width=100%><tr><td width=100%> <h2><a href=http://www.AltVenue.com>Currently on AltVenue.com</a></h2> <dl> <?php $RSSFile = "http://www.altvenue.com/rss.php"; $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { $tag = $name; } elseif ($name == "ITEM") { $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link; if ($name == "ITEM") { printf("<dt>%s</dt>", trim($link),htmlspecialchars(trim($title))); //printf("<dd>%s</dd>",htmlspecialchars(trim($description))); printf("<dd>%s</dd>",trim($description)); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTION": $description .= $data; break; case "LINK": $link .= $data; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen($RSSFile,"r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); xml_parser_free($xml_parser); ?> </dl> </td></tr></table>
I've searched the 'net for something along these lines and the only thing that comes close is http://www.rss2html.com which is free and customizable by using templates but it won't display the thumbs for the videos, it's mainly for regular news feeders and articles.
Anybody know of a script similar to the above that is more configurable in terms of layout?
To give you an idea, I'm trying to put "The last 3 videos uploaded to sca-video.com" on the left side of an SCA related web site (personal site) http://grynmoors.org/ but the display is all weird. The image and description/details is all indented too far to the right. If I can get it moved over to the left, it will fit in the 200px column I have set up for it.


Reply With Quote
Bookmarks