Forum

How to put the RSS Reader in an HTML page?

2011-04-01

Alex

Hello, some question about PHP RSS Reader, Its good that PHP RSS Reader allow to display feed that will be visible by search engines. But how to implement this script (rss-direct.php) into html page? My html pages are dynamically generated by CMS, the template look like this, attached test.tpl The content itself goes inside this div:
<div id="someContentDiv"style="overflow:auto;">
#INS:content#
</div>
Is there way to insert rss-direct.php in page and call it from the page? The server support PHP, but I canno rename all my pages to .php Best Regards, Alex
2011-04-01

scriptol

Hello You can insert the script into a special PHP page, the result will be displayed in this page, and then insert this page by Ajax, unless the CMS allow to insert directly content from other pages. There is an example  with the anaa framework to insert content from another page. http://www.scriptol.com/ajax/anaa/code/demo-responseHTML.html Sincerely The webmaster
2011-04-01

Alex

Hello, yes, I can use Javascript code to write content into html page, but this isn't search engines friendly, as theer is no content in page source code, I just wanted find way to use PHP to return the content directly, to make a feed search engines friendly. Best Regards, Alex
2011-04-01

scriptol

You can set the synchronous mode then the scripts will be executed before the page entirely loaded.
xhr.open("GET", "data.xml", false);      // false = synchronous
But the perfect solution is in the ability of the CMS to include files or the template to make another file a part of the page. For this last point, only the designer of the CMS could answer you.
2011-04-01

Alex

Hi, I will use RewriteRule to map incoming .html and .htm requests to the (new) real .php extensions, so will be able use php on my pages. So I'm trying to include an RSS feed via PHP. RSSLIB have RSS 2.0 Demo Direct example, showing how display feed directly on a page: so how to include PHP in html page? If I take this snippet:
<?php
require_once("rsslib.php");
$url = "http://www.scriptol.com/rss.xml";
echo RSS_Display($url, 15, false, true);
?>
then save this snippet as "feed.php" file and include it in my page via php include, would this be correct:
<?php include("feed.php"); ?>
How to add some style to RSS container? Best Regards, Alex
2011-04-04

scriptol

Hello Yes it is correct. For styling the feed, you have a demo: http://www.scriptol.com/rss/rss-direct.php