2RSS.com :: RSS feeds, RSS directory, RSS articles, RSS syndication, XML, RDF, news ... Directory My RSS 2RSS Reader Software Articles Contact Blog Forum
2RSS.com :: RSS feeds, RSS directory, RSS software, RSS scripts, RSS articles, RSS syndication, XML, RDF, news and more.


RSS 2.0

RSS Feed Generator {v1.0}

These scripts are simple RSS feed generators made for PHP (rss20-php.zip) & ASP (rss20-asp.zip). They are distributed as freeware. So, feel free to use or distribute them. You can see a demo here.

Using them you can create RSS feeds from your site with any information you want. For instance, last posted articles, last registered users, news or anything else. Or you can use as basis for your own scripts. Many PHP or ASP pages don't have RSS feeds by default. To add a RSS feed you only have to install these scripts on your site.

They are customizable and very easy to use. Basically, there are 2 files:

  • rss20.php (or .asp) - Configuration file and used for URL links
  • rss20inc.php (or .asp) - Just an include file. Has rss() function to create RSS feed.

Installation & Use:

  • Unzip rss20.php (.asp) and rss20inc.php (.asp) files and copy them somewhere on your site;
  • Set up all parameters from rss20.php (.asp);
  • Use RSS feed available at http://your_site.com/your_folder/rss20.php
    Don't forget to add your RSS feed in our free RSS directory to get some visitors. The URL above (to rss20.php or rss20.asp) could be read directly by newsreaders.

Parameters:
Before to use rss20.* (.php / .asp) you have to set up your parameters in rss20.php or rss20.asp. You should edit this file directly using a plain-text editor (Notepad, etc.). All these parameters are:

  • rss_server - Default is "localhost". The name of the server where MySQL or MS SQL database is located;
  • rss_db -Database name;
  • rss_user - Database user name;
  • rss_pass - Database password;
  • rss_connection - For ASP, you can use this parameter for ADODB.Connection, instead of all four above (rss_server, rss_db, rss_user, rss_pass). This should be a valid connection string.
  • item_link - Prefix for URL items links. Usually, is a page which displays an item passed as parameter. Item id will be appended to this prefix. For instance: "http://www.2rss.com/index.php?rss=" is the prefix used at 2RSS.com to display info about a RSS Feed.
  • channel_copyright - Channel copyright info;
  • channel_editor - Channel editor. Could be an email address or email address and name.
  • channel_webmaster - Similar as above;
  • image_title - Used for images associated with channels (logos);
  • image_url - Image URL [JPG or GIF]. Empty is no image is used;
  • image_link - Page opened when image is clicked;
  • image_width, image_height - Self-explanatory. Default sizes are 88x31.
  • encoding - Character set used for RSS feed. Most cases is ISO-8859-1.

The only first four parameters are mandatory. All others could be empty.
All these parameters are directly related to RSS 2.0 specifications.

Before use this script you have to add one or more channels using add_channel() function. This function has a few parameters:

  • Channel_Title
  • Channel_Link - link to your site or info about this channel
  • Channel_Description
  • SQL_Command - this is very important and depends on your site (and your database). See below samples for phpBB & Drupal.org. This SQL commands should return these fields: Title, Link, Description, Date, Author. They could be empty or build using SQL functions. Their order is also important.
  • RSS_ID - Leave empty for a single RSS feed. Otherwise, use an ID as its value (numeric or key). Then pass this ID value to rss parameter when use rss20.php (.asp) page, as following: http://your_site.com/path/rss20.php?rss=news
    When create this channel using add_channel() don't forget to set last parameter to "news".

Here you are a few samples :

1. For phpBB - returning last 10 postings, limited to 25 words (description):

