PDA

View Full Version : RSS Display Box Question



HaroldM
11-12-2008, 05:59 PM
Script URL: http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/

I've setup the RSS Display Box successfully somewhat. It's showing my feeds, etc. but it appears that it's indenting the title of each feed and I can't figure out why. I've looked through the CSS and the outputbody.php file and see nothing that would cause the indent. Here is the content of my outputbody.php file since I've seen people ask for that in other threads I've searched for trying to find this answer. Thanks in advance for any help.


<?
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com
//For syntax pf bpdu, see: http://simplepie.org/docs/installation/from-scratch/ and http://simplepie.org/docs/reference/
//Function by default defines 3 different body outputs (templates). Modify or add additional templates as desired


function outputbody($item, $template=""){
if ($template=="" || $template=="default"){ //DEFAULT TEMPLATE
?>
<DIV class="rsscontainer">
<div class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></div>
<div class="rssdate"><?php echo $item->get_date('d M Y g:i a'); ?></div>
<div class="rssdescription"><?php echo $item->get_description(); ?></div>
</DIV>
<?
} //end default template
else if ($template=="titles"){ //"TITLES" TEMPLATE
?>
<DIV class="rsscontainer">
<div class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>" target="_new"><?php echo $item->get_title(); ?></a></div>
<div>Category: <?php echo $item->get_category(); ?></div>
</DIV>
<?
} //end titles template
else if ($template=="titlesdates"){ //"TITLESDATES" TEMPLATE
?>
<DIV class="rsscontainer">
<span class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></span>
<span class="rssdate"><?php echo $item->get_date('m/d/y g:i a'); ?></span>
</DIV>
<?
} //end titlesdates template
else if ($template=="mytemplatename"){ //"mytemplatename" TEMPLATE
?>
//DEFINE ADDITIONAL CUSTOM TEMPLATE(s) USING SAME LOGIC STRUCTURE AS ABOVE
//For syntax of template body, see SimplePie docs: http://simplepie.org/docs/installation/from-scratch/ and http://simplepie.org/docs/reference/
<?
}




else
die ("No template exists with such name!");
} //Closing function bracket
?>

ddadmin
11-13-2008, 02:18 AM
The indenting could be coming from the formatting done within the RSS feed content itself (which you have no control over). To be sure, please post a link to the page on your site that contains the problematic script so we can check it out.

HaroldM
11-13-2008, 02:47 AM
Well it's doing it on all the feeds and they aren't all from the same website. Three are from one site and two are from another but here they are.

NOTE: The obituaries one might be blank if there are no new ones.

http://www.newtoniowa.com/ndnnews.php
http://www.newtoniowa.com/ndnobit.php
http://www.newtoniowa.com/kcci.php
http://www.newtoniowa.com/kccisports.php
http://www.newtoniowa.com/kccinational.php

HaroldM
11-14-2008, 04:45 PM
Any ideas? My client keeps asking about this indent issue and I have no answer to give. I've checked everything I can think of for anything that would cause it. Again the feeds are not all from the same place.

ddadmin
11-15-2008, 07:00 AM
Hmm, looking at the raw output of one of your feeds: http://www.newtoniowa.com/rssbox/main.php?id=ndnnews, there is no alignment issue with the titles. This tells me there's something within the CSS of the final page that's causing those extra indents. I can't tell what it is yet, but in the meantime, you can forcibly fix this by editing rssdisplaybox.css with the following lines in red:


.rsscontainer .rsstitle{ /*Style for .rsstitle DIV*/
font-weight: normal;
text-align: left;
position: relative;
left: -5px;
}

HaroldM
11-15-2008, 07:12 AM
ddadmin you ROCK! That did fix the indent issue. Wish I knew what was causing the problem in the first place though. Appreciate all your help!

ddadmin
11-15-2008, 08:36 AM
It has to be something on your main page itself, since as mentioned, looking at your raw output, there's no indentation that I can see.