PDA

View Full Version : RSS Content not appearing in RSS Display Boxes



rickpoet
04-07-2008, 08:47 PM
1) Script Title: RSS Display Boxes

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/

3) Describe problem:

Hi, I think I have everything set up correctly...calling for one feed...not receiving any errors on the demo page or on the actual installed page, and I see the initialization...and then nothing...no content appears.

here's where I have the script
http://letmypeoplesing.com/blog-test.html

calling for this feed: feed://60bloggers.com/feed (also tried it with "http" instead of "feed".

Any help would be appreciated. Thanks!

Rick

ddadmin
04-08-2008, 04:52 AM
Most likely PHP on your server has url_fopen_disabled turned on and Curl disabled. Either of these two modules are needed for the script to be able to fetch the contents of an external fileI say this because when I try to directly output the RSS feed with ID "bloggers", it returns a blank page: http://letmypeoplesing.com/rssbox/main.php?id=bloggers I may be wrong, but it looks like it. To make sure, check the cache directory of the script to see if the script has managed to actually retrieve any files.

rickpoet
04-08-2008, 05:37 AM
Hi,

I just checked the cache and there were no files in it. Does that still point to these PHP modules.

To clarify:

url_fopen_disabled should be DISABLED

and CURL should be ENABLED?

(or was 'disabled' not supposed to be part of "URL_FOPEN")

Thanks,

Rick

rickpoet
04-08-2008, 05:42 AM
OK, I just check the PHP ini file and both of those modules are present and ON.

Any other suggestions?

ddadmin
04-08-2008, 06:18 AM
With Curl enabled, it should work regardless of the other setting. Did you chmod /rss/cache to 777?

rickpoet
04-08-2008, 06:28 AM
It's rssbox/cache (not rss/cache) right?

Yes, that folder's permissions are set to 777 (and the rssbox folder is set to 755)

rickpoet
04-09-2008, 07:39 PM
Has anyone else experienced this issue? Any help would be appreciated.

Thanks.

ddadmin
04-09-2008, 08:04 PM
Hmm the fact that your cache/ directory is empty does mean that the script is having trouble fetching the RSS feeds, which is the first step before even the script does anything with that data. Since you said your server has Curl enabled, that stage should be working. Have you tried running the compatibility PHP script within the Simpiepie directory? It might give you clues as to what the problem is.

rickpoet
04-09-2008, 08:12 PM
Hi,

Yes, I ran the compatibility test and received the message "You have everything you need to run SimplePie properly! Congratulations!"

Though the version of Curl is different...it says I have "7.13.2" and it should be "7.10.5"

http://letmypeoplesing.com/simplepie/compatibility_test/sp_compatibility_test.php

But the compatibility test did say my webhost has its act together which, at least, is reassuring on some level.

ddadmin
04-09-2008, 08:44 PM
This is strange indeed. What's the URL to the feed you're trying to display, as referenced by the ID "bloggers" in main.php?

rickpoet
04-09-2008, 08:54 PM
I appreciate your time on this.

The feed in the script is:
feed://60bloggers.com/feed

I also tried it with "http://60bloggers.com/feed" ("http" instead of "feed") with the same results.

ddadmin
04-09-2008, 09:42 PM
Nevertheless, can you try changing it to http://60bloggers.com/feed inside main.php and upload the changes to your server? I want to view your page again with this change.

rickpoet
04-09-2008, 09:47 PM
OK...did this..actually you don't have a trailing 'slash' and there was on in the original. I just tried it with both

ie: http://60bloggers.com/feed/

and http://60bloggers.com/feed

