vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > vBa CMPS v3.x & 2.x > Add-On Modules (version 3.x & 2.x)

Reply
 
Thread Tools Display Modes
  #1  
Old 12-15-2005, 01:29 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default [Module] Customizable RSS feed module

This is the generic RSS feed module for CMPS 2.0 and vBulletin 3.5.2 and is a significant update from the original version.


What's New

For starters there's now only one php file to deal with as all of the configuration parameters are now controlled by editing the module via CMPS. All of the existing control is still available as is the ability to use plain or fancy formatting - including modifying the output via css.


Installation

Installing the module is as simple as using the vBa CMPS -> Download/Upload Module dialog. This will create everything that's needed to get started including 2 templates; adv_portal_rss and adv_portal_rssbits, and the rss_cmps2.php module.

Once the module has been uploaded use the vBa CMPS -> Edit Modules screen to customize the settings using the RSS Feed Options section. As a minimum it is necessary to specify the RSS Feed URL and the RSS Cache Directory. As noted in the help text the RSS Cache Directory must be world-writable (chmod 777) for things to work properly.

To create additional RSS feeds simply copy the existing module, rename it to something relevant and fill in the information about that feed. All the RSS feed modules may use the same cache directory, though you may have multiple directories if desired.


Getting fancy

The adv_portal_rssbits template makes use of css to format the title, category and description. By default these classes don't exist so the text will be displayed using whatever the defaults are. Below are some sample css definitions that may be added to the Additional CSS Definitions (located in ACP -> Style Manager -> (style) Main CSS) for your style.

