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:

define('MAGPIE_DIR', 'magpie/');
define('MAGPIE_CACHE_ON', 1);
require_once(MAGPIE_DIR.'rss_fetch.inc');
$rss = fetch_rss( 'http://www.blogger.com/feeds/[My feed's id number]/posts/default' );
//display latest blog content:
//
$numberOfFullyDisplayedItems = 3;
$itemCounter = 0;
foreach ($rss->items as $item) {
$itemCounter += 1;
if ($itemCounter <= $numberOfFullyDisplayedItems) {
echo '

'.$item['title']."

\n";
echo "

".$item['atom_content']."

\n";
}
// only for the first item after the completely displayed ones:
if ($itemCounter == $numberOfFullyDisplayedItems+1) {
echo "

More Items

\n";
echo "
    \n";
    }
    if ($itemCounter > $numberOfFullyDisplayedItems) {
    echo '
  • '.$item['title']."
  • \n";
    }
    }
    // if there were more items: close the UL
    if ($itemCounter > $numberOfFullyDisplayedItems) {
    echo "
\n";
}
?>




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?



I also tried editing the .tpl file directly, but that just caused even more problems.