Page 1 of 5 1234 ... LastLast
Results 1 to 20 of 87

Thread: vBa CMPS: Customizable RSS feed module

  1. #1

    Default vBa CMPS: Customizable RSS feed module

    What it does.

    Collects content from RSS feeds and displays it in a self contained manner. Each module may be separately configured to display any number of items up to and including the number within the RSS feed. If fewer than the maximum number of items are specified then the items may be displayed in a random order (customizable) so that all items will eventually be displayed from the cache.

    The module reads the RSS feed and locally caches a copy of the data for the period specified in the "Time to Live" record.

    No other RSS applications are required for this module to work.

    Customization.

    The following items may be customized within each module;
    'feed' => location of the rss live feed
    'cache_age' => default value for cache refresh if not specified in feed
    'maxitems' => maximum # of items to display regardless of how many are in the feed
    'randomize' => if 'true' then 'maxitems' items will be 'randomized' if fewer than total item count
    'template' => the 'master' template to be used
    'templatebits' => the template used for each record of the file
    'callback' => an optional function to use to process each item
    In addition to the above 6 parameters the location of the cache directory, which must be chmod 777, must be specified in the rssfeed.php file.

    Installation.

    Installation is simplified. By creating a minimum of 2 new templates and 2 php files it is possible to have as many RSS feed modules on the CMPS portal page as desired. Each feed may be fully customized in appearance by optionally creating a separate template and/or configuration module to drive the appearance of the feed.

    Templates.

    Both the main template and the rss feed details templates are included as is a sample template that has been customized.

    Cache.

    The cache directory holds all of the RSS feeds for the duration specified in the <ttl> record. Once the cache for the specific feed has gone stale it will automatically be refreshed. Each feed may (and likely will) have a different 'Time to Live' specified.

    Sample module.

    PHP Code:
    <?php

    // optional function to modify each item as needed (must be a unique name)
    function rss_modify_renntech($item_number, &$rss_item)
    {
        global 
    $vboptions;

        
    // do any data modifications needed at this point.
        
    $rss_item['DESCRIPTION']  = vbdate($vboptions['dateformat'], strtotime($rss_item['PUBDATE']), $vboptions['yestoday']);
        
    $rss_item['DESCRIPTION'] .= ' <span class="time">';
        
    $rss_item['DESCRIPTION'] .= vbdate($vboptions['timeformat'], strtotime($rss_item['PUBDATE']));
        
    $rss_item['DESCRIPTION'] .= '</span>';
    }

    // All the information about each feed is defined here
    //   'feed' => location of the rss live feed
    //   'cache_age' => default value for cache refresh if not specified in feed
    //   'maxitems' => maximum # of items to display regardless of how many are in the feed
    //   'randomize' => if 'true' then 'maxitems' items will be 'randomized' if fewer than total item count
    //   'template' => the 'master' template to be used
    //   'templatebits' => the template used for each record of the file
    //   'callback' => an optional function to use to process each item

    $rss_feed_array = array (
            
    feed         => 'http://www.renntech.org/forums/ssi.php?a=out&f=24,2,25,3,26,4&show=10&type=rss',
            
    cache_age    => 60,
            
    maxitems     => 7,
            
    randomize    => false,
            
    template     => 'adv_portal_rss',
            
    templatebits => 'adv_portal_rennbits',
            
    callback     => 'rss_modify_renntech'
        
    );

    require (
    './modules/rssfeed.php');

    unset(
    $rss_feed_array);

    ?>
    Updates

    21-May-2005
    • Enhanced cache refresh logic to add retries if the web refresh fails and writes a zero-length file.
    • Enhanced cache refresh logic to make use of a default refresh time if one is not specified in the RSS feed.

    To update replace the rssfeed.php file and add the 'cache_age' declaration to the rssmain.php files that are being used (see the sample module).
    Attached Files Attached Files
    Last edited by Tom M; 05-22-2005 at 02:49 AM.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  2. #2

    Default Re: vBa CMPS: Customizable RSS feed module

    I tried, it doesn't load

  3. #3

    Default Re: vBa CMPS: Customizable RSS feed module

    Quote Originally Posted by Misuzu
    I tried, it doesn't load
    Do you have any additional information? It's a dumb question but is the module marked as "active" on the page you have it on? Are you getting any errors? Did you create the "cache" directory and make it 777?

    If any errors are encountered the module will not display anything instead of generating an error message. So if it's active on the page then it is loading but possibly not displaying anything due to some problem with the feed, etc.

    If you would, post the the feed information you are using and I'll try it out as well.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  4. #4

    Default Re: vBa CMPS: Customizable RSS feed module

    Do you have a live link I can look at

    Ta

  5. #5

    Default Re: vBa CMPS: Customizable RSS feed module

    Quote Originally Posted by chet
    Do you have a live link I can look at
    The module is feeding the RennTech.org Forums section of my home page shown in my signature.

    EDIT: I've got 3 feeds on my main page at this point. The original RennTech feed as well as a feed for Formula 1 and the Le Mans race next month. The two racing feeds display the links in a random order since I only display two items at a time from each of those feeds.
    Last edited by Tom M; 05-22-2005 at 02:19 AM.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  6. #6
    Junior Member
    Join Date
    Feb 2005
    Posts
    2

    Default Re: vBa CMPS: Customizable RSS feed module

    wow, this is great. exactly what i've spent six months looking for!

  7. #7
    Super Moderator KW802's Avatar
    Join Date
    Mar 2004
    Location
    A galaxy far, far away...
    Posts
    6,609

    Default Re: vBa CMPS: Customizable RSS feed module

    Darn you, Tom! As though I didn't have enough already to keep me busy these days!

  8. #8

    Default Re: vBa CMPS: Customizable RSS feed module

    The rssfeed module has been updated...

    21-May-2005
    • Enhanced cache refresh logic to add retries if the web refresh fails and writes a zero-length file.
    • Enhanced cache refresh logic to make use of a default refresh time if one is not specified in the RSS feed.

    To update replace the rssfeed.php file and add the 'cache_age' declaration to the rssmain.php files that are being used (see the sample module).
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  9. #9
    Senior Member
    Join Date
    Feb 2005
    Posts
    154

    Default Re: vBa CMPS: Customizable RSS feed module

    Tom M,

    Your mod looks very interesting and I am considering installing your mod. I was curious if you will be releasing new installation files since the release of CMPS 2.0 supposedly makes installing mods easier.

    Can you also PM me as I am interested in finding someone to do ongoing developing of my site involving installing mods, new releases of VB VBA mods, as well as server and admin issues.

    Thanks
    J
    J

  10. #10

    Default Re: vBa CMPS: Customizable RSS feed module

    Quote Originally Posted by disco4me
    Your mod looks very interesting and I am considering installing your mod. I was curious if you will be releasing new installation files since the release of CMPS 2.0 supposedly makes installing mods easier.
    I do plan to update most/all my mods to 2.0 when I get around to installing it. Since I've got a hacked vb installation I'm probably going to wait until vb 3.5 comes out to install 2.0. May not be what you wanted to hear but the 3.5 beta should be pretty soon. Hopefully Brian won't be too far behind with a 3.5 compatible version of CMPS 2.0.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  11. #11
    Junior Member
    Join Date
    Jun 2005
    Posts
    6

    Default Re: vBa CMPS: Customizable RSS feed module

    Tom, question... Can you take a look @ www.rsstatic.com and see if you can add those features to your next update.

    And also, if you have the time, i would pay you to get rsstatic implemented into my vbadvanced. Thanks!

    email: clarkkim@gmail.com

  12. #12

    Default Re: vBa CMPS: Customizable RSS feed module

    Does anyone have this working on vBadvanced 2 ?

  13. #13

    Default Re: vBa CMPS: Customizable RSS feed module

    It worked for me but blew my entire template up.

  14. #14

    Default Re: vBa CMPS: Customizable RSS feed module

    Quote Originally Posted by offline
    It worked for me but blew my entire template up.
    Not quite sure what you mean by "blew my template up"? Can you post a picture?

  15. #15

    Default Re: vBa CMPS: Customizable RSS feed module

    tried to use the shacknews rdf feed and it just hangs.. never loads the page.. should I post the php file contents?

  16. #16

    Default Re: vBa CMPS: Customizable RSS feed module

    Did it create the cache file? Also, make sure that the template references are the same in both the php file and the module definition.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  17. #17

    Unhappy Re: vBa CMPS: Customizable RSS feed module

    yes the cache file was made ok. I used your default templates without an issue.

    Looks like I didnt clear the "callback" completely...

    Working now.. Guess it got stuck in a loop looking for the template



    eh.. spoke to soon.. stopped working again.. no idea why

    I have a standard module. Use your default rssmain.php and it works...

    switch to mine where the only thing changed is this line

    feed => 'http://www.shacknews.com/headlines.rdf',

    and it just hangs forever.... some problem parsing the rdf maybe?
    Last edited by x[sliver]; 07-08-2005 at 01:26 AM.

  18. #18

    Default Re: vBa CMPS: Customizable RSS feed module

    Quick feature add request...

    multiple feeds in one php file that use the same style/output/template

    Or is it possible now and I'm missing something?

  19. #19

    Default Re: vBa CMPS: Customizable RSS feed module

    Hi Tom, Thanks so much for this!

    Do you have any idea why a feed that I can pull up in my browser would give such an error? I've tried many of their feeds and versions (rss1 rss2, etc) but they all wind up the same even though I know they're there. My dir is 777 and the files are attempting to be written.

    Warning: file_get_contents(http://www.url.org/rss/gknb_atom03.xml): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /modules/rssfeed.php on line 217

    My module works beautifully for some feeds, but none of the ones from this sites selections seem to work although I can pull them up in a browser or add them to my.yahoo
    Last edited by SomeName; 07-10-2005 at 08:07 PM.

  20. #20

    Default Re: vBa CMPS: Customizable RSS feed module

    Quote Originally Posted by x[sliver]
    Quick feature add request...
    multiple feeds in one php file that use the same style/output/template
    Or is it possible now and I'm missing something?
    The module is set up to handle one feed at a time.

    Did you resolve your other problem? If not, make sure that when you create a new module that you make sure the templates are defined the same in both the module definition and in the php file.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

Page 1 of 5 1234 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Webcam Feed Module
    By SVTOA in forum Add-On Modules & Modifications
    Replies: 11
    Last Post: 06-11-2006, 01:14 PM
  2. Making an RSS Feed
    By Glenn Sand in forum Troubleshooting / "How do I..." Questions
    Replies: 1
    Last Post: 05-02-2005, 01:08 PM
  3. Want to add a News Feed
    By C_P in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 10-09-2004, 05:39 PM
  4. User customizable CMPS page
    By ogetbilo in forum Feedback & Suggestions
    Replies: 1
    Last Post: 05-20-2004, 12:04 PM

Posting Permissions

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