Firefox PHP

[SOLVED] rss items not showing up in my rss reader??

Posted by Terradon 
[SOLVED] rss items not showing up in my rss reader??
November 04, 2017 09:04PM
Hi,
I want to show rss feeds on a mainpage. Phorum resides in a submap of the site.
But whatever I try, ever PHP example I tried, no rss items are showing up?
Going back to my basic code:

Language: PHP
$url = ';http:/www.mysite.tld/feed.php?1,type=rss';; // my phorum $url2 = ';http://www.freshfolder.com/rss.php';;// works as expected   // read feed into SimpleXML object $rss = simplexml_load_file($url);   if($rss){ echo ';<b>1';.$rss->channel->title.';</b>';;//ok echo ';<br>2';.$rss->channel->description;//ok echo ';<br>3';.$rss->channel->link;//ok   $items = $rss->channel;   echo ';X<pre>';; print_r($items); // not working echo ';</pre>';;   foreach($items as $item){   echo ';Y<pre>';; print_r($item);// not working echo ';</pre>';;   echo ';<p>Z<b>';.$item->title.';</b>';; echo ';<br>';.$item->description; echo ';<br>';.$item->link; echo ';<br>';.$item->description;   } }

With url2 it works as expected, but not with my phorum.
Looking further I saw a difference: xmlns:dc="[purl.org]; is added to rss tag. Seems something to do with namespace, but don't understand how it works out here?

Above basic code gives as result:

Language: HTML
<hr><b>1&nbsp; - Site-mededelingen</b><br>2Lees dit forum voor de laatste site-mededelingen<br>3http://www.mysite.tld/list.php?1X<pre>SimpleXMLElement Object ( [title] => &nbsp; - Site-mededelingen [description] => Lees dit forum voor de laatste site-mededelingen [link] => http://www.mysite.tldl/forum_v5/list.php?1 [lastBuildDate] => Sat, 04 Nov 2017 21:00:23 +0100 [generator] => Phorum XXXX ) </pre>Y<pre>SimpleXMLElement Object ( [title] => &nbsp; - Site-mededelingen [description] => Lees dit forum voor de laatste site-mededelingen [link] => http://www.mysite.tld/list.php?1 [lastBuildDate] => Sat, 04 Nov 2017 21:00:23 +0100 [generator] => Phorum XXXX ) </pre><p>Z<b>&nbsp; - Site-mededelingen</b><br>Lees dit forum voor de laatste site-mededelingen<br>http://www.mysite.tld/list.php?1<br>Lees dit forum voor de laatste site-mededelingen     <hr>The End____

Someone any idea what I am overlooking here?

Thanks in advance for any help!

<hr />
usually manuals are written by experts,
so.....that's the reason why i do not understand the manuals)



Edited 1 time(s). Last edit at 11/06/2017 01:17PM by Terradon.
Re: rss items not showing up in my rss reader??
November 06, 2017 01:16PM
you don't see any feeds, if you aren't logged in.
login is checked by cookies, which can't be sent with a request from the server...($rss = simplexml_load_file($url); <= request from server).

What does work: a jquery ajax call, get with datatype xml and then loop over the items.
example found here: http://www.jquerybyexample.net/2012/04/read-and-process-xml-using-jquery-ajax.html

It should be obvious, you still have to be logged in to see the forumitems. (unless not logged in visitors can read your phorum).

So my solution is applicable in cases you want to inform your members about your forummessages on your non-phorumpart of your site. (assuming your websites userlist is somehow connected with your phurum userlist).

<hr />
usually manuals are written by experts,
so.....that's the reason why i do not understand the manuals)



Edited 1 time(s). Last edit at 11/06/2017 01:21PM by Terradon.
Sorry, only registered users may post in this forum.

Click here to login