View Single Post
  #17  
Old 01-23-2011, 05:29 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: If Statement for any page?

You can copy the inc file in include directory. In include/categories.php just before "?>" put

Code:
require_once $xcart_dir."/include/simplepie.inc"; $feed = new SimplePie(); if($cat == 252) $feed->set_feed_url("http://www.promartsupplements.co.uk/...nes/?feed=rss2"); else $feed->set_feed_url("http://www.promartsupplements.co.uk/blog/?feed=rss2"); $feed->init(); // Limit the items to be shown $i = 0; $new_feed = array(); foreach($feed->get_items() as $item) { if($i <= 2) { $new_feed[$i]["link"] = $item->get_permalink(); $new_feed[$i]["title"] = $item->get_title(); $new_feed[$i]["descr"] = substr($item->get_description(),0,180); $i++; } } $smarty->assign("new_feed", $new_feed);

Then use $new_feed in the template you want it to show

Code:
{foreach from=$new_feed item=nf} <a href="{$nf.link}">{$nf.title}</a> <br /> {$nf.descr} <p> ----------------------------------</p> {/foreach}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote