📄 modproc.php
字号:
<?php
/**
*
* @package wappyCULT: wap community script
* @version 1.00 2006/09/12 21:53:27 wappy
* @copyright (c) 2004-2006 wappyCULT
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
*/
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");
connectdb();
$action = $_GET["action"];
$sid = $_GET["sid"];
if(!ismod(getuid_sid($sid)))
{
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
echo "You are not a mod<br/>";
echo "<br/>";
echo "<a href=\"index.php\">Home</a>";
echo "</p>";
echo "</card>";
}
if(islogged($sid)==false)
{
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
echo "You are not logged in<br/>";
echo "Or Your session has been expired<br/><br/>";
echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</card>";
}
addonline(getuid_sid($sid),"Mod CP","");
if($action=="delp")
{
$pid = $_GET["pid"];
$tid = gettid_pid($pid);
$fid = getfid_tid($tid);
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("DELETE FROM ibwf_posts WHERE id='".$pid."'");
if($res)
{
$tname = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_topics WHERE id='".$tid."'"));
mysql_query("INSERT INTO ibwf_mlog SET action='posts', details='<b>".getnick_uid(getuid_sid($sid))."</b> Deleted Post Number $pid Of the thread ".mysql_escape_string($tname[0])." at the forum ".getfname($fid)."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Post Message Deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid&page=1000\">";
echo "View Topic</a><br/>";
$fname = getfname($fid);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
////////////////////////////////////////////Edit Post
else if($action=="edtpst")
{
$pid = $_GET["pid"];
$ptext = $_POST["ptext"];
$tid = gettid_pid($pid);
$fid = getfid_tid($tid);
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_posts SET text='"
.$ptext."' WHERE id='".$pid."'");
if($res)
{
$tname = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_topics WHERE id='".$tid."'"));
mysql_query("INSERT INTO ibwf_mlog SET action='posts', details='<b>".getnick_uid(getuid_sid($sid))."</b> Edited Post Number $pid Of the thread ".mysql_escape_string($tname[0])." at the forum ".getfname($fid)."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Post Message Edited";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">";
echo "View Topic</a><br/>";
$fname = getfname($fid);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
////////////////////////////////////////////Edit Post
else if($action=="edttpc")
{
$tid = $_GET["tid"];
$ttext = $_POST["ttext"];
$fid = getfid_tid($tid);
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_topics SET text='"
.$ttext."' WHERE id='".$tid."'");
if($res)
{
mysql_query("INSERT INTO ibwf_mlog SET action='topics', details='<b>".getnick_uid(getuid_sid($sid))."</b> Edited the text Of the thread ".mysql_escape_string(gettname($tid))." at the forum ".getfname($fid)."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Topic Message Edited";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">";
echo "View Topic</a><br/>";
$fname = getfname($fid);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Close/ Open Topic
else if($action=="clot")
{
$tid = $_GET["tid"];
$tdo = $_GET["tdo"];
$fid = getfid_tid($tid);
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_topics SET closed='"
.$tdo."' WHERE id='".$tid."'");
if($res)
{
if($tdo==1)
{
$msg = "Closed";
}else{
$msg = "Opened";
}
mysql_query("INSERT INTO ibwf_mlog SET action='topics', details='<b>".getnick_uid(getuid_sid($sid))."</b> Closed The thread ".mysql_escape_string(gettname($tid))." at the forum ".getfname($fid)."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Topic $msg";
$tpci = mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'"));
$tname = htmlspecialchars($tpci[0]);
$msg = "your thread [topic=$tid]$tname"."[/topic] is $msg"."[br/][small][i]p.s: this is an automatic pm[/i][/small]";
autopm($msg, $tpci[1]);
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
$fname = getfname($fid);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "$fname</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Untrash user
else if($action=="untr")
{
$who = $_GET["who"];
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("DELETE FROM ibwf_penalties WHERE penalty='0' AND uid='".$who."'");
if($res)
{
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> Untrashed The user <b>".$unick."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick Untrashed";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Unban user
else if($action=="unbn")
{
$who = $_GET["who"];
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("DELETE FROM ibwf_penalties WHERE (penalty='1' OR penalty='2') AND uid='".$who."'");
if($res)
{
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> Unbanned The user <b>".$unick."</b>', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick Unbanned";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Delete shout
else if($action=="delsh")
{
$shid = $_GET["shid"];
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$sht = mysql_fetch_array(mysql_query("SELECT shouter, shout FROM ibwf_shouts WHERE id='".$shid."'"));
$msg = getnick_uid($sht[0]);
$msg .= ": ".htmlspecialchars((strlen($sht[1])<20?$sht[1]:substr($sht[1], 0, 20)));
$res = mysql_query("DELETE FROM ibwf_shouts WHERE id ='".$shid."'");
if($res)
{
mysql_query("INSERT INTO ibwf_mlog SET action='shouts', details='<b>".getnick_uid(getuid_sid($sid))."</b> Deleted the shout <b>".$shid."</b> - $msg', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Unban user
else if($action=="shld")
{
$who = $_GET["who"];
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("Update ibwf_users SET shield='1' WHERE id='".$who."'");
if($res)
{
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> Shielded The user <b>".$unick."</b>', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick is Shielded";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Unban user
else if($action=="ushld")
{
$who = $_GET["who"];
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$res = mysql_query("Update ibwf_users SET shield='0' WHERE id='".$who."'");
if($res)
{
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> Unshielded The user <b>".$unick."</b>', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick is Unshielded";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
///////////////////////////////////////Pin/ Unpin Topic
else if($action=="pint")
{
$tid = $_GET["tid"];
$tdo = $_GET["tdo"];
$fid = getfid_tid($tid);
echo "<card id=\"main\" title=\"Mod CP\">";
echo "<p align=\"center\">";
$pnd = getpinned($fid);
if($pnd<=5)
{
$res = mysql_query("UPDATE ibwf_topics SET pinned='"
.$tdo."' WHERE id='".$tid."'");
if($res)
{
if($tdo==1)
{
$msg = "Pinned";
}else{
$msg = "Unpinned";
}
mysql_query("INSERT INTO ibwf_mlog SET action='topics', details='<b>".getnick_uid(getuid_sid($sid))."</b> $msg The thread ".mysql_escape_string(gettname($tid))." at the forum ".getfname($fid)."', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Topic $msg";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You can only pin 5 topics in every forum";
}
echo "<br/><br/>";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -