Results 1 to 5 of 5

Thread: Displaying vShare RSS Feeds on html pages

  1. #1
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Displaying vShare RSS Feeds on html pages

    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:

    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 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.

    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.
    If it's not fun, stop doing it!

  2. #2
    Join Date
    Dec 2007
    Posts
    24

    Default Re: Displaying vShare RSS Feeds on html pages

    i use xsitepro2 to create a full site with rss feeds

  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Displaying vShare RSS Feeds on html pages

    Thanks for the tip, I'll check it out

    Right now I don't need to create an entire web page with the RSS for the site mentioned, just the one column.

    There's also the rss2html (free) mentioned earlier which seems to do the same thing as this xsitepro2 ...just not as fancy as what you have, but it works...the rss2html is template driven and there are templates for it at feedforall.com, and I would use it except it doesn't display the video thumbs and I'm no PHP expert...but I guess I'll just have to keep working on this till I figure something out or someone else already knows.
    If it's not fun, stop doing it!

  4. #4
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Displaying vShare RSS Feeds on html pages

    Oh, hey, I'm on to something. I think it has to do with the <dd> and <dt> tags.


    UPDATE:
    Yep that was it, I had to get rid of all the dd, dt and dl tags then in videos.php I had to put everything a div box that was 180px wide.

    The only thing I need to figure out now is how to get it to only display a certain number of items instead of all 20. If anybody can help me with that, I'd really appreciate it.
    If it's not fun, stop doing it!

  5. #5
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Displaying vShare RSS Feeds on html pages

    Oh now THIS is really slick and it's free

    http://simplepie.org/
    If it's not fun, stop doing it!

Similar Threads

  1. Related Video Not Displaying
    By icxxx in forum Bug Reports
    Replies: 1
    Last Post: 08-19-2008, 11:32 AM
  2. How to INCLUDE pages in vshare
    By carefree in forum Template Modifications
    Replies: 3
    Last Post: 06-17-2008, 11:27 AM
  3. Error RSS Feeds don't work in 2.6 with IE 7
    By cybermedia in forum Bug Reports
    Replies: 2
    Last Post: 02-17-2008, 03:14 AM
  4. Replies: 0
    Last Post: 02-16-2008, 03:40 AM
  5. CAN NOT USE HTML TAGS IN ADDON PAGES
    By grynmoors in forum Fixed Bugs
    Replies: 3
    Last Post: 12-14-2007, 06:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •