Any way of putting an RSS feed into an article?
I'm wanting to have a couple of feeds that are not on the front page but which can be linked to the content manager.
TIA
You try creating a php article and include the rss with php?
include('yourlinktoRSShere');
Tried it and get -
Parse error: parse error, unexpected T_STRING in http://www.webbikeworld.com/motorcycles/rss.xml on line 1
using
include('http://www.webbikeworld.com/motorcycles/rss.xml');
EDIT: Just noticed that when you go back to edit the article, that the PHP tick box isn't showing.
Does that have an effect?
Seems to be their problem not yours.
Tried a few of the rss feeds and they all give the same error - even the one that works in the RSS Block on the homepage.
Try http://jade.mcli.dist.maricopa.edu/feed/index.php?s=build that's how i put a fe feeds in my articles.
Thanks winrules. ;)
Just what i needed, thanks ;)
I think I've cracked it ;D :tickedoff: No I hadn't
This is an RSS feed from M$ - Microsoft At Home
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '<div style="padding: 5px;" class="smalltext">';
TPparseRSS('http://www.microsoft.com/athome/security/rss/rssfeed.aspx');
echo '</div>';
[Edit]Not quite, that only works if you have a block with a live feed, it must be something simple, the globals are the same for both the TPortal.template and TPortalBlocks.template.[/s]
Quote from: winrulesTry http://jade.mcli.dist.maricopa.edu/feed/index.php?s=build that's how i put a fe feeds in my articles.
it's great, I'm success with my address RSS feed: http://www.elpvn.org/index.php?type=rss;action=.xml
Result I add this Scriptblock to TP:
<script language="JavaScript" src="http://jade.mcli.dist.maricopa.edu/feed/feed2js.php?src=http%3A%2F%2Fwww.elpvn.org%2Findex.php%3Ftype%3Drss%3Baction%3D.xml&chan=y&num=5&date=y&targ=y&html=a" type="text/javascript"></script>
<noscript>
<a href="http://jade.mcli.dist.maricopa.edu/feed/feed2js.php?src=http%3A%2F%2Fwww.elpvn.org%2Findex.php%3Ftype%3Drss%3Baction%3D.xml&chan=y&num=5&date=y&targ=y&html=y">View RSS feed</a>
</noscript> ;D Thanks
Attempt 2
In TPortal.php add before ?>
function RSSfeed()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$backend = 'http://news.bbc.co.uk/rss/on_this_day/front_page/rss091.xml';
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
// end
// 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);
}
PHP article
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '<div style="padding: 5px;" class="smalltext">';
RSSfeed();
echo '</div>';
What are the pros and cons of having a seperate function for each RSS feed?
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nokonium.plus.com%2Fblack-cat%2Funsorted%2Fattention.gif&hash=6926f406611542acf1da2721d0d651ef6b7bca65)
I now have 4 feeds working using different function namesÃ, ;D
Now a further question, some of the feeds appear to want to show an image. From the positioning of it it could be a bullet point.
How can I either enable it to pick up an image and display it or stop it displaying the rectangle with image in it.
This Computer Weekly feed displays what I mean.
http://www.computerweekly.com/Feeds/RSS.aspx?cat=108
Very cool, this worked, thanks! :up: