Results 1 to 2 of 2

Thread: Pausing RSS scroller - replacing fopen with file_get_contents or curl?

  1. #1
    Join Date
    Jul 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Pausing RSS scroller - replacing fopen with file_get_contents or curl?

    1) Script Title:
    Pausing RSS scroller


    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...ller/index.htm


    3) Describe problem:

    - I got the much dreaded "Sorry: It's not possible to reach RSS file"

    - Then I searched this forum and found that it could be related to allow_fopen_url not being enabled on PHP.

    - I checked my php config and found that allow_url_fopen is indeed OFF


    4) Request:

    - Is it possible for the very clever ddadmin to replace fopen with alternatives like file_get_contents or curl?

    Apparently, it is very common for web hosting companies to disable fopen for security reasons. So replacing the fopen codes with alternatives will solve the "problem" permanently.

    I am only an end-user, so am not clever enough to know what to change and how to change. If ddadmin could do us this favor, it will be GREATLY appreciated.

    THANKS!

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Just glancing at the code in lastRSS.php, locate the following lines:

    Code:
    	function Parse ($rss_url) {
    		// Open and load RSS file
    		if ($f = @fopen($rss_url, 'r')) {
    			$rss_content = '';
    			while (!feof($f)) {
    				$rss_content .= fgets($f, 4096);
    			}
    			fclose($f);
    and replace with the following:

    Code:
    	function Parse ($rss_url) {
    		// Open and load RSS file
    $rss_content = file_get_contents($rss_url);
    Not tested!

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •