Discuz!插件 插件名称 discuz6 UTF8版本的有奖竞猜插件增强版 适用版本 Discuz! 6.0 语言编码 UTF8 插件作者 xiaochong0302 版权所属 xiaochong0302 支持网站 http://www.rnjyz.com 插件简介 DZ6 UTF8版本的有奖竞猜插件 本帖最后由 ndfster 于 2010-6-14 15:37 编辑 先感谢原作者的辛苦劳动.插件使用方法: 1.请把guess.php放置于根目录下 2.请把解压后的templates/default目录下的模板文件放置于论坛templates/default目录下 3.请把plugins/guess文件夹拷贝到plugins目录下 4.后台插件管理中导入discuz_plugin_guess.txt的内容 5.请执行guess.sql升级数据库 使用后感觉不错,作为世界杯的有奖竞猜安装上了,演示见:http://www.rnjyz.com 由于中奖后没有短信提醒,所以增加了短信提醒功能:修改方法如下: 找到文件:\plugins\guess\admin.inc.php,搜索 $querygameinfo = $db->query("SELECT hostodd,guestodd,drawodd FROM {$tablepre}gameinfo WHERE gameid = '$gameid' LIMIT 1"); 复制代码 这行,替换为: $querygameinfo = $db->query("SELECT * FROM {$tablepre}gameinfo WHERE gameid = '$gameid' LIMIT 1"); 复制代码 在//查詢競猜結果之前插入: //赛事信息 $league_info = array(); $leagueid2=$gameinfo['leagueid']; $league_query_sql='SELECT * FROM '.$tablepre.'league where leagueid= '.$leagueid2; $league_query = $db->query($league_query_sql); while($league_data = $db->fetch_array($league_query)) { $league_info = $league_data; } //主队信息 $hostteam_info = array(); $hostteamid2=$gameinfo['hostteam']; $hostteam_query = $db->query("SELECT * FROM {$tablepre}team where teamid= '$hostteamid2'"); while($hostteam_data = $db->fetch_array($hostteam_query)) { $hostteam_info = $hostteam_data; } //客队信息 $guestteam_info = array(); $guestteamid2=$gameinfo['guestteam']; $guestteam_query = $db->query("SELECT * FROM {$tablepre}team where teamid= '$guestteamid2'"); while($guestteam_data = $db->fetch_array($guestteam_query)) { $guestteam_info = $guestteam_data; } 复制代码 在$db->query("UPDATE {$tablepre}members SET $moneycredits = $moneycredits + $sendmoneycredits WHERE uid = '$result[uid]'");下面插入 //短信提示 $the_subject='[竞猜获奖公告]'.$league_info['leaguename'].'- '.$hostteam_info['teamname'].' VS '.$guestteam_info['teamname']; $the_dateline=time(); $the_begintime=date("Y-m-d H:i",$gameinfo['begintime']); $the_message='[对阵双方]: '.$hostteam_info['teamname'].' VS '.$guestteam_info['teamname'].' [比赛时间]: '.$the_begintime.' [比赛结果]: '.$hostgoal.':'.$guestgoal.' [奖励金币]: '.$sendmoneycredits.' [详细查询]: http://www.rnjyz.com/guess.php?mode=basic&action=reward_query&gameid='.$gameinfo['gameid'].' ' ; $db->query("INSERT INTO {$tablepre}pms(msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,message,delstatus) values('$discuz_userss','$discuz_uid','$result[uid]','inbox','1','$the_subject','$the_dateline','$the_message','0')"); 复制代码 ps:本插件适合DISCUZ6.0,UTF8版本,其他版本稍作修改也可以使用 下载地址:http://www.discuz.net/thread-1780440-1-1.html