Common Readed, feed as a URL
I was wondering if I can use commonlib (or the other feed readers) by adding the feed address in the commonlib URL, when browsing. Example: example.com/commonlib.php?url-of-the-feed=feed.com/rss Thank you!
You have to had an extra layer to get the parameter, and call the display function.
$url = $_POST['feed']; include_once("commonlib.php"); // or rsslib display($url);The code is simplified.
You have to had an extra layer to get the parameter, and call the display function.Sorry, can't make it work. I'm not a coder myself, I don't get the meaning of "simplified" - if I must change something then I'm already lost :) Could you be more specific, please? So far I have a test file with this code:$url = $_POST['feed']; include_once("commonlib.php"); // or rsslib display($url);The code is simplified.
<?php $url = $_POST['feed']; include_once("commonlib.php"); // or rsslib display($url); ?>... and this message:
Fatal error: Call to undefined function display() in D:\XAMPP\htdocs\commonlib\test.php on line 19(testing locally on Xampp), on this URL: localhost/commonlib/test.php?url=my.feed.URL Maybe I haven't explained myself very good in the first thread, sorry. So, seeing my test link, this is what I want. Also, I don't mind if I must use another file, like test.php, or the commonlib.php itself in the address. What I want to do (the big story) is to allow site's visitors to preview the site feeds, staying on the same address, before they'll decide to subscribe to that feed. The test.php page will have a drop-down menu with all the feeds and when changed, a new test.php page will load with a new feed from the drop-down menu - this is the easy part... the hard part I hope you'll help me with :) Thanks!
Sorry, it was just an example... Here is the complete code:
<?php include_once("commonlib.php"); $url = $_GET['feed']; echo Common_Display($url, 25, true, true, true); ?>Put the code in a text file, for example rssget.php, in the same directory that commonlib.php. To try the code on wamp, the command is:
http://localhost/commonlib/rssget.php?feed=http://www.scriptol.com/rss.xmlReplace http://localhost by your domain and add the the directory of commonlib. Replace http://www.scriptol.com/rss.xml by the feed to display. Exemple:
http://www.somedomain.org/commonlib/rssget.php?feed=http://www.somedomain.orgrss.xmlFor rsslib, replace Common_Display($url, 25, true, true, true); by echo RSS_Display($url, 15);
Thank you very much! You're my hero :) One suggestion, I don't dare to ask only for me, but I think it will improve your script a lot: maybe you can try to make so that it can cache the feeds for a while, making the page to load faster this way. Thanks again!