vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 05-13-2005, 01:57 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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
File Type: txt rss_install.txt (5.2 KB, 693 views)
File Type: php rssmain.php (1.5 KB, 438 views)
File Type: php rssfeed.php (7.1 KB, 455 views)
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.

Last edited by Tom M; 05-22-2005 at 02:49 AM.
  #2  
Old 05-17-2005, 01:21 PM
Misuzu Misuzu is offline
Gao
 
Join Date: Apr 2005
Posts: 23
Default Re: vBa CMPS: Customizable RSS feed module

I tried, it doesn't load
  #3  
Old 05-17-2005, 01:38 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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  
Old 05-17-2005, 01:43 PM
chet chet is offline
Member
 
Join Date: Apr 2004
Posts: 72
Default Re: vBa CMPS: Customizable RSS feed module

Do you have a live link I can look at

Ta
  #5  
Old 05-17-2005, 01:51 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.

Last edited by Tom M; 05-22-2005 at 02:19 AM.
  #6  
Old 05-22-2005, 12:22 AM
syndicate syndicate is offline
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  
Old 05-22-2005, 12:25 AM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
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  
Old 05-22-2005, 02:50 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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  
Old 06-07-2005, 11:16 AM
disco4me disco4me is offline
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  
Old 06-07-2005, 12:00 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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  
Old 06-07-2005, 02:06 PM
mixmakers mixmakers is offline
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  
Old 06-13-2005, 07:24 AM
AndyA AndyA is offline
Member
 
Join Date: Apr 2005
Posts: 99
Default Re: vBa CMPS: Customizable RSS feed module

Does anyone have this working on vBadvanced 2 ?
  #13  
Old 06-16-2005, 02:27 PM
offline offline is offline
Member
 
Join Date: May 2005
Posts: 36
Default Re: vBa CMPS: Customizable RSS feed module

It worked for me but blew my entire template up.
__________________
Chris Edwards

Chattanooga Online Community
  #14  
Old 06-16-2005, 02:59 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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  
Old 07-07-2005, 10:48 PM
x[sliver] x[sliver] is offline
Member
 
Join Date: Sep 2004
Posts: 32
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  
Old 07-07-2005, 10:56 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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  
Old 07-08-2005, 12:35 AM
x[sliver] x[sliver] is offline
Member
 
Join Date: Sep 2004
Posts: 32
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  
Old 07-08-2005, 12:38 AM
x[sliver] x[sliver] is offline
Member
 
Join Date: Sep 2004
Posts: 32
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  
Old 07-08-2005, 12:08 PM
SomeName's Avatar
SomeName SomeName is offline
Member
 
Join Date: Apr 2004
Posts: 86
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.

Quote:
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  
Old 07-08-2005, 12:48 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
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.
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 10:36 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.