Code:
.rsstitle { font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; color: #003366; }
.rsstitle a:link, .rsstitle a:visited, .rsstitle a:active { text-decoration: none; color: #003366; }
.rsstitle a:hover { text-decoration: none; color: #3964A8; }
.rssdesc {font: normal 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; }
.rsscat {font: bold 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; }

Advanced Usage

The Data qualification code may be used to filter out individual feed items if desired. Use the text box to enter the appropriate php code to evaluate the $rss_item data and return a 'true' or 'false' value according to whether the item should be displayed. To display all feed items leave this blank.

The Data modification code may be used to manipulate the $rss_item data however desired. For example, since the publication date for the item isn't normally shown by the template this information could be added to the beginning of the description if a publication date is part of the available information by using the following.

PHP Code:
if ($rss_item['PUBDATE']) $rss_item['DESCRIPTION'] = vbdate($vbulletin->options['dateformat'], strtotime($rss_item['PUBDATE']), $vbulletin->options['yestoday']) . ' <span class="time">' vbdate($vbulletin->options['timeformat'], strtotime($rss_item['PUBDATE'])) . '</span><br />' $rss_item['DESCRIPTION']; 
Likewise, if the descriptions are too long you might add code to trim the length and display a "... [more]" where the "[more]" has the link used in the title.

Enjoy!


Revisions

1/4/2006
1. Added support for having the feed area scrollable. This adds two new options to the module and also contains a revised adv_portal_rss template.

If you don't require scrollable support there's no need to download this update.

12/28/2005
1. Fixed a bug when the closing </image> tag had other tags following it.

To update replace the rss_cmps2.php file or uninstall and reinstall the module.

12/23/2005
1. Fixed a bug when using 'fancy' formatting and using the 'qualifier'.

To update replace the rss_cmps2.php module and the adv_portal_rssbits template.

12/20/2005
1. Modified the template such that the css classes are only used when using 'fancy' formatting.
2. Added an optional Icon ID that may be specified to prefix the title when using 'plain' formatting.



PS - If you like this module and would like to make a donation you may do so via PayPal.
Attached Images
File Type: jpg rssfeed_options.jpg (142.8 KB, 2931 views)
Attached Files
File Type: php rss_cmps2.php (7.7 KB, 1375 views)
File Type: module rssfeed.module (17.4 KB, 1503 views)
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.

Last edited by Tom M; 01-23-2006 at 07:54 PM. Reason: updated module
Reply With Quote
  #2  
Old 12-15-2005, 02:31 PM
alicat alicat is offline
Junior Member
 
Join Date: Nov 2005
Posts: 20
Default Re: [Module] Customizable RSS feed module

Looks really exellent thankyou, i wondered, im using your original version (you know the trouble i had to get it working) but it is working and it's a great mod, i understand why i was so frustrated before, the reason being that the module only shows about 70% of the time, a refresh will on occasion show the mod and thus null my fears about it not working would this new version enable me to play with the cache settings to show the mod 100% of the time? thanx again for this it's wonderfull and sorry for my hot headedness

-A
Reply With Quote
  #3  
Old 12-15-2005, 03:07 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

What I've found is that whether or not things display really depends on how reliable the site hosting the feed is. The code isn't real robust if it gets an error page instead of the rss data and thus it decides that there's nothing to show. When that happens to me I usually just go and look at the respective cache file to make sure what's in it before I go and delete it in order to force a reread of the feed and that usually clears it up. At least until the next time the feed has a hiccup.

EDIT: I've uploaded and updated version that's much more robust as far as error conditions are concerned.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.

Last edited by Tom M; 12-15-2005 at 04:18 PM.
Reply With Quote
  #4  
Old 12-15-2005, 07:25 PM
alicat alicat is offline
Junior Member
 
Join Date: Nov 2005
Posts: 20
Default Re: [Module] Customizable RSS feed module

Fatal error: file_put_contents cannot write in file. in /modules/rss_cmps2.php on line 121

killed my entire front page...

-A
Reply With Quote
  #5  
Old 12-15-2005, 07:31 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by alicat
Fatal error: file_put_contents cannot write in file. in /modules/rss_cmps2.php on line 121

killed my entire front page...

-A
That may be caused by 2 things.

1. The directory you specified for the cache doesn't exist.
2. You don't have the correct permissions on the directory you specified for your cache.

The directory specified during the configuration process must already exist and it must be world-writable (chmod 777) for things to work.

On a side note, it's always a good idea to set the permissions so that only admins can see the module when first getting things going. That way if there's a hiccup nobody else is aware of it
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #6  
Old 12-15-2005, 07:32 PM
alicat alicat is offline
Junior Member
 
Join Date: Nov 2005
Posts: 20
Default Re: [Module] Customizable RSS feed module

i've deleted it...worried me for a minute as i have a busy site and this downtime is a pain, i' can see what it was trying to do, it did'nt overwrite when i imported and made an extra mod...anyways, i'll leave it...thaanx anyways, good for a fresh install maybe i should of done some small manual edits like you said

Last edited by alicat; 12-15-2005 at 07:35 PM.
Reply With Quote
  #7  
Old 12-15-2005, 07:34 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by alicat
i cannot remove it, work my module backup...**** how do i remove this module? both are inactive, somethings really gone here...its ****ed my site....
Did you alredy correct the other problem? See my previous post.
Reply With Quote
  #8  
Old 12-18-2005, 06:51 PM
alicat alicat is offline
Junior Member
 
Join Date: Nov 2005
Posts: 20
Default Re: [Module] Customizable RSS feed module

Yes all correct, ive reverted back to the original which works fine, just need it to show 100% of the time tho it shows just about 50/50...

-A
Reply With Quote
  #9  
Old 12-18-2005, 07:45 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by alicat
Yes all correct, ive reverted back to the original which works fine, just need it to show 100% of the time tho it shows just about 50/50...

-A
As you might expect, it works fine for me. What's the url of the feed you are using?
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #10  
Old 12-18-2005, 08:11 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

dang..i got a white index page with an error same as post 4.

using feed http://www.gamespot.com/misc/rss/gam...dates_news.xml

I will work on it more as I know it should work. I also have that "article bot" going and that seems to work

Last edited by geoff; 12-18-2005 at 08:14 PM. Reason: added content
Reply With Quote
  #11  
Old 12-18-2005, 08:14 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by geoff
dang..i got a white index page with an error

using feed http://www.gamespot.com/misc/rss/gam...dates_news.xml
What's the error?

Make sure that you filled in the path to the cache directory and CHMOD it to 777.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #12  
Old 12-18-2005, 08:22 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

my path for the cache is /forums/articlebot/cache/

can i use this one? do i need the slash in the beginning? or end?
i really would like this to do a shacknews report but their rss xml doesnt seem to do a thing
Reply With Quote
  #13  
Old 12-18-2005, 08:28 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by geoff
my path for the cache is /forums/articlebot/cache/

can i use this one? do i need the slash in the beginning? or end?
i really would like this to do a shacknews report but their rss xml doesnt seem to do a thing
You need to specify the absolute path to the directory w/o the trailing slash. I have the link you used running fine on my site so once you clear up the cache issue you should be good to go.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #14  
Old 12-18-2005, 08:53 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

i really dont know what to do...when i set chmod to 777, my ftp proggy says it made it 777 but when i go back and check it says 755...grr. Im not sure what the error is now..

just for clarification, absoulte path is http://www.site.com/forum.... ?
Reply With Quote
  #15  
Old 12-18-2005, 08:59 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
Originally Posted by geoff
i really dont know what to do...when i set chmod to 777, my ftp proggy says it made it 777 but when i go back and check it says 755...grr. Im not sure what the error is now..

just for clarification, absoulte path is http://www.site.com/forum.... ?
You host may not allow you to set world-writable folders so you may need to contact them.

The path would be /home/yoursite/cache or whatever and not the url (http://www.yoursite.com/cache). It's a good idea to always place world-writable directories outside accessible space.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #16  
Old 12-18-2005, 09:14 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

yep...it's my "WONDERFUL" host...they changed some policy that you cant have 777 the beginning of this month..a lot of folks arent to happy
Reply With Quote
  #17  
Old 12-18-2005, 09:41 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

ok...all good now..nothing that a good php script cant handle...still not happy with my host though...nice hack Tom!!
Reply With Quote
  #18  
Old 12-18-2005, 10:45 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Quote:
ok...all good now..nothing that a good php script cant handle...
Glad you got it sorted out. I am curious how you fixed it though.
__________________
Tom Morris
Porsche Boxster discussion forum.
Today's Conservative discussion forum.
Reply With Quote
  #19  
Old 12-18-2005, 10:49 PM
geoff's Avatar
geoff geoff is offline
Cannabalistic Lemur
 
Join Date: Sep 2005
Location: Oklahoma
Posts: 162
Default Re: [Module] Customizable RSS feed module

I added a php script forcing the folder to become 777. Plus, i found a vaild shacknews rss deally to dsiplay "geek" news..hehe.

also, i forgot to add a "/" before my path of the cache folder
Reply With Quote
  #20  
Old 12-18-2005, 10:51 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: [Module] Customizable RSS feed module

Ah, I thought you'd coded around it in the module somehow.
Reply With Quote
Reply


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
vBa CMPS: Customizable RSS feed module Tom M Add-On Modules & Modifications 86 05-30-2006 12:31 AM
RSS feed module for VBA 2 and VB3.5 rsailors Modifications (version 3.x & 2.x) 6 03-25-2006 10:18 PM
[REQ] RSS feed module rgourley Module & Modification Discussion & Requests 15 10-21-2005 11:55 PM


All times are GMT -4. The time now is 12:23 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.