Re: If Statement for any page?
I would do it like this.
make a .tpl for each cat wit the cat id in the name
so
252_feed.tpl
the do it like this.
{include file="customer/feeds/`$cat`_feed.tpl"}
of course you need to make the customer/feed folder.
then in your 252_feed.tpl file put your php code
{php}
require_once("simplepie.inc");
$feed = new SimplePie();
$feed->set_feed_url("http://www.promartsupplements.co.uk/...nes/?feed=rss2");
$feed->init();
// Limit the items to be shown
$i = 0;
foreach($feed->get_items() as $item) {
if($i <= 2) {
echo "<h3 style='font-size:14px;'><a style='color:#000; text-decoration:none; font-size:13px; font-family:Verdana,Arial,Helvetica,Sans-serif;' href='" . $item->get_permalink() . "'>" . $item->get_title() . "</a> </h3>";
echo "<p style='font-family:Verdana,Arial,Helvetica,Sans-serif; font-size:11px;'>" . substr($item->get_description(),0,180) . "...<a style='text-decoration:none; font-size:11px; font-family:Verdana,Arial,Helvetica,Sans-serif;' href='" . $item->get_permalink(). "'>[Read Article]</a></p>";
$i++;
}
}
{/php}
__________________
xcart 5.1.2
|