举例如首页调用方法: 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…
未测试 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…
在模板页里首页写上代码:         <?php$children = get_children(16);//此处为产品分类ID$smarty->assign( 'bestGoods16',get_category_recommend_goods('best', $children));?> 然后在模板文件里调用就行了.…
我们有时需要根据实际需要进行一些设置,比如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…
/*首页调用指定分类下的销售排行*/ 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…
转之--http://www.16css.com/ecshop/735.html 通过二次开发可以实现ECSHOP首页调用指定分类下的品牌列表. 第一步: 打开根目录下的index.php 在最后面 ?> 前面加入以下代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 /** * 获得某个分类下的品牌 列表 * * @access  public * @param   int     $cat * @return …
dedecms是全静态的,有时会因为其他事情好几天没写文章推荐到首页,那样对se不是很友好.原本ytkah是想在网站首页上半部分调用几篇id从200到500的文章随机展示的,这样每次更新首页给se的赶脚像是有添加新的文章了,但测试了很久也没实现出来,在网上search了貌似也没找到相关的解决方案,哪位高手知道的麻烦告诉ytkah一下哈!用帝国cms建的站?参考帝国cms调用随机文章 支持一个id段内的调用 能力有限,只能求其次了,那就随机调用某个分类下的文章展示了,在当前模板index.htm添…
转: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…
打开 index.php 添加 fun函数一个,需放在<php与?>中间. /** * 获得指定栏目的文章列表. * @param int $cid 栏目ID * @param int $row 条数 * @return array */ function index_get_articles($cid = 0, $row = 10){ $ta = $GLOBALS['ecs']->table('article'); $tac = $GLOBALS['ecs']->table('a…