Include not allowed, need to read external RSS feed

Feed 4 posts, 2 voices

Jul 25, 2008 10:24
Avatar
5 posts

For some reason, I can't get the php 'include' function to work. When I'm not using Frog CMS, the function works fine on my server. How do we use the php include function? Is this something discouraged by Frog?

I need the include function because I'm trying to import an RSS feed using lastRSS (source code at http://lastrss.oslab.net/lastRSS.phps). I continually have this error:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /homepages/30/d176004502/htdocs/worderella/frog/app/frontend/classes/Page.php(319) : eval()'d code on line 7

Warning: include(http://www.worderella.com/worderella/public/lastRSS.php) [function.include]: failed to open stream: no suitable wrapper could be found in /homepages/30/d176004502/htdocs/worderella/frog/app/frontend/classes/Page.php(319) : eval()'d code on line 7

Warning: include() [function.include]: Failed opening 'http://www.worderella.com/worderella/public/lastRSS.php' for inclusion (include_path='.:/usr/lib/php5') in /homepages/30/d176004502/htdocs/worderella/frog/app/frontend/classes/Page.php(319) : eval()'d code on line 7

Fatal error: Class 'lastRSS' not found in /homepages/30/d176004502/htdocs/worderella/frog/app/frontend/classes/Page.php(319) : eval()'d code on line 8

Thanks!

 
Jul 25, 2008 10:35
Avatar
5 posts

I forgot to add my code. Oops!

<?php    include BASE_URL.'public/lastRSS.php'; // include lastRSS 
    $rss = new lastRSS; // Create lastRSS object 
    $rss->cache_dir = BASE_URL.'public/cache'; // Set cache dir (don't forget to chmod cache dir to 777 to allow writing) 
    $rss->cache_time = 43200; // Set cache time limit (43200 seconds = 1 day)

    // Try to load and parse RSS file 
    if ($rs = $rss->get('http://blog.worderella.com/wp-rss.php')) { 
        // Show last published articles (title, link, description) 
        echo "<ul>\n"; 
        foreach($rs['items'] as $item) { 
            echo "\t<li><a href=\"$item[link]\">".$item['title']."</a><br />".$item['pubDate']."</li>\n"; 
        } 
        echo "</ul>\n"; 
    } 
?> 
 
Jul 25, 2008 10:59
Avatar
5 posts

In case anyone was wondering... it turns out I needed to use a relative link, achieved by: include('./public/lastrss.php');

Just in case anyone else was encountering the same problem.

 
Jul 25, 2008 11:19
Avatar
963 posts

@siriomi - glad you sorted it -- that was fast work! I wondered at first if you needed to use require() as came up in this forum post.

The website looks nice, too! :) Have you got (m)any Frog sites running live?

 
Jul 26, 2008 16:23
Avatar
5 posts

I run the blog that I'm trying to RSS, and right now the only Frog site I have is <a href="http://www.worderella.com">Worderella Online</a>. But I'm planning to convert over my web portfolio as well, because I love this CMS.