前天晚上群里有个哥们要我站上的这个效果 ,我现在发个帖子告诉大家 。
1、打开文件/include/cache_func.php,找到- // 热门商铺
- $shops_top = $db->get_all("SELECT sid,shopname,subname,reviews FROM {$dbpre}shops ORDER BY reviews DESC LIMIT 10");
- $contents .= "\$_shops_top = array(\r\n";
- $i = 1;
- if($shops_top) foreach($shops_top as $shop) {
- $shop['shopname'] .= $shop['subname'] ? "({$shop['subname']})" : '';
- $contents .= "\t'$i' =>\r\n".
- "\tarray ( \r\n".
- "\t\t'sid' => '".$shop['sid']."',\r\n".
- "\t\t'shopname' => '".add_cs_lashes(utf_substr($shop['shopname'],24))."',\r\n".
- "\t\t'reviews' => '".@intval($shop['reviews'])."',\r\n".
- "\t),\r\n";
- $i++;
- }
- $contents .= ");\r\n\r\n";
复制代码 仿照这段代码写 。 在下边加上:- $shops_toq = $db->get_all("SELECT sid,shopname,subname,reviews FROM {$dbpre}shops ORDER BY reviews DESC LIMIT 10,10");
- $contents .= "\$_shops_toq = array(\r\n";
- $i = 1;
- if($shops_toq) foreach($shops_toq as $shoq) {
- $shoq['shopname'] .= $shoq['subname'] ? "({$shoq['subname']})" : '';
- $contents .= "\t'$i' =>\r\n".
- "\tarray ( \r\n".
- "\t\t'sid' => '".$shoq['sid']."',\r\n".
- "\t\t'shopname' => '".add_cs_lashes(utf_substr($shoq['shopname'],24))."',\r\n".
- "\t\t'reviews' => '".@intval($shoq['reviews'])."',\r\n".
- "\t),\r\n";
- $i++;
- }
- $contents .= ");\r\n\r\n";
复制代码 注意:add_cs_lashes(utf_substr($shop['shopname'],24)) ----限制字数的
2、打开文件/templets/default/mudder.htm,找到- <h1>热门商铺</h1>
- <div id="leftsj">
- <ul class="toplist">
- <!--{if $_shops_top}-->
- <!--{loop $_shops_top $shop}-->
- <li><a href="shop.php?shopid=$shop[sid]">$shop[shopname]</a></li>
- <!--{/loop}-->
- <!--{else}-->
- <li>暂时没有</li>
- <!--{/if}-->
- </ul></div>
复制代码 也是仿照这个写,在下边加上:- <div id="rightsj">
- <ul class="toplist">
- <!--{if $_shops_toq}-->
- <!--{loop $_shops_toq $shoq}-->
- <li><a href="shop.php?shopid=$shoq[sid]">$shoq[shopname]</a></li>
- <!--{/loop}-->
- <!--{/if}-->
- </ul></div>
复制代码 3、打开/templates/default/style.css,加上- #leftsj {
- width:50%; height:auto; float:left;
- }
- #rightsj {
- width:50%; height:auto; float:right;
- }
复制代码 修改完后更新缓存就可以了 。。。 |
你可能感兴趣的内容:
首页 在商铺列表调用出商铺的“简介” 之简单教程
请问在首页热门商铺如何能显示浏览量或点评最多的商铺
首页_热门商铺的问题
首页最新。热门,和推荐商铺问题
首页热门商铺调用名称的字数如何控制?已解决