![]() |
Random Rss feeds
After scouring this forum, hot scripts and google with no luck- I have a question. Does anyone know a way to have rss feeds randomly display on your non-wordpress site. In other words I want to shuffle say ten different rss feeds and have one display content each time web page is loaded. I have the displaying part down(using rss2html and I also used an awesome script provided by this forum) but can't figure out the random(shuffling) part. Thanks.
|
If you're using the rss2html php-script which can be downloaded from www[dot]feedforall[dot]com/more-php.htm then you can add something like that in this script:
PHP Code:
|
How do I call that
Thanks much for your help. So, I have replaced in the rss2html.php file like you mentioned. Now I am wondering how do I call this from my index.php page. Normally with rss2html you call with the following:
<?php include'URL OF RSS2HTML FILE?XMLFILE=YOUR RSS FEED URL&TEMPLATE=URL OF TEMPLATE/sample-template.html&MAXITEMS=20'; ?> |
Just remove the "XMLFILE=YOUR RSS FEED URL" part. Then it will use the random feed that you configured in the rss2html.php
Like that: <?php include'URL OF RSS2HTML FILE?TEMPLATE=URL OF TEMPLATE/sample-template.html&MAXITEMS=20'; ?> Or you can leave the rss2html.php as it is by default and do the randomization in your index.php file. In that case you should write in your index.php: PHP Code:
|
Configuration error message.
Thanks for your help. I tried both examples above and am getting the following error message: Unable to open RSS Feed 6, exiting Unable to open RSS Feed sample.xml, exiting .
I made sure all files are chmod to 755 and changed this line in the rss2html.php script: $fileAccessLevel = 1; to this: $fileAccessLevel = 0; per their forum. |
Sorry, I made a mistake.
PHP Code:
PHP Code:
PHP Code:
I tested on my server. I left the rss2html.php as it was. And in index.php I put: PHP Code:
|
Works like a charm.
Thank you very much!!!!! You rock!!!!!!!!!!!!!!!
|
All times are GMT -7. The time now is 02:41 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc