在模板页里首页写上代码:         <?php$children = get_children(16);//此处为产品分类ID$smarty->assign( 'bestGoods16',get_category_recommend_goods('best', $children));?> 然后在模板文件里调用就行了.…
未测试 1.includes/lib_goods.php文件.把SQL语句改一下,与category表关联即可 将 $sql = 'SELECT g.goods_id,g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' . 改为 $sql = 'SELECT g.goods_id,g.cat_id,c.parent_id,g.goods_name, g.go…
举例如首页调用方法: 1.先打开index.php文件找到以下代码: $smarty->assign('new_articles', index_get_new_articles()); // 最新文章 在它下面增加以下: //调用方法$smarty->assign('class_articles_4', index_get_class_articles(4,6)); // 分类调用文章 //调用多个就修改传进去的参数,以及模板接收的变量,其中上面的4就是文章分类ID,其中6是调用数量 $sm…
/*首页调用指定分类下的销售排行*/ function get_cats_top10($cat = '') { $sql = 'SELECT cat_id, cat_name ' . 'FROM ' . $GLOBALS['ecs']->table('category') . "WHERE parent_id = '$cat' ORDER BY sort_order ASC, cat_id ASC LIMIT 3"; $res = $GLOBALS['db']->getAl…
我们有时需要根据实际需要进行一些设置,比如wordpress调用指定分类除外的置顶文章,如何实现呢?随ytkah一起来看看吧,用如下代码插入到需要调取的位置 <div class="recommended-container"> <div class="title"><strong>RECOMMENDED</strong></div> <div class="box"> &l…
wordpress是很强大的cms系统,你可以通过相关函数就能实现相关的功能.很多网友会问wordpress怎么调用指定分类文章的呢?其实很简单,随ythah一起来看看吧,几行代码就解决了,代码如下 <ul> <?php query_posts('cat=1&showposts=5'); //cat是要调用的分类ID,showposts是需要显示的文章数量 ?> <?php while (have_posts()) : the_post(); ?> <li…
第一步:--------------------------------------------------------------------------------------/** * 取指定分类ID及类型的商品信息 * @access public * @param string $cat_id 分类ID * @param string $num 显示商品数量 * @param string $cat_type 显示商品类型 new新品,hot热销,best为精品,promote特价 *…
转:http://bbs.ecshop.com/thread-1123207-1-1.html 调用某个分类下的商品,方法有很多种的,不过都需要先在后台设置模板那里设置显示和显示条数, 然后在需要调用的模板里放上相应的代码即可: 1.比如: <?php $this->assign('cat_goods',$this->_var['cat_goods_15']); ?><?php $this->assign('goods_cat',$this->_var['good…
第一步 在系统目录文件找到includes/lib_goods.php  这个文件打开 在此页最底部加入以下函数代码 /** * 首页获取指定分类产品 * * @access public * @param string $cat_id53_best_goods * @param array $cat_id53_best_goods * @return array */ function index_get_cat_id_goods_best_list($cat_id = '', $num =…
dedecms是全静态的,有时会因为其他事情好几天没写文章推荐到首页,那样对se不是很友好.原本ytkah是想在网站首页上半部分调用几篇id从200到500的文章随机展示的,这样每次更新首页给se的赶脚像是有添加新的文章了,但测试了很久也没实现出来,在网上search了貌似也没找到相关的解决方案,哪位高手知道的麻烦告诉ytkah一下哈!用帝国cms建的站?参考帝国cms调用随机文章 支持一个id段内的调用 能力有限,只能求其次了,那就随机调用某个分类下的文章展示了,在当前模板index.htm添…