一 查看效果:
二修改方法如下:
1 把library/index_ad.lbi 里代碼替換成以下代碼
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<script type="text/javascript" src="http://www.mfwine.cn/themes/Genuine/myFocus/myfocus-2.0.1.min.js"></script>
<script type="text/javascript">
//設(shè)置
myFocus.set({
id:'myFocus',//ID
pattern:'mF_pconline',//風(fēng)格
time:5//切換時(shí)間間隔(秒)
});
</script>
<div id="myFocus"><!--焦點(diǎn)圖盒子-->
<div class="loading"><img src="themes/Genuine/myFocus/loading.gif" alt="請稍候..." /></div><!--載入畫面(可刪除)-->
<div class="pic"><!--圖片列表-->
<ul>
<!--{foreach from=$index_adlist item=ads}-->
<li><a target="_blank" href="{$ads.url}"><img src="{$ads.content}" alt="{$ads.ad_name}" /></a></li><!--{/foreach}-->
</ul>
</div>
</div>
2 修改index.php
在“?>”前加上以下代碼:
function get_index_ad(){
$sql = 'SELECT ad_type,content,ad_name,url,orderid FROM ' . $GLOBALS['ecs']->table("ad_custom") .'ORDER BY orderid ASC' ;
$res = $GLOBALS['db']->getAll($sql);
$ads = array();
foreach ($res AS $adx => $row)
{
$ads[$adx]['ad_type'] = $row['ad_type'];
$ads[$adx]['content'] = $row['content'];
$ads[$adx]['url'] = $row['url'];
$ads[$adx]['ad_name'] = $row['ad_name'];
}
return $ads;
}
在這段代碼后
$smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告
加入
$smarty->assign('index_adlist', get_index_ad());
3 在“ecs_ad_custom”表下增加一個(gè)字段“orderid”
4 修改admin/flashplay.php
5 修改后臺模板 admin/templates 下的三個(gè)文件
flashplay_custom.htm
flashplay_custom_add.htm
flashplay_ccustom_edit.htm
4與5下載地址:http://www.yimostudio.com/mf.zip
本摘自:028工作室
掃描二維碼分享到微信