📄 genproc.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"];
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
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>";
echo "</wml>";
exit();
}
if($action=="newtopic")
{
$fid = $_POST["fid"];
$ntitle = $_POST["ntitle"];
$tpctxt = $_POST["tpctxt"];
if(!canaccess(getuid_sid($sid), $fid))
{
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
addonline(getuid_sid($sid),"Created New Topic","");
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
$crdate = time();
//$uid = getuid_sid($sid);
$texst = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE name LIKE '".$ntitle."' AND fid='".$fid."'"));
if($texst[0]==0)
{
$res = false;
$ltopic = mysql_fetch_array(mysql_query("SELECT crdate FROM ibwf_topics WHERE authorid='".$uid."' ORDER BY crdate DESC LIMIT 1"));
global $topic_af;
$antiflood = time()-$ltopic[0];
if($antiflood>$topic_af)
{
if((trim($ntitle)!="")||(trim($tpctxt)!=""))
{
$res = mysql_query("INSERT INTO ibwf_topics SET name='".$ntitle."', fid='".$fid."', authorid='".$uid."', text='".$tpctxt."', crdate='".$crdate."', lastpost='".$crdate."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
$tnm = htmlspecialchars($ntitle);
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Topic <b>$tnm</b> Created Successfully";
$tid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_topics WHERE name='".$ntitle."' AND fid='".$fid."'"));
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid[0]\">";
echo "View Topic</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Creating New Thread";
}
}else{
$af = $topic_af -$antiflood;
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Topic Name already Exist";
}
$fname = getfname($fid);
echo "<br/><br/><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>";
echo "</card>";
}
else if($action=="post")
{
$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Posted A reply","");
echo "<card id=\"main\" title=\"wappyCULT\">";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
//$uid = getuid_sid($sid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">";
echo "View Topic</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$fname = getfname($fid);
echo "<br/><br/><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>";
echo "</card>";
}
else if ($action=="uadd")
{
$ucon = $_POST["ucon"];
$ucit = $_POST["ucit"];
$ustr = $_POST["ustr"];
$utzn = $_POST["utzn"];
$uphn = $_POST["uphn"];
addonline(getuid_sid($sid),"My Address","");
echo "<card id=\"main\" title=\"My Address\">";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
if($exs[0]>0)
{
$res = mysql_query("UPDATE ibwf_xinfo SET country='".$ucon."', city='".$ucit."', street='".$ustr."', timezone='".$utzn."', phoneno='".$uphn."' WHERE uid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Address Updated Successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
}
}else{
$res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', country='".$ucon."', city='".$ucit."', street='".$ustr."', timezone='".$utzn."', phoneno='".$uphn."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Address Updated Successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
}
}
echo "<a href=\"index.php?action=uxset&sid=$sid\">";
echo "Extended Settings</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="gcp")
{
$clid = $_GET["clid"];
$who = $_GET["who"];
$giv = $_POST["giv"];
$pnt = $_POST["pnt"];
addonline(getuid_sid($sid),"Moderating Club Member","");
echo "<card id=\"main\" title=\"Moderate Member\">";
echo "<p align=\"center\">";
$whnick = getnick_uid($who);
echo "<b>$whnick</b>";
echo "</p>";
echo "<p>";
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$who."' AND clid=".$clid.""));
$cow = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."' AND id=".$clid.""));
if($exs[0]>0 && $cow[0]>0)
{
$mpt = mysql_fetch_array(mysql_query("SELECT points FROM ibwf_clubmembers WHERE uid='".$who."' AND clid='".$clid."'"));
if($giv=="1")
{
$pnt = $mpt[0]+$pnt;
}else{
$pnt = $mpt[0]-$pnt;
if($pnt<0)$pnt=0;
}
$res = mysql_query("UPDATE ibwf_clubmembers SET points='".$pnt."' WHERE uid='".$who."' AND clid='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Club points updated successfully!";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Missing Info!";
}
echo "</p>";
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="gpl")
{
$clid = $_GET["clid"];
$who = $_GET["who"];
$pnt = $_POST["pnt"];
addonline(getuid_sid($sid),"Moderating Club Member","");
echo "<card id=\"main\" title=\"Moderate Member\">";
echo "<p align=\"center\">";
$whnick = getnick_uid($who);
echo "<b>$whnick</b>";
echo "</p>";
echo "<p>";
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Because people misused the plusses thing, clubs owners cant give plusses anymore";
echo "</p>";
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if ($action=="upre")
{
$usds = $_POST["usds"];
$usds = str_replace('"', "", $usds);
$usds = str_replace("'", "", $usds);
$ubon = $_POST["ubon"];
$usxp = $_POST["usxp"];
addonline(getuid_sid($sid),"Preferences","");
echo "<card id=\"main\" title=\"Preferences\">";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
if($exs[0]>0)
{
$res = mysql_query("UPDATE ibwf_xinfo SET sitedscr='".$usds."', budsonly='".$ubon."', sexpre='".$usxp."' WHERE uid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Preferences Updated Successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
}
}else{
$res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', sitedscr='".$usds."', budsonly='".$ubon."', sexpre='".$usxp."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Preferences Updated Successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
}
}
echo "<a href=\"index.php?action=uxset&sid=$sid\">";
echo "Extended Settings</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if ($action=="gmset")
{
$ugun = $_POST["ugun"];
$ugpw = $_POST["ugpw"];
$ugch = $_POST["ugch"];
addonline(getuid_sid($sid),"G-Mail Settings","");
echo "<card id=\"main\" title=\"G-Mail Settings\">";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_xinfo WHERE uid='".$uid."'"));
if($exs[0]>0)
{
$res = mysql_query("UPDATE ibwf_xinfo SET gmailun='".$ugun."', gmailpw='".$ugpw."', gmailchk='".$ugch."', gmaillch='".time()."' WHERE uid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Gmail Settings Updated Successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"O\"/>Database Error!<br/><br/>";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -