TinyPortal

Development => Support => Topic started by: Sledge on April 17, 2009, 10:45:43 PM

Title: RSS Block Code
Post by: Sledge on April 17, 2009, 10:45:43 PM
I have a quick question. I'm trying to modify the rss block code so that it shows a horizontal rule between each link. I've got a rss feed for news, but they are all jammed together. It's hard to see where one link ends and another starts. Does anyone know where the code is tucked away for the rss block?

Thanks

http://www.thepoliticalcapital.com
Title: Re: RSS Block Code
Post by: IchBin on April 17, 2009, 10:52:28 PM
You'll most likely have to use a third party script to customize the RSS feed. I don't think TP does anything like what you're looking for. TPModules.php in the Sources/ directory is what file you're looking for.
Title: Re: RSS Block Code
Post by: Zetan on April 17, 2009, 11:09:04 PM
I personally use RSS to Java:

http://itde.vccs.edu/rss2js/build.php

You can customise it somewhat, it uses bullet points. I haven't found one better yet, though I would be interested in one that I could host on my own site. I don't think that one will be around for a long time, so an alternative would be good.
Title: Re: RSS Block Code
Post by: Renegd98 on April 17, 2009, 11:43:55 PM
Try RSSInclude
http://www.rss-info.com/en_rssinclude-simple.html

I make the php code
Title: Re: RSS Block Code
Post by: Sledge on April 18, 2009, 01:10:45 AM
I use Magpie (http://magpierss.sourceforge.net/) for the news feeds in the Ajax tabs at the top of the forum. It's very customizable and works well for what I use it for. The right sidebar is using the built in rss block. I suppose I can use Magpie for the right panel as well. I was just hoping I could add a hr tag to the built in TP feed parser.

*edit*

Did it. Works great. Thanks for the file location Itchbin.
Title: Re: RSS Block Code
Post by: Renegd98 on April 18, 2009, 02:35:11 AM
Please share you code changes to help others who may want to make the change.
Title: Re: RSS Block Code
Post by: Sledge on April 18, 2009, 03:32:32 AM
Certainly!

To add a horizontal rule between your titles in the TP 1.0.6b2 built in RSS block do the following:

In your forum sources directory, open TPmodules.php.
Find the following code:

<div class="rss_title">';
printf("<a href='%s'>%s</a>", trim($link),htmlspecialchars(trim($title)));
echo '
</div>';


After the anchor tag (/a), add the hr tag.
Your code will look like this:

<div class="rss_title">';
printf("<a href='%s'>%s</a><hr />", trim($link),htmlspecialchars(trim($title)));
echo '
</div>';


Check the right sidebar of my forum to see the result:

http://www.thepoliticalcapital.com

[edited] Single tags should be formed
, not
-Zetan
Title: Re: RSS Block Code
Post by: G6Cad on April 18, 2009, 07:41:33 AM
Very nice sledge  :up:   Thanks for sharing  :)
Title: Re: RSS Block Code
Post by: IchBin on April 19, 2009, 06:21:40 AM
Ah... misunderstood what you were asking. Glad you figured it out though. lol