There is an RSS Feed that I want to display in a block. But the feed actually ends with rss.php (it's like http://www.website.com/rss/rssfeed/rss.php). I've tried using the RSS feed block, but it just comes up as blank. I tried a PHP block, but if I just put in the URL, I get a parse error - I'm not sure if I need something else or not. Any suggestions? Thanks.
Try:
include('http://www.website.com/rss/rssfeed/rss.php');
Hmm, that doesn't display it either. There may be an issue with the RSS source. I'll keep playing with it.
can you post the feed and I will test it on my site for you :)
Sure, the feed is:
http://www.gijoefirefight.com/faq/feed/topten/rss.php
And it comes from:
http://www.gijoefirefight.com/faq/
Thanks!
Just put it on my site in a front-page block and it works fine. have a look at my site its on the front page about half way down (link to site in my sig)
Hmm, yep, looks great there. Did you use PHP block with the include? Or RSS somehow? I tried both RSS and PHP block and I moved it to my frontblocks (in case that made a difference) and it's still blank. I have to assume at this point it's user error (me :( ), but I'm not sure what I'm doing wrong. Thanks for your help. Nice site, BTW.
I used a RSS front page block, and just placed the feed in,
QuoteNice site, BTW.
Thanks
Yep, that's what I'm doing too.
I have a front page block (RSS feed) and I have this in the feed "box":
http://www.gijoefirefight.com/faq/feed/topten/rss.php
I checked permissions:
Show only titles: No
Do not allow block to collapse.
All membergroups are checked.
My TP Frontpage Settings show Front page blocks, and "Normal, frontblocks are shown alone".
And yet:
http://www.gijoefirefight.com/gijoetcg/index.php
I see an empty block. You don't see something different by any chance?
yes I too see an empty block :(
I am no expert but I wonder if its because the feed is coming from your own site. maybe someone will come along with a better idea :)
Try this in a PHP block,
// An RSS Reader to grab news from whichever site you choose
$backend = "http://www.gijoefirefight.com/faq/feed/topten/rss.php"; //change this to match the rss feed url you wish to display.
// end
function endtheElement($parser, $tagName) {
// This function is used when an end-tag is encountered.
global $insideitem, $tag, $title, $description, $link;
if ($tagName == "ITEM") {
echo '<table width="100%" border="0"><tr>
<td class="main-table">
<span class="nav-head"><strong>
';
printf("<p><b><a href='%s'>%s</a></b></p>", // make our title into an actual link
trim($link),htmlspecialchars(trim($title))); // remove html characters from the title
echo "</tr>";
echo '<tr>
<td class="nav">';
printf("<p>%s</p>",$description); // Print out the live journal entry
echo"</td>";
echo "</tr>";
echo "</table>";
echo "<br>";
$title = $description = $link = $insideitem = false;
}
}
// Now to the parsing itself. Starts by creating it:
$xml_parser = xml_parser_create();
// Then setup the handlers:
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
// Open the actual datafile:
$fp = fopen($backend, r);
// Run through it line by line and parse:
while ($data = fread($fp, 4096)) {
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
// Close the datafile
fclose($fp);
// Free any memmory used
xml_parser_free($xml_parser);
I tried that feed on another TP/SMF site of mine (with a different domain) and it doesn't work.
I tried your code, and it doesn't work - still a blank box.
Just out of curiousity, I tried this in a scriptbox (I've seen it work elsewhere):
<script language="JavaScript" src="http://www.gijoefirefight.com/faq/feed/topten/rss.php" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
for (count = 0; count < numHeadlines; count++) {
document.write('<a href="' + link[count] + '" target=_blank>' + headline[count] + '</a><br>');
}
</script>
It didn't work. I have a crappy host, I wonder if that's the problem.
Ahh well. Thanks again.
Gah, this is driving me nuts. Anyone else want to take a stab at it?
I use this RSS ticker on my site.. i try put in your feed and it worked fine.. so check it out.. it might be the solution you are looking for ;)
http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm
If you want to see a demo look here: http://www.gapeindex.dk/index.php?www;page=29 (no hardcore content on that page)
Mine only shows the title but it can also show date and description..
I use mine in an article but i am sure you can use it in a block also.
Good luck with it ;)
I'm just starting to play around with RSS feeds and am trying to put one in a right-side block. I have no idea what exactly I'm supposed to do, but I thought I just needed to give it the URL of the feed, which is this case is http://furmanpaladins.cstv.com/event-toolbar-rss.xml
Comes up blank. I assume I'm doing something incredibly naive, because I really don't understand RSS. Little help?
You can try this.Admin>TP>block manager.Create a new block and choose the rss feed one.
You can try this link for rss feeds.
http://www.2rss.com/cat2_31.html
Just add the link in the block and call it whatever you want.
I have it set up on my site as just front page blocks.Click on my sig and see if thats what you're after.Hope this helps. :)
I must be doing something wrong. Everytime i do a feed box and put the feed url its just an empty box?
Quote from: jdvarner on February 18, 2007, 05:24:51 AM
I must be doing something wrong. Everytime i do a feed box and put the feed url its just an empty box?
How is it set up?Do you have show titles only checked?Maybe that has something todo with it.try this.create a rss feed block and use this feed to see if it works.Its one from my site so I know it works.
http://sports.espn.go.com/espn/rss/news
sometimes you have to put in www or the feed wont work in the reader.. even thoug it works fine in a browser some readers wants the www.. try that ;)
I tried exactly what rider has a few posts up:
You can try this.Admin>TP>block manager.Create a new block and choose the rss feed one.
You can try this link for rss feeds.
http://www.2rss.com/cat2_31.html
It shows empty. im running tp 0.9.7 with smf1.1.1
Quote from: rider on February 18, 2007, 07:10:09 AM
Quote from: jdvarner on February 18, 2007, 05:24:51 AM
I must be doing something wrong. Everytime i do a feed box and put the feed url its just an empty box?
How is it set up?Do you have show titles only checked?Maybe that has something todo with it.try this.create a rss feed block and use this feed to see if it works.Its one from my site so I know it works.
http://sports.espn.go.com/espn/rss/news
didnt work? im sure im doing it just like you say. All i do is go to bloc manager. create bloc on left side. make it a rss block. and put in the link as you have it, and click save. i enable the block and its blank? im not messing with any of the default settings.
I noticed in your picture you have show titles only checked off as no.Have you tried it with yes checked off?
yes tried it. :)
I am having the same problem getting a feed to display. I can access the feed with a feed viewer, I tried Omega reader and with firefox and ie.
This is the feed link : http://www.5thcolumn.info/killboard/?a=rss
I have it selected as the last block on the left side
Show Only Titles = no
Use Frame from Theme is selected
Allow block to collapse is selected
All member groups are able to see the feed. You should be able to access the feed. I have tried it with the www and without the www with the same result.
Does anyone have a suggestion?
Thanks
Ray
jdvarner, there's an error in the XML feed. Try another one?
hraylong,
I have no problems displaying that feed. What version of SMF/TP etc are you using?
SMF is 1.1.2. I am finding out the Tiny Portal verison number. What version are you using? I did not setup the site. I have just started doing some admin stuff to help a guy out. Thanks for the quick reply.
Ray
I believe you have to set allow_url_fopen in php.ini to On in order to get feeds. I had the same issue, and that solved it.
IchBin, i have tried every single feed in this thread. Even the ones folks say they have tested and they work.
Still blank box for the rss.
softtouch where is the set allow url fopen in php.ini? i would think if it was required to make changes like that it would be obvious across the board and proabably a read me somewhere on here regards it?
since im having so many issues with it, im assuming that aint the case.
Quote from: softtouch_ph on February 19, 2007, 05:52:55 AM
I believe you have to set allow_url_fopen in php.ini to On in order to get feeds. I had the same issue, and that solved it.
That worked for me. Really does need to be in a readme file or something, because I certainly never would have thought of it.
jdvarner - it was the second line in my php.ini file.
You can make your own php.ini file, but be careful some host dont like it!
open notepad or similar, paste allow_url_fopen = On save as php.ini upload to your forum root, I have not tested this so use at your own risk!!
test your rss feed ;)
Quote from: softtouch_ph on February 19, 2007, 05:52:55 AM
I believe you have to set allow_url_fopen in php.ini to On in order to get feeds. I had the same issue, and that solved it.
where can i find this file to change ? (the place of this file ?)
cause the rss didn't work for me too :(
You'll need to ask your host that questions mate.
Quote from: Lesmondâ„¢ on February 19, 2007, 05:39:04 PM
You can make your own php.ini file, but be careful some host dont like it!
open notepad or similar, paste allow_url_fopen = On save as php.ini upload to your forum root, I have not tested this so use at your own risk!!
test your rss feed ;)
trying to create php.ini to forum root still won't work for me,.. I just migrate from joomla to TP, but i've los my rss link :'(
Quote from: hyem on April 26, 2007, 01:53:05 AM
Quote from: Lesmondâ„¢ on February 19, 2007, 05:39:04 PM
You can make your own php.ini file, but be careful some host dont like it!
open notepad or similar, paste allow_url_fopen = On save as php.ini upload to your forum root, I have not tested this so use at your own risk!!
test your rss feed ;)
trying to create php.ini to forum root still won't work for me,.. I just migrate from joomla to TP, but i've los my rss link :'(
This means that your host has probably turned the option for you to have a custom php.ini file off.
This might be of some use, I recently went from a dedicated box to a shared one, so I lost root access to the php.ini on the server.
My new host gave me the following option:
QuotePHP options can be enabled/disabled within the php.ini file in your hosting account. You or your web developer may like to upload their own php.ini. Here is how to get it working:
Create a plain-text file called .htaccess which is to be stored in your public_html directory. Inside this file, you should have:
suPHP_ConfigPath /home2/username/
Where 'username' is the username of your CPanel hosting account.
Upload your php.ini file into the root directory of your hosting account.
Note: With the php.ini file within the root directory, the PHP options you have enabled will be effective for your entire hosting account.
So it seems to be a 2 stage process where I also needed to add info to a .htaccess file.
If your host uses this method, it would be a matter of finding out what path to use.
Good luck with it!
yes thx,.. it's work now !!! thx.. alot..
but is there any trick to limiting content of our rss feed news