I know this seems odd, but I generated a php script which works as an rss reader. I want to place the last 3 items from the rss feed above the top articles, and then change the number of top articles from ten to five to make space.
It would seem that for obvious security reasons, I cannot just place this in the index.tpl file. Where would be the correct place to add this php? Also, where can I change the number of top faqs?
Many Thanks in advance!
Ryan
Here is what I am trying to add:
<?php
require_once("rsslib.php");
$url = "http://helpdesk-smumn.blogspot.com/feed ... lt?alt=rss";
echo RSS_Links($url, 5, false, true);
?>
adding php rss reader?
Moderator: Thorsten
-
- Posts: 200
- Joined: Tue Nov 02, 2010 9:08 am
- Location: United States-Ohio
- Contact:
Re: adding php rss reader?
I can parcially answer your question, if you want to change the number of your top ten you would have to edit config/constant.php line74
phpMyFAQ Quality Assurance / Forum Moderator
Amazon.com Wishlist
Amazon.com Wishlist
Re: adding php rss reader?
Hi,
I would add a template page (check this: http://faq.phpmyfaq.de/content/11/9/en/ ... t=template). and add this to the index.tpl.
Jochen
I would add a template page (check this: http://faq.phpmyfaq.de/content/11/9/en/ ... t=template). and add this to the index.tpl.
Jochen
Our public FAQ is proudly powered by phpMyFAQ: http://vhtfaq.ge51.honeywell.de/
-
- Posts: 4
- Joined: Wed Jun 15, 2011 5:46 pm
Re: adding php rss reader?
I was able to figure it out. Here is what I did:
I copied the php library file phplib.rss to /inc/libs
Added this to index.php:
require_once("inc/libs/rsslib.php"); $url = PATH TO RSS FEED"; $rssfeed = RSS_Links($url, 3, false, true);
Then add the variable to the $main_template_vars array, like this:
'rssfeed' => $rssfeed,
In my index.tpl file, I added this:
{rssfeed}
Works perfectly, just wanted to post this in case anyone else was trying to do something similar.
Thanks!
Ryan
I copied the php library file phplib.rss to /inc/libs
Added this to index.php:
require_once("inc/libs/rsslib.php"); $url = PATH TO RSS FEED"; $rssfeed = RSS_Links($url, 3, false, true);
Then add the variable to the $main_template_vars array, like this:
'rssfeed' => $rssfeed,
In my index.tpl file, I added this:
{rssfeed}
Works perfectly, just wanted to post this in case anyone else was trying to do something similar.
Thanks!
Ryan
Re: adding php rss reader?
Hi,
thanks for sharing!
bye
Thorsten
thanks for sharing!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: adding php rss reader?
It looks like a nice solution. As soon as I get home I will try this immediatelly. Thanks for the nice description!techfaqhelp wrote:I was able to figure it out. Here is what I did:
I copied the php library file phplib.rss to /inc/libs
Added this to index.php:
require_once("inc/libs/rsslib.php"); $url = PATH TO RSS FEED"; $rssfeed = RSS_Links($url, 3, false, true);
Then add the variable to the $main_template_vars array, like this:
'rssfeed' => $rssfeed,
In my index.tpl file, I added this:
{rssfeed}
Works perfectly, just wanted to post this in case anyone else was trying to do something similar.
Thanks!
Ryan
Gotta go back in time