PHP errors & RSS feeds

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
digger
Posts: 3
Joined: Fri 3. Feb 2006, 17:06

PHP errors & RSS feeds

Post by digger »

What I'm trying to do is put a couple of RSS feeds permanently in a template page so they always show up regardless of other {CONTENT} on the page, and I want to use a customizable RSS php script so I control how each looks.

I have tried using the {PHP:filename.php} tag to call the file, but it doesn't display anything.

When I add the script in [PHP][/PHP], I get this mess: http://www.firststater.com/news/. Same for when I just try to call the script using a PHP 'require'.

I know the code works, since it displays what I want when I run it solo: http://www.firststater.com/news/rss_infeeds.php

I am using v1.2.5-DEV.

Is there a way to do this?
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: PHP errors & RSS feeds

Post by DeXXus »

digger wrote:I have tried using the {PHP:filename.php} tag to call the file, but it doesn't display anything.
What does "view source" of rendered page show in that area? just the tag in braces (as if not executed)? Is your "config.inc.php" setting for this enabled?

Code: Select all

$phpwcms["allow_remote_URL"]  = 0;        //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed
digger wrote:When I add the script in [PHP][/PHP], I get this mess: http://www.firststater.com/news/. Same for when I just try to call the script using a PHP 'require'.
-With the tags [PHP][/PHP], it must be the cut/paste of exact PHP code from the "rss_infeeds.php" file (minus the <?php and ?> delimeters). Same with using 'require'.

-Keep in mind, 'require' will cause a "fatal error" and stop execution of page rendering, if problem with calling "rss_infeeds.php" occurs, whereas 'include' will allow rendering of page to, at least, continue.

-Make sure you are using "fully-qualified" path to "rss_infeeds.php" if outside phpWCMS's file structure.

-In addition, one has to be careful where a phpwcms "tag" ( http://www.firststater.com/news/ ) is used . If it has not yet become "defined", until later in phpWCMS's execution, it will appear as just the text of the tag (as you describe).

Another tag for consideration would be {URL:}. Also, you would have to make sure the file output has <body></body> tags and then "scrape" the <a href lines for the feeds.
digger
Posts: 3
Joined: Fri 3. Feb 2006, 17:06

Post by digger »

DeXXus, thanks for your reply.

I've tried removing the <php> braces, but that didn't work either. I've made sure the config.inc.php file allowed external URLs, but that didn't help. [It now shows the page layout, but not the RSS data]

When I use a PHP require, I get this error:

Code: Select all

Fatal error: Cannot redeclare initarray() (previously declared in /home/first/public_html/news/rss_infeeds.php:11) in /home/first/public_html/news/rss_infeeds.php on line 9
Putting the code directly in [PHP][/PHP] tags gives a similar error.

The feed works (it's here: http://www.firststater.com/news/rss_infeeds.php ).

I must be missing something really obvious.
Post Reply