[插件]首頁滾動最新足球博彩賽事
適用版本﹕Discuz﹗ 2.5
作者﹕sun@hkcser
技術支持﹕本貼
修改模版﹕index.htm
安裝難易﹕一般
安裝條件﹕必須已安裝足球博彩插件
本插件是使用緩存
第一次安裝後請到後台更新緩存,以後在加入比賽或結果時會自動更新
修改cache.php
在
'index' => array('announcements','onlinelist', 'forumlinks'
後加入
在
case ranks:
$table = $GLOBALS['table_ranks'];
$cols='ranktitle,postshigher,stars';
$conditions = "WHERE 1 ORDER BY postshigher desc";
break;
後加入
case newmatchs:
$table = $GLOBALS['table_z_cup_game'];
$cols='id,hteam,vteam,gamedate';
$conditions = "Where ending=0 ORDER BY addtime";
break;
修改index.php
在
unset($_DCACHE['announcements']);
後加入
$newmatchs = '';
if($_DCACHE['newmatchs']) {
$space = '';
foreach($_DCACHE['newmatchs'] as $newmatch) {
$newmatchs .= $space.'<a href="z_game.php?gameid='.$newmatch['id'].'" target="_blank">'.$newmatch['hteam'].'<span class="bold"> VS </span>'.$newmatch['vteam'].' '.$newmatch['gamedate'].'</a>';
$space = ' ';
}
}
unset($_DCACHE['newmatchs']);
修改templates/default/index.htm
在
<!--{if empty($gid) && $whosonlinestatus}-->
前加入
<!--{if empty($gid)}-->
<tr class="header"><td colspan="6" align=left>最新下注球賽</td></tr>
<tr bgcolor="{ALTBG2}" align="center">
<td align="center" colspan="6">
<!--{if empty($newmatchs)}-->
現在還沒有比賽可以下注。
<!--{else}-->
<marquee direction="left" scrollamount="3" onMouseOver="this.stop();" onMouseOut="this.start();">
$newmatchs
</marquee>
<!--{/if}-->
</td></tr>
<!--{/if}-->
修改z_addgame.php
在
require './include/common.php';
後加入
require './include/cache.php';
在
showmessage("新的比賽已成功加入", "z_addgame.php");
前加入
updatecache('newmatchs');
修改z_addending.php
require './include/common.php';
後加入
require './include/cache.php';
在
showmessage("比賽已公佈及派彩", "z_addending.php");
前加入
updatecache('newmatchs');