If I'm annoyed, it's not with you. My tone may have suggested that. If it did I apologize. I was trying to clarify things by making that statement and asking that question. By responding as you did and supplying the text version of the file you have helped clear things up for me. Thank You.
Looking at the file in text form, it's obviously an indirect include for simplepie.inc which has things like:
Code:
get_title()
get_description()
etc. defined for any given item. get_copyright() is not defined for the feed, and the feed ($feed) is not passed to outputbody.php anyway. There is a get_feed_copyright() defined for the feed though.
Now, I don't know a whole lot more about PHP than you do, but some. And I do understand scripted languages in general fairly well.
I found that by editing outputbody.php to include the highlighted:
Code:
<?php
//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="", $feed){
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 class="rsscopy"><?php echo $feed->get_feed_copyright(); ?></div>
</DIV>
<?php
} //end default template
else if ($template=="titles"){ //"TITLE . . .
And by editing main.php in the same folder around line #40 (near the end) to include the highlighted:
Code:
function outputitems(){
global $feed, $feednumber, $templatename;
$max = $feed->get_item_quantity($feednumber);
for ($x = 0; $x < $max; $x++){
$item = $feed->get_item($x);
outputbody($item, $templatename, $feed); //call custom outputbody() function
}
}
It worked for the demo's NYT feed and caused no error for those feeds that had no copyright data.
It did however attach the copyright info to each item, rather than just once at the end of the feed. Doing the latter is possible, I'm just not sure of the best way to go about it at the moment.
Bookmarks