MagpieRSS and integrating blogs

Does anyone have any experience in using MagpieRSS to integrate blog posts into a custom HTML block?



Basically, it uses php to nab some items from your blog’s RSS feed. Here is the code that I’m putting into a custom HTML block:

<?php<br />
define('MAGPIE_DIR', 'magpie/');<br />
define('MAGPIE_CACHE_ON', 1);<br />
require_once(MAGPIE_DIR.'rss_fetch.inc');<br />
$rss = fetch_rss( 'http://www.blogger.com/feeds/[My feed's id number]/posts/default' );<br />
//display latest blog content:<br />
//<br />
$numberOfFullyDisplayedItems = 3;<br />
$itemCounter = 0;<br />
foreach ($rss->items as $item) {<br />
$itemCounter += 1;<br />
if ($itemCounter <= $numberOfFullyDisplayedItems) {<br />
echo '<h3><a href="'.$item['link'].'" target="_blank">'.$item['title']."</a></h3>\n";<br />
echo "<p>".$item['atom_content']."</p>\n";<br />
}<br />
// only for the first item after the completely displayed ones:<br />
if ($itemCounter == $numberOfFullyDisplayedItems+1) {<br />
echo "<h3>More Items</h3>\n";<br />
echo "<ul>\n";<br />
}<br />
if ($itemCounter > $numberOfFullyDisplayedItems) {<br />
echo '<li><a href="'.$item['link'].'" target="_blank">'.$item['title']."</a></li>\n";<br />
}<br />
}<br />
// if there were more items: close the UL<br />
if ($itemCounter > $numberOfFullyDisplayedItems) {<br />
echo "</ul>\n";<br />
}<br />
?>
```<br />
<br />
I think CS Cart is doing something funky when trying to execute the php. Does anyone have any experience in putting php into these custom HTML blocks?<br />
<br />
I also tried editing the .tpl file directly, but that just caused even more problems.