(Currently it's up with the trailing slash)

Thanks,

Rick

ddadmin
04-09-2008, 09:56 PM
Ok, can you post the full source of main.php as it exists on your server right now? I find it interesting that even when calling:

http://letmypeoplesing.com/rssbox/main.php

without any parameters, it returns a blank page, which definitely shouldn't be the case. It should return this instead:


Error: Can't find requested RSS in list.

rickpoet
04-09-2008, 10:25 PM
no problem here it is (thanks again for your time on this!:

<?php
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com

require('../simplepie/simplepie.inc'); //Specify path to simplepie.inc on your server (by default located inside "simplepie" directory)
$feed = new SimplePie();
$feed->cache_location('cache'); //Specify path to cache directory on your server relative to this file
$feed->handle_content_type();
require('outputbody.php'); //Path to custom "outputbody.php" file relative to this file

//Specify list of RSS URLs
$rsslist=array(
"bloggers" => "http://60bloggers.com/feed/" //no trailing comma after last RSS URL!!
);

////Beginners don't need to configure past here. Edit outputbody.php to format the output of each RSS item's body ////////////////////

$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("<b>Error:</b> Can't find requested RSS in list.");
$cachetime=isset($_GET["cachetime"])? (int)$_GET["cachetime"] : 30; //Get cachetime. Default to 30 if not specified
$feednumber=isset($_GET["limit"])? (int)$_GET["limit"] : ""; //Get number of items to fetch. If not specified (""), all is fetched.

$templatename=isset($_GET["template"])? $_GET["template"] : ""; //get name of template, which is used by if/else logic within function outputbody()
if ($templatename!="" && !preg_match("/^(\w|-)+$/i", $templatename)) //Template name can only contain alphanumeric characters, underscore or dash (-)
die ("<b>Error:</b> Template name can only consist of alphanumeric characters, underscore or dash");

$feed->cache_max_minutes($cachetime);
$feed->feed_url($rssurl);
$feed->init();
$max = $feed->get_item_quantity($feednumber);


function outputitems(){
global $feed, $feednumber, $templatename;
$max = $feed->get_item_quantity($feednumber);
for ($x = 0; $x < $max; $x++){
$item = $feed->get_item($x);
outputbody($item, $templatename); //call custom outputbody() function
}
}

?>

<?php
if ($feed->data){
outputitems();
}

?>

ddadmin
04-09-2008, 10:32 PM
Ok, try enabling error reporting within main.php, by adding the below to the top of the file:


<?
error_reporting(E_ALL);

"
"

Upload the file again, and run http://letmypeoplesing.com/rssbox/main.php to see what error gets output.

rickpoet
04-09-2008, 10:37 PM
top of the file meaning before the <?php at the very top?

rickpoet
04-09-2008, 10:38 PM
added to the very top as described in previous message (if that's the right place?)

No error produced.

rickpoet
04-09-2008, 10:39 PM
<?
error_reporting(E_ALL);

"
"
<?php
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com

require('../simplepie/simplepie.inc'); //Specify path to simplepie.inc on your server (by default located inside "simplepie" directory)
$feed = new SimplePie();
$feed->cache_location('cache'); //Specify path to cache directory on your server relative to this file
$feed->handle_content_type();
require('outputbody.php'); //Path to custom "outputbody.php" file relative to this file

//Specify list of RSS URLs
$rsslist=array(
"bloggers" => "http://60bloggers.com/feed/" //no trailing comma after last RSS URL!!
);

////Beginners don't need to configure past here. Edit outputbody.php to format the output of each RSS item's body ////////////////////

$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("<b>Error:</b> Can't find requested RSS in list.");
$cachetime=isset($_GET["cachetime"])? (int)$_GET["cachetime"] : 30; //Get cachetime. Default to 30 if not specified
$feednumber=isset($_GET["limit"])? (int)$_GET["limit"] : ""; //Get number of items to fetch. If not specified (""), all is fetched.

$templatename=isset($_GET["template"])? $_GET["template"] : ""; //get name of template, which is used by if/else logic within function outputbody()
if ($templatename!="" && !preg_match("/^(\w|-)+$/i", $templatename)) //Template name can only contain alphanumeric characters, underscore or dash (-)
die ("<b>Error:</b> Template name can only consist of alphanumeric characters, underscore or dash");

$feed->cache_max_minutes($cachetime);
$feed->feed_url($rssurl);
$feed->init();
$max = $feed->get_item_quantity($feednumber);


function outputitems(){
global $feed, $feednumber, $templatename;
$max = $feed->get_item_quantity($feednumber);
for ($x = 0; $x < $max; $x++){
$item = $feed->get_item($x);
outputbody($item, $templatename); //call custom outputbody() function
}
}

?>

<?php
if ($feed->data){
outputitems();
}

?>

ddadmin
04-09-2008, 10:39 PM
No, it should be after the <?php tag itself, so:


<?php
error_reporting(E_ALL);
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com

rickpoet
04-10-2008, 01:58 AM
ok...moved the error checking to the right place...still not seeing any errors? Very strange.

<?php
error_reporting(E_ALL);
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com

require('../simplepie/simplepie.inc'); //Specify path to simplepie.inc on your server (by default located inside "simplepie" directory)
$feed = new SimplePie();
$feed->cache_location('cache'); //Specify path to cache directory on your server relative to this file
$feed->handle_content_type();
require('outputbody.php'); //Path to custom "outputbody.php" file relative to this file

//Specify list of RSS URLs
$rsslist=array(
"bloggers" => "http://60bloggers.com/feed/" //no trailing comma after last RSS URL!!
);

////Beginners don't need to configure past here. Edit outputbody.php to format the output of each RSS item's body ////////////////////

$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("<b>Error:</b> Can't find requested RSS in list.");
$cachetime=isset($_GET["cachetime"])? (int)$_GET["cachetime"] : 30; //Get cachetime. Default to 30 if not specified
$feednumber=isset($_GET["limit"])? (int)$_GET["limit"] : ""; //Get number of items to fetch. If not specified (""), all is fetched.

$templatename=isset($_GET["template"])? $_GET["template"] : ""; //get name of template, which is used by if/else logic within function outputbody()
if ($templatename!="" && !preg_match("/^(\w|-)+$/i", $templatename)) //Template name can only contain alphanumeric characters, underscore or dash (-)
die ("<b>Error:</b> Template name can only consist of alphanumeric characters, underscore or dash");

$feed->cache_max_minutes($cachetime);
$feed->feed_url($rssurl);
$feed->init();
$max = $feed->get_item_quantity($feednumber);


function outputitems(){
global $feed, $feednumber, $templatename;
$max = $feed->get_item_quantity($feednumber);
for ($x = 0; $x < $max; $x++){
$item = $feed->get_item($x);
outputbody($item, $templatename); //call custom outputbody() function
}
}

?>

<?php
if ($feed->data){
outputitems();
}

?>

rickpoet
04-10-2008, 11:02 PM
Would it have anything to do with the external feed?

ddadmin
04-11-2008, 07:03 PM
I just tried using this script with the feed http://60bloggers.com/feed/ on a test server, and it does work correctly, so it must be something specific to your server. The best clue I have at this point is the fact that calling http://letmypeoplesing.com/rssbox/main.php without any parameters returns nothing. This means it's not a feed issue, but one with the script and PHP itself. Otherwise, you should at least get the message "Can't find requested RSS feed" when calling that page.

Unfortunately from the outside, there's only so much I can look at when it comes to server side issues. Have you considered a hosted script like http://www.dynamicdrive.com/dynamicindex18/gajaxrssdisplayer.htm instead?

rickpoet
04-11-2008, 07:42 PM
Anything I can ask the webhost regarding the server? I'd be willing to give you access to the web hosts support if you think that it may be worthwhile to understand what the issue is for other users as well?

Regarding the hosted script, is there a variable which allows displaying more than a snippet of the entry (like the entire entry?)

Thanks so much for all your time on this!

ddadmin
04-11-2008, 11:15 PM
Try asking your host if PHP is in fact set up on their accounts to allow fetching of remote URLs as files. Also ask for confirmation that allow_url_fopen is turned on in php.ini.


Regarding the hosted script, is there a variable which allows displaying more than a snippet of the entry (like the entire entry?)

Yep, instead of something like:


myrss.displayoptions("date label snippet")

You would pass in "description" instead of "snippet":


myrss.displayoptions("datetime label description")