PDA

View Full Version : Script stretching out feeds.



Sharks
05-17-2011, 12:22 AM
1) Script Title:
RSS Display Boxes
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm
3) Describe problem:

Hello, all. I'll probably sound stupid for post this but here it goes.. I'm having an issues with getting a feed I'm pulling to format properly. It gets very spread out vs example on the script page above. Is this issue with my blog/rss feed or is this something I could fix using rssdisplaybox? The link below shows what is happening.

http://www.neotoonami.com/demo.htm

ddadmin
05-17-2011, 04:54 AM
You can take a peek at the output of each of your retrieved RSS feed by navigating to:

http://www.neotoonami.com/rssbox/main.php?id=rssid

replacing rssid with the ID of the RSS feed in question. To view the first feed's output then, navigate to:

http://www.neotoonami.com/rssbox/main.php?id=cssdrive

As you can see if you view source, there are some <p> tags in the description elements. I suspect that's what's causing the spacing between entries.

Sharks
05-21-2011, 03:24 AM
Sorry, for such taking such a long time to reply. Thank you for all your help. Last question is it possible to take out the <p> tags with the script or would that be done on the feed/sever side? (I'm currently exploring that option as well).

ddadmin
05-21-2011, 06:41 AM
I would say it's probably more elegant to do this on the server side, such as by going into outputbody.php and massaging the output of the descriptions to your liking:


<?php echo $item->get_description(); ?>

jscheuer1
05-21-2011, 07:20 AM
I had taken a look at this one earlier and thought it would be best to actually get the feed itself to be in the desired format:


. . . done on the feed/sever side?

So assuming you have control over the feed server, yes to that.

However, adding this style:


.rsscontainer p {
margin: 0px;
}

to the stylesheet will eliminate much of the extra blank lines.

ddadmin's idea could work too. I think strip_tags:

http://us2.php.net/manual/en/function.strip-tags.php

might do the trick. It lets you allow certain other tags you want to remain (I think div would be the only one you'd need to allow, not sure though). Something like:


<?php echo strip_tags($item->get_description(), '<div>'); ?>

Sharks
05-24-2011, 04:47 AM
Cool thank you for all your help guys. I will definitely be happy to use your guys scripts anytime.

For my issue I actually resolved in a semi-round about fashion.. I was pulling a .rss2 feed from wordpress which was causing the said <p> tags to appear because wordpress is dumb like that. I then pulled just a .rss feed this worked minus font/color was wrong. This however was a easy fix by applying some css formatting to the output of dynamic box.

So sorry for taking so much of your time I hope my resolution helps more people out there who are fighting with wordpress lol.