add_channel(
	"phpBB Forums :: Last postings",
	"http://www.2RSS.com/",
	"My phpBB forum description.",
	"SELECT phpbb_topics.topic_title AS Title ,
		phpbb_posts_text.post_id AS Link, 
		CONCAT(SUBSTRING_INDEX(phpbb_posts_text.post_text,' ',25),' ...') AS Description,
		FROM_UNIXTIME(phpbb_posts.post_time) AS Date,
		phpbb_users.user_email AS Author FROM phpbb_posts_text 
		INNER JOIN phpbb_posts ON phpbb_posts_text.post_id=phpbb_posts.post_id
		INNER JOIN phpbb_users ON phpbb_posts.poster_id=phpbb_users.user_id
		INNER JOIN phpbb_topics ON phpbb_posts.topic_id=phpbb_topics.topic_id
		ORDER BY phpbb_posts_text.post_id DESC LIMIT 10",
	"");

2. For Drupal.org - first channel is default (without parameters), return last 10 articles or pages and second one (rss20.php?rss=forum) returns last 10 postings in forums:

add_channel(
	"Drupal.org :: Last articles posted",
	"http://www.2RSS.com/",
	"Last articles posted with Drupal.org",
	"SELECT node.title AS Title ,
		node.nid AS Link, 
		node.teaser AS Description,
		FROM_UNIXTIME(node.created) AS Date,
		users.mail AS Author FROM node 
		INNER JOIN users ON node.uid=users.uid
		WHERE node.type='story' OR node.type='page'
		ORDER BY node.nid DESC LIMIT 10",
	"");

add_channel(
	"Drupal.org :: Last postings in forums",
	"http://www.2RSS.com/",
	"Last posted entries in forums with Drupal.org",
	"SELECT node.title AS Title ,
		node.nid AS Link, 
		CONCAT(SUBSTRING_INDEX(node.body,' ',25),' ...') AS Description,
		FROM_UNIXTIME(node.created) AS Date,
		users.mail AS Author FROM node 
		INNER JOIN users ON node.uid=users.uid
		WHERE node.type='forum'
		ORDER BY node.nid DESC LIMIT 10",
	"forum");

3. For PostNuke - thanks to Craig Williams:

add_channel(
     "Austin Web Farms :: Last postings",
     "http://www.AustinWebFarms.com/",
     "Latest articles on web design, technology and business.",
     "SELECT nuke_stories.pn_title AS Title , nuke_stories.pn_sid AS Link, 
	  CONCAT(SUBSTRING_INDEX(nuke_stories.pn_hometext,\' \',25),\' ...\') AS Description,
      nuke_stories.pn_time AS Date, nuke_stories.pn_informant AS Author FROM nuke_stories 
      ORDER BY nuke_stories.pn_sid DESC LIMIT 10",
      "");

4. For PHPWebSite - thanks to Craig Williams:

add_channel(
     "Scott Williams :: Latest Postings",
     "http://www.scottwilliams.biz/",
     "Scott Williams is a full-time freelance writer.",
     "SELECT pws_mod_article.title AS Title , pws_mod_article.id AS Link, 
      CONCAT(SUBSTRING_INDEX(pws_mod_article.summary,' ',25),' ...') AS Description,
      pws_mod_article.publication_date AS Date, pws_mod_article.created_username AS Author
      FROM pws_mod_article ORDER BY pws_mod_article.id DESC LIMIT 10",
     "");

5. InvisionBoard:

add_channel(
     "Last posts",
     "http://forum.2RSS.com/",
     "Last posts at forum.2RSS.com.",
     "SELECT title,tid as Link, description, FROM_UNIXTIME(start_date) as Date, 
      CONCAT(starter_name,'@a.com') as Author FROM ibf_topics ORDER BY tid DESC Limit 10",
     "");

Other channels could be built very easily, by analyzing the database and creating a proper SQL command.
You can customize these scripts to meet your needs. If you customized it for known (public) systems (PHP & ASP), please let us know to be added here.

Important
All these scripts are distributed for free without any guarantees ("AS IS"). You can use or customize them upon your needs, but you have to maintain all copyright information. 2RSS.com or its author is not responsible for malfunction or other copyright issues that comes from using RSS20.php (.asp). It is your responsibility to use them properly. You are not allowed to sell these scripts. For any problems, please contact us on our web site. All rights reserved to 2RSS.com and their author.

 

« Back

 

© 2003-2005 2RSS.com · Oxidev Interactive Property Terms of use