<?php
/*
dsu_paulsign Main By shy9000[DSU.CC] 2011-07-23
*/
!defined('IN_DISCUZ') && exit('Access Denied');
define('IN_dsu_paulsign', '1');
$var = $_G['cache']['plugin']['dsu_paulsign'];
$tdtime = gmmktime(0,0,0,dgmdate($_G['timestamp'], 'n',$var['tos']),dgmdate($_G['timestamp'], 'j',$var['tos']),dgmdate($_G['timestamp'], 'Y',$var['tos'])) - $var['tos']*3600;
$htime = dgmdate($_G['timestamp'], 'H',$var['tos']);
loadcache('pluginlanguage_script');
$lang = $_G['cache']['pluginlanguage_script']['dsu_paulsign'];
$nlvtext =str_replace(array("\r\n", "\n", "\r"), '/hhf/', $var['lvtext']);
$nfastreplytext =str_replace(array("\r\n", "\n", "\r"), '/hhf/', $var['fastreplytext']);
$njlmain =str_replace(array("\r\n", "\n", "\r"), '/hhf/', $var['jlmain']);
list($lv1name, $lv2name, $lv3name, $lv4name, $lv5name, $lv6name, $lv7name, $lv8name, $lv9name, $lv10name, $lvmastername) = explode("/hhf/", $nlvtext);
list($var['fastreply1'], $var['fastreply2'], $var['fastreply3'], $var['fastreply4'], $var['fastreply5'], $var['fastreply6'], $var['fastreply7'], $var['fastreply8']) = explode("/hhf/", $nfastreplytext);
list($var['jlmain1'], $var['jlmain2'], $var['jlmain3'], $var['jlmain4'], $var['jlmain5'], $var['jlmain6'], $var['jlmain7'], $var['jlmain8'], $var['jlmain9'], $var['jlmain10']) = explode("/hhf/", $njlmain);
$jlxgroups = unserialize($var['jlxgroups']);
$groups = unserialize($var['groups']);
$plgroups = unserialize($var['plgroups']);
$plgroups2 = unserialize($var['plgroups']);
$plgroups = dimplode($plgroups);
$credit = mt_rand($var['mincredit'],$var['maxcredit']);
$read_ban = explode(",",$var['ban']);
$post = DB::fetch_first("SELECT posts FROM ".DB::table('common_member_count')." WHERE uid='$_G[uid]'");
$qiandaodb = DB::fetch_first("SELECT * FROM ".DB::table('dsu_paulsign')." WHERE uid='$_G[uid]'");
$stats = DB::fetch_first("SELECT * FROM ".DB::table('dsu_paulsignset')." WHERE id='1'");
$qddb = DB::fetch_first("SELECT time FROM ".DB::table('dsu_paulsign')." ORDER BY time DESC limit 0,1");
$lastmonth=dgmdate($qddb['time'], 'm',$var['tos']);
$nowmonth=dgmdate($_G['timestamp'], 'm',$var['tos']);
if($nowmonth!=$lastmonth){
DB::query("UPDATE ".DB::table('dsu_paulsign')." SET mdays=0 WHERE uid");
}
function sign_msg($msg, $treferer = '') {
global $_G;
if(defined('IN_MOBILE')) {
include template('dsu_paulsign:float');
dexit();
}else{
include template('dsu_paulsign:float');
dexit();
}
}
if(empty($_G['uid'])) showmessage('to_login', 'member.php?mod=logging&action=login', array(), array('showmsg' => true, 'login' => 1));
if(!$var['ifopen'] && $_G['adminid'] != 1) showmessage($var['plug_clsmsg'], 'index.php');
if($var['plopen'] && $plgroups) {
$query = DB::query("SELECT groupid, grouptitle FROM ".DB::table('common_usergroup')." WHERE groupid IN ($plgroups)");
$mccs = array();
while($mcc = DB::fetch($query)){
$mccs[] = $mcc;
}
}
if($_G['gp_operation'] == 'zong' || $_G['gp_operation'] == 'month' || $_G['gp_operation'] == '' || ($_G['gp_operation'] == 'zdyhz' && $var['plopen']) || ($_G['gp_operation'] == 'rewardlist' && $var['rewardlistopen'])) {
if($_G['gp_operation'] == 'month'){
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('dsu_paulsign')." WHERE mdays != 0");
$page = max(1, intval($_G['gp_page']));
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=dsu_paulsign:sign&operation={$_G[gp_operation]}");
} elseif($_G['gp_operation'] == 'zdyhz' || $_G['gp_operation'] == 'rewardlist'){
} elseif($_G['gp_operation'] == '' && $var['qddesc']){
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('dsu_paulsign')." WHERE time >= {$tdtime}");
$page = max(1, intval($_G['gp_page']));
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=dsu_paulsign:sign&operation={$_G[gp_operation]}");
} else {
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('dsu_paulsign')."");
$page = max(1, intval($_G['gp_page']));
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=dsu_paulsign:sign&operation={$_G[gp_operation]}");
}
if($_G['gp_operation'] == 'zong'){
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid ORDER BY q.days desc LIMIT $start_limit, 10";
} elseif ($_G['gp_operation'] == 'month') {
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid AND q.mdays != 0 ORDER BY q.mdays desc LIMIT $start_limit, 10";
} elseif($_G['gp_operation'] == 'zdyhz'){
if(in_array($_G['gp_qdgroupid'], $plgroups2)) {
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid AND m.groupid IN($_G[gp_qdgroupid])");
$page = max(1, intval($_G['gp_page']));
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=dsu_paulsign:sign&operation={$_G[gp_operation]}", 0);
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid AND m.groupid IN($_G[gp_qdgroupid]) ORDER BY q.time desc LIMIT $start_limit, 10";
} else {
$num = DB::result_first("SELECT COUNT(*) FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid AND m.groupid IN($plgroups)");
$page = max(1, intval($_G['gp_page']));
$start_limit = ($page - 1) * 10;
$multipage = multi($num, 10, $page, "plugin.php?id=dsu_paulsign:sign&operation={$_G[gp_operation]}", 0);
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid AND m.groupid IN($plgroups) ORDER BY q.time desc LIMIT $start_limit, 10";
}
} elseif ($var['rewardlistopen'] && $_G['gp_operation'] == 'rewardlist') {
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,q.reward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid ORDER BY q.reward desc LIMIT 0, 10";
} elseif ($_G['gp_operation'] == '') {
if($var['qddesc']) {
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid and q.time >= {$tdtime} ORDER BY q.time LIMIT $start_limit, 10";
} else {
$sql = "SELECT q.days,q.mdays,q.time,q.qdxq,q.uid,q.todaysay,q.lastreward,m.username FROM ".DB::table('dsu_paulsign')." q, ".DB::table('common_member')." m WHERE q.uid=m.uid ORDER BY q.time desc LIMIT $start_limit, 10";
}
}
$query = DB::query($sql);
$mrcs = array();
while($mrc = DB::fetch($query)) {
$mrc['if']= $mrc['time']<$tdtime ? "<span class=gray>".$lang['tdno']."</span>" : "<font color=green>".$lang['tdyq']."</font>";
$mrc['time'] = dgmdate($mrc['time'], 'Y-m-d H:i');
!$qd['qdxq'] && $qd['qdxq']='kx';
if ($mrc['days'] >= '1500') {
$mrc['level'] = "[LV.Master]{$lvmastername}";
} elseif ($mrc['days'] >= '750') {
$mrc['level'] = "[LV.10]{$lv10name}";
} elseif ($mrc['days'] >= '365') {
$mrc['level'] = "[LV.9]{$lv9name}";
} elseif ($mrc['days'] >= '240') {
$mrc['level'] = "[LV.8]{$lv10name}";
} elseif ($mrc['days'] >= '120') {
$mrc['level'] = "[LV.7]{$lv7name}";
} elseif ($mrc['days'] >= '60') {
$mrc['level'] = "[LV.6]{$lv6name}";
} elseif ($mrc['days'] >= '30') {
$mrc['level'] = "[LV.5]{$lv5name}";
} elseif ($mrc['days'] >= '15') {
$mrc['level'] = "[LV.4]{$lv4name}";
} elseif ($mrc['days'] >= '7') {
$mrc['level'] = "[LV.3]{$lv3name}";
} elseif ($mrc['days'] >= '3') {
$mrc['level'] = "[LV.2]{$lv2name}";
- 1
- 2
- 3
前往页