Jump to content

Displaying RSS Feed content within a webpage?


Wanderlei Silva

Recommended Posts

Hello,

 

I am making a PHP site and when users register, I want to have some RSS feeds which they can subscribe to, right now just ones like BBC News feed. When they do they will be displayed on the the homepage of the site.

 

They will be logged in using a session from a PHPbb database/login, but the feeds will display of the homepage of the site, not the forum pages,

 

I have never done this before, and am looking for some advice on how to achieve this as simply as possible.

 

 

Appreciate any advice.

 

Thanks!

 

 

There are a lot of different ways to tackle this problem.

 

Given your requirement of "simple" my suggestion would be to avoid editing any existing tables and instead add your own. If HD space and traffic is not an issue for you, then here would be my suggestion:

Create a table with two columns, the user ID of a user and an RSS feed ID (these are arbitrary ID's that you can make up, rather than having names like "BBC" you might find it useful to create a PHP file full of constants and link different RSS feeds to numbered ID's, ie. define('BBC_NEWS', 1); ). When a user is viewing the main page, do a search on the table using a 'WHERE user_id = ' the current user's ID. Then process the list as needed.

 

You could add a third column and allow users to sort the order of the RSS feeds, otherwise I would sort them by the RSS feed ID that you created.

 

If traffic is an issue for you you'll want to minimize the number of rows an SQL query needs to gather. My suggestion for that would be to use a bitwise system. Give each RSS feed a unique bitwise ID and then combined all the bitwise ID's and save this single number into the database. When you retrieve it, you can check for each bitwise ID present individually. A bit more work for you and the PHP parser, but it'll reduce the time spent gathering rows from a mysql table.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.