📄 setting.php
字号:
require_once PrintHack('home'); } else { InitGP(array('subject','content'),'P',1); $tid <= 0 && !$subject && Showmsg('colony_posterror'); strlen($subject)>50 && Showmsg('colony_subject'); !$content && Showmsg('colony_posterror'); $tid>0 && strlen($content)>255 && $content = substrs($content,255,'N'); require_once(R_P.'require/postfunc.php'); $content = autourl($content); $db->update("INSERT INTO pw_argument(tpcid,gid,author,authorid,postdate,lastpost,subject,content) VALUES('$tid','$cyid','".addslashes($windid)."','$winduid','$timestamp','$timestamp','$subject','$content')"); if ($tid) { $db->update("UPDATE pw_argument SET lastpost='$timestamp' WHERE tid='$tid'"); } else { $tid = $db->insert_id(); } refreshto("$basename&job=readboard&cyid=$cyid&tid=$tid",'colony_postsuccess'); }} elseif ($job=='editboard') { if ($_POST['step']!=2) { @extract($db->get_one("SELECT subject,content FROM pw_argument WHERE tid='$tid'")); !$subject && Showmsg('illegal_tid'); require_once PrintHack('home'); } else { InitGP(array('subject','content'),'P',1); (!$subject || !$content) && Showmsg('colony_posterror'); strlen($subject)>50 && Showmsg('colony_subject'); strlen($content)>255 && $content = substrs($content,255,'N'); require_once(R_P.'require/postfunc.php'); $content = autourl($content); $db->update("UPDATE pw_argument SET subject='$subject',content='$content' WHERE tid='$tid'"); refreshto("$basename&job=readboard&cyid=$cyid&tid=$tid",'colony_postsuccess'); }} elseif ($job=='delboard') { @extract($db->get_one("SELECT tpcid,gid,authorid FROM pw_argument WHERE tid='$tid'")); !$authorid && Showmsg('illegal_tid'); if ($cyid != $gid || ($authorid!=$winduid && !$admindb[$winduid] && $groupid!=3)) { Showmsg('colony_delright'); } $db->update("DELETE FROM pw_argument WHERE tid='$tid'"); if (!$tpcid) { $db->update("DELETE FROM pw_argument WHERE gid='$gid' AND tpcid='$tid'"); $refreshto = "$basename&job=boardlist&cyid=$gid"; } else { $refreshto = "$basename&job=readboard&cyid=$gid&tid=$tpcid"; } refreshto($refreshto,'colony_delsuccess');} elseif ($job=='readboard') { @extract($db->get_one("SELECT a.tpcid,a.gid,a.author,a.authorid,a.postdate,a.lastpost,a.subject,a.content,cm.ifadmin FROM pw_argument a LEFT JOIN pw_cmembers cm ON a.authorid=cm.uid WHERE a.tid='$tid'")); (!$subject || $cyid != $gid || $tpcid != 0) && Showmsg('illegal_tid'); require_once PrintHack('home'); $adminimg = $ifadmin==1 ? "<img src=\"$imgpath/$stylepath/group/3.gif\" align=\"absmiddle\"> " : "<img src=\"$imgpath/$stylepath/group/6.gif\" align=\"absmiddle\"> "; require_once(R_P.'require/bbscode.php'); $havereply = $postdate != $lastpost ? true : false; $postdate = get_date($postdate); $content = convert(nl2br($content),$db_windpost); $count = (int)$count; $readdb = array(); if ($havereply) { (int)$page < 1 && $page = 1; @extract($db->get_one("SELECT COUNT(*) AS count FROM pw_argument WHERE gid='$gid' AND tpcid='$tid'")); if ($count > $db_perpage) { require_once(R_P.'require/forum.php'); $pages = numofpage($count,$page,ceil($count/$db_perpage),"$basename&job=readboard&cyid=$gid&tid=$tid&"); } else { $page = 1; } $start_limit = ($page-1)*$db_perpage; $query = $db->query("SELECT DISTINCT a.tid,a.tpcid,a.gid,a.author,a.authorid,a.postdate,a.subject,a.content,cm.ifadmin FROM pw_argument a LEFT JOIN pw_cmembers cm ON a.authorid=cm.uid WHERE a.gid='$gid' AND a.tpcid='$tid' AND cm.colonyid='$gid' ORDER BY postdate DESC LIMIT $start_limit,$db_perpage"); while ($rt = $db->fetch_array($query)) { $start_limit++; $rt['lou'] = $start_limit; $rt['postdate'] = get_date($rt['postdate']); $rt['content'] = convert(nl2br($rt['content']),$db_windpost); $rt['adminimg'] = $rt['ifadmin']==1 ? "<img src=\"$imgpath/$stylepath/group/3.gif\" align=\"absmiddle\"> " : "<img src=\"$imgpath/$stylepath/group/6.gif\" align=\"absmiddle\"> "; $readdb[] = $rt; } $db->free_result($query); }} elseif ($job=='topboard'){ if(!$admindb[$winduid] && $groupid!=3){ Showmsg('colony_topright'); } $selids = ''; InitGP(array('selid'),'P',1); if (is_array($selid)) { foreach ($selid as $value) { if (is_numeric($value)) { $selids .= ($selids ? ',' : '')."'$value'"; } } } !$selids && Showmsg('selid_illegal'); $selids = strpos($selids,',')!==false ? "IN ($selids)" : "= $selids"; if($_POST['step'] != 2){ require_once PrintHack('home'); $query = $db->query("SELECT tid,author,authorid,lastpost,subject FROM pw_argument WHERE gid='$cyid' AND tpcid='0' AND tid $selids ORDER BY lastpost DESC"); while($rt = $db->fetch_array($query)){ $rt['lastpost'] = get_date($rt['lastpost']); $argudb[] = $rt; } }else{ InitGP(array('topped','toppedtime'),'P'); $toppedtime = (int)$toppedtime; $toppedtime && $toppedtime = $timestamp + 86400*$toppedtime; $db->update("UPDATE pw_argument SET topped='$topped',toppedtime='$toppedtime' WHERE tid $selids"); refreshto("$basename&cyid=$cyid&job=boardlist",'colony_topsuccess'); }} elseif ($job=='honor') { require_once PrintHack('home'); $honordb = $honor_order = array(); foreach ($memberdb as $key => $value) { $honor_order[$key] = (int)$value['honor']; } array_multisort($honor_order,SORT_DESC,$memberdb); $num = 0; foreach ($memberdb as $key => $value) { if ($num < 10 && $value['ifadmin']!=-1) { $num++; $value['order'] = $num; $honordb[$key] = $value; } } unset($memberdb);} elseif ($job=='donate') { $usermoney = UserCredit($winduid,$cn_moneytype); if ($_POST['step']!=2) { require_once PrintHack('home'); } else { $sendmoney = (int)GetGP('sendmoney','P'); $sendmoney < 1 && Showmsg('colony_donateerror'); $sendmoney > $usermoney && Showmsg('colony_donatefail'); $honor = $sendmoney*1;//荣誉点与金钱的比率 $lockfile = D_P.'data/bbscache/lock_bank.txt'; $fp = fopen($lockfile,'wb+'); flock($fp,LOCK_EX); if (in_array($cn_moneytype,array('money','rvrc','credit','currency'))) { $temprvrc = $cn_moneytype == 'rvrc' ? $sendmoney*10 : $sendmoney; $db->update("UPDATE pw_memberdata SET $cn_moneytype=$cn_moneytype-'$temprvrc' WHERE uid='$winduid'",0); } elseif (is_numeric($cn_moneytype) && isset($_CREDITDB[$cn_moneytype])) { $db->update("UPDATE pw_membercredit SET value=value-'$sendmoney' WHERE uid='$winduid' AND cid='$cn_moneytype'",0); } $db->update("UPDATE pw_colonys SET cmoney=cmoney+'$sendmoney' WHERE id='$cyid'"); $db->update("UPDATE pw_cmembers SET honor=honor+'$honor' WHERE uid='$winduid' AND colonyid='$cyid'"); fclose($fp); if ($cn_moneytype == 'currency') { require_once(R_P.'require/tool.php'); $logdata = array( 'type' => 'donate', 'nums' => 0, 'money' => 0, 'descrip' => 'donate_descrip', 'uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'time' => $timestamp, 'currency' => $sendmoney, 'cname' => $alldb['cname'] ); writetoollog($logdata); } $log = array( 'type' => 'cy_donate', 'username1' => Char_cv($windid), 'username2' => '', 'field1' => $sendmoney, 'field2' => $cyid, 'field3' => Char_cv($alldb['cname']), 'timestamp' => $timestamp, 'ip' => $onlineip, 'cname' => $alldb['cname'] ); require GetLang('log'); $log['descrip'] = Char_cv($lang['donate_descrip']); $db->update("INSERT INTO pw_forumlog (type,username1,username2,field1,field2,field3,descrip,timestamp,ip) VALUES('$log[type]','$log[username1]','$log[username2]','$log[field1]','$log[field2]','$log[field3]','$log[descrip]','$log[timestamp]','$log[ip]')"); require_once(R_P.'require/msg.php'); writenewmsg(array($alldb['admin'],$winduid,'donate_title',$timestamp,'donate_content','',$windid),1); Showmsg('colony_donatesuccess'); }} elseif ($job=='donatelog') { require_once PrintHack('home'); (int)$page < 1 && $page = 1; @extract($db->get_one("SELECT COUNT(*) AS count FROM pw_forumlog WHERE field2='$cyid' AND type='cy_donate'")); if ($count > $db_perpage) { require_once(R_P.'require/forum.php'); $pages = numofpage($count,$page,ceil($count/$db_perpage),"$basename&job=donatelog&cyid=$cyid&"); } else { $page = 1; } $logdb = array(); $query = $db->query("SELECT username1,descrip,timestamp FROM pw_forumlog WHERE field2='$cyid' AND type='cy_donate' ORDER BY id DESC LIMIT ".($page-1)*$db_perpage.",$db_perpage"); while ($rt = $db->fetch_array($query)) { $rt['timestamp'] = get_date($rt['timestamp'],"Y-m-d H:i"); $rt['descrip'] = str_replace(array('[b]','[/b]'),array('<b>','</b>'),$rt['descrip']); $logdb[] = $rt; } $db->free_result($query);}require_once PrintHack('setting');footer();?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -