前天晚上群里有个哥们要我站上的这个效果 ,我现在发个帖子告诉大家 。
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;
}修改完后更新缓存就可以了 。。。