<?php
include("core.php");
include("config.php");
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
$addy = "wapirate.net";
$bcon = connectdb();
if (!$bcon)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "<img src=\"images/error.gif\" alt=\"*\"/><br/>";
echo "ERROR! cannot connect to database<br/><br/>";
echo "This error usually happens when backing up the database, please be patient, The site will be up as soon as possible<br/><br/>";
echo "<b>THANK YOU VERY MUCH</b>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
$brws = $_SERVER['HTTP_USER_AGENT'];
$ubr = $brws;
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];
$pmtext = $_POST["pmtext"];
$uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
cleardata();
if(isipbanned($uip,$ubr))
{
if(!isshield(getuid_sid($sid)))
{
echo "<head>";
echo "<title>Ip Block!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
echo "This IP address is blocked<br/>";
echo "<br/>";
echo "However we grant a shield against IP-Ban for our best users, you can try to see if you are shielded by trying to login, if you keep coming to this page that means you are not shielded, so come back when the ip-ban period is over<br/><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
//echo mysql_error();
$remain = $banto[0] - time();
$rmsg = gettimemsg($remain);
echo " IP: $rmsg<br/><br/>";
echo "</p>";
echo "<form action=\"login.php\" method=\"get\">";
echo "username:<br/> <input name=\"loguid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";
echo "password:<br/> <input type=\"password\" name=\"logpwd\" size=\"8\" maxlength=\"30\"/><br/>";
echo "<input type=\"submit\" value=\"login »\"/>";
echo "</form>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
}
if(($action != "") && ($action!="terms"))
{
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
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 "</body>";
echo "</html>";
exit();
}
}
//echo isbanned($uid);
if(isbanned($uid))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
echo "You are <b>Banned</b><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "Time to finish your penalty: $rmsg<br/><br/>";
echo "Ban Reason: $banres[0]";
//echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
//////////////////////////////////////////////////////////////////////////////////////////////////////
if($action=="newtopic")
{
$fid = $_POST["fid"];
$ntitle = $_POST["ntitle"];
$tpctxt = $_POST["tpctxt"];
if(!canaccess(getuid_sid($sid), $fid))
{
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "You Don't Have Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
addonline(getuid_sid($sid),"Created New Topic","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Create New Topic<br/></div>";
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 "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////
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 "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "You Don't Have Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Posted A reply","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Post Reply<br/></div>";
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 "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////
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 "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>My Address<br/></div>";
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 "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////MODERATING CLUB MEMBER
else if($action=="gcp")
{
$clid = $_GET["clid"];
$who = $_GET["who"];
$giv = $_POST["giv"];
$pnt = $_POST["pnt"];
addonline(getuid_sid($sid),"Moderating Club Member","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$whnick = getnick_uid($who);
echo "<div><br/>$whnick's Club Points<br/></div>";
echo "<p align=\"center\">";
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||coowner='".$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 "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////
else if($action=="gpl")
{
$clid = $_GET["clid"];
$who = $_GET["who"];
$pnt = $_POST["pnt"];
addonline(getuid_sid($sid),"Moderating Club Member","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$whnick = getnick_uid($who);
echo "<div><br/>Give $whnick Gold<br/></div>";
echo "<p align=\"center\">";
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||coowner='".$uid."' AND id=".$clid.""));
if($exs[0]>0 && $cow[0]>0)
{
$cpl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_clubs WHERE id='".$clid."'"));
if($cpl[0]>=$pnt)
{
$mpt = mysql_fetch_array(mysql_query("SELECT gold FROM ibwf_users WHERE id='".$who."'"));
$plt = $mpt[0]+$pnt;
$res = mysql_query("UPDATE ibwf_users SET gold='".$plt."' WHERE id='".$who."'");
if($res)
{
$cpl = $cpl[0]-$pnt;
$res = mysql_query("UPDATE ibwf_clubs SET plusses='".$cpl."' WHERE id='".$clid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Gold updated successfully!";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!";
}
}
else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Not enough Gold!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Missing Info!";
}
echo "</p>";
echo "<p align=\"center\">";
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////
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 "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Preferences<br/></div>";
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 "<div>$addy</div>";
echo "</body>";
exit();
}
////////////////////////////
else if ($action=="uper")
{
$uhig = $_POST["uhig"];
$uwgt = $_POST["uwgt"];
$urln = $_POST["urln"];
$ueor = $_POST["ueor"];
$ueys = $_POST["ueys"];
$uher = $_POST["uher"];
$upro = $_POST["upro"];
addonline(getuid_sid($sid),"Personality","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Personality<br/></div>";
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 height='".$uhig."', weight='".$uwgt."', realname='".$urln."', eyescolor='".$ueys."', profession='".$upro."', racerel='".$ueor."',hairtype='".$uher."' WHERE uid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Personal Info 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."', height='".$uhig."', weight='".$uwgt."', realname='".$urln."', eyescolor='".$ueys."', profession='".$upro."', racerel='".$ueor."',hairtype='".$uher."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Personal Info 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 "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////////////////////
else if ($action=="umin")
{
$ulik = $_POST["ulik"];
$ulik = str_replace('"', "", $ulik);
$ulik = str_replace("'", "", $ulik);
$udlk = $_POST["udlk"];
$udlk = str_replace('"', "", $udlk);
$udlk = str_replace("'", "", $udlk);
$ubht = $_POST["ubht"];
$ubht = str_replace('"', "", $ubht);
$ubht = str_replace("'", "", $ubht);
$ught = $_POST["ught"];
$ught = str_replace('"', "", $ught);
$ught = str_replace("'", "", $ught);
$ufsp = $_POST["ufsp"];
$ufsp = str_replace('"', "", $ufsp);
$ufsp = str_replace("'", "", $ufsp);
$ufmc = $_POST["ufmc"];
$ufmc = str_replace('"', "", $ufmc);
$ufmc = str_replace("'", "", $ufmc);
$umtx = $_POST["umtx"];
$umtx = str_replace('"', "", $umtx);
$umtx = str_replace("'", "", $umtx);
addonline(getuid_sid($sid),"More about me","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>More about me<br/></div>";
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 likes='".$ulik."', deslikes='".$udlk."', habitsb='".$ubht."', habitsg='".$ught."', favsport='".$ufsp."', favmusic='".$ufmc."',moretext='".$umtx."' WHERE uid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Info 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."', likes='".$ulik."', deslikes='".$udlk."', habitsb='".$ubht."', habitsg='".$ught."', favsport='".$ufsp."', favmusic='".$ufmc."',moretext='".$umtx."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Info 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 "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////////
else if($action=="mkroom")
{
$rname = mysql_escape_string($_POST["rname"]);
$rpass = trim($_POST["rpass"]);
addonline(getuid_sid($sid),"Creating Chatroom","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Make Chat Room<br/></div>";
echo "<p align=\"center\">";
if ($rpass=="")
{
$cns = 1;
}else{
$cns = 0;
}
$prooms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE static='0'"));
if($prooms[0]<10)
{
$res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Room created successfully<br/><br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!<br/><br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>There's already 10 users rooms<br/><br/>";
}
echo "<a href=\"index.php?action=uchat&sid=$sid\"><img src=\"images/chat.gif\" alt=\"*\"/>Chatrooms</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////
else if($action=="signgb")
{
$who = $_POST["who"];
if(!cansigngb(getuid_sid($sid), $who))
{
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "You cant Sign this user guestbook<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
//////////////////////////////////////////////////////////////
$msgtxt = $_POST["msgtxt"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Signing a guestbook","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Sign Guestbook<br/></div>";
echo "<p align=\"center\">";
$crdate = time();
//$uid = getuid_sid($sid);
$res = false;
if(trim($msgtxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_gbook SET gbowner='".$who."', gbsigner='".$uid."', dtime='".$crdate."', gbmsg='".$msgtxt."'");
}
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////
else if($action=="votepl")
{
//$uid = getuid_sid($sid);
$plid = $_GET["plid"];
$ans = $_GET["ans"];
addonline(getuid_sid($sid),"Pole Volting lol","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Pole Volting lol<br/></div>";
echo "<p align=\"center\">";
$voted = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$uid."' AND pid='".$plid."'"));
if($voted[0]==0)
{
$res = mysql_query("INSERT INTO ibwf_presults SET uid='".$uid."', pid='".$plid."', ans='".$ans."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Thanks for voting";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You already voted for this poll";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////
else if($action=="dlpoll")
{
//$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Deleting Poll","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Poll<br/></div>";
echo "<p align=\"center\">";
$pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
$res = mysql_query("UPDATE ibwf_users SET pollid='0' WHERE id='".$uid."'");
if($res)
{
$res = mysql_query("DELETE FROM ibwf_presults WHERE pid='".$pid[0]."'");
$res = mysql_query("DELETE FROM ibwf_pp_pres WHERE pid='".$pid[0]."'");
$res = mysql_query("DELETE FROM ibwf_polls WHERE id='".$pid[0]."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Poll Deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////DELETE ANOUNCEMENT
else if($action=="delan")
{
//$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Deleting Announcement","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$clid = $_GET["clid"];
$anid = $_GET["anid"];
$uid = getuid_sid($sid);
echo "<div><br/>Delete Announcement<br/></div>";
echo "<p align=\"center\">";
$pid = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_announcements WHERE id='".$anid."' AND clid='".$clid."'"));
if(($uid==$pid[0]||$pid[1])&&($exs[0]>0))
{
$res = mysql_query("DELETE FROM ibwf_announcements WHERE id='".$anid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Announcement Deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't delete this announcement!";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
else if($action=="dlcl")
{
//$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Deleting Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$clid = $_GET["clid"];
$uid = getuid_sid($sid);
echo "<p align=\"center\">";
echo "<div><br/>Delete Club<br/></div>";
$pid = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
if($uid==$pid[0])
{
$res = deleteClub($clid);
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Club Deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't delete this club!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////
else if($action=="dltpl")
{
//$uid = getuid_sid($sid);
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Deleting Poll","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Poll<br/></div>";
echo "<p align=\"center\">";
$pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));
$res = mysql_query("UPDATE ibwf_topics SET pollid='0' WHERE id='".$tid."'");
if($res)
{
$res = mysql_query("DELETE FROM ibwf_presults WHERE pid='".$pid[0]."'");
$res = mysql_query("DELETE FROM ibwf_polls WHERE id='".$pid[0]."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Poll Deleted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
else if($action=="reqjc")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Joining A Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Request To Join Club<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$isin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'"));
if($isin[0]==0){
$res = mysql_query("INSERT INTO ibwf_clubmembers SET uid='".$uid."', clid='".$clid."', accepted='0', points='0', joined='".time()."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Request sent! The club owner should accept your request";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You are already in this club or request sent and waiting for acception";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////
else if($action=="unjc")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Unjoining club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Unjoin Club<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$isin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'"));
if($isin[0]>0){
$res = mysql_query("DELETE FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Unjoined club successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You're not a member of this club!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////ADD CLUB MEMBER
else if($action=="acm")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding A Member To Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Club Member<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
if($cowner[0]||$cowner[1]==$uid){
$res = mysql_query("UPDATE ibwf_clubmembers SET accepted='1' WHERE clid='".$clid."' AND uid='".$who."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Member added to your club";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
////////////////////////accept all
else if($action=="accall")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Adding A Member To Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Accept All<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
if($cowner[0]||$cowner[1]==$uid){
$res = mysql_query("UPDATE ibwf_clubmembers SET accepted='1' WHERE clid='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>All Members Accepted";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////
else if($action=="denall")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Adding A Member To Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Dennying Club Member<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
if($cowner[0]||$cowner[1]==$uid){
$res = mysql_query("DELETE FROM ibwf_clubmembers WHERE accepted='0' AND clid='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>All Members Denied";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////DELETE CLUB MEMBER
else if($action=="dcm")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Deleting A Member From Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Club Member<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
if($who==$cowner[0]){
echo "<img src=\"images/notok.gif\" alt=\"x\"/>NOT ALLOWED!";
}else if($cowner[0]||$cowner[1]==$uid){
$res = mysql_query("DELETE FROM ibwf_clubmembers WHERE clid='".$clid."' AND uid='".$who."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Member deleted from your club";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////
else if($action=="crpoll")
{
addonline(getuid_sid($sid),"Creating Poll","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Create Poll<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
if(getgold(getuid_sid($sid))>=50)
{
$pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$uid."'"));
if($pid[0] == 0)
{
$pques = $_POST["pques"];
$opt1 = $_POST["opt1"];
$opt2 = $_POST["opt2"];
$opt3 = $_POST["opt3"];
$opt4 = $_POST["opt4"];
$opt5 = $_POST["opt5"];
if((trim($pques)!="")&&(trim($opt1)!="")&&(trim($opt2)!=""))
{
$pex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_polls WHERE pqst LIKE '".$pques."'"));
if($pex[0]==0)
{
$res = mysql_query("INSERT INTO ibwf_polls SET pqst='".$pques."', opt1='".$opt1."', opt2='".$opt2."', opt3='".$opt3."', opt4='".$opt4."', opt5='".$opt5."', pdt='".time()."'");
if($res)
{
$pollid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_polls WHERE pqst='".$pques."' "));
mysql_query("UPDATE ibwf_users SET pollid='".$pollid[0]."' WHERE id='".$uid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Your poll created successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>There's already a poll with the same question";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>The poll must have a question, and at least 2 options";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You already have a poll";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You should have at least 50 Gold to create a poll<br/>To get Gold. Exchange Plusses at the <a href=\"bank.php?action=bank&sid=$sid\">»Wapirate Bank</a>!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////////////////
else if($action=="pltpc")
{
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Creating Poll","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Create Poll<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
if((getgold(getuid_sid($sid))>=500)||ismod($uid))
{
$pid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));
if($pid[0] == 0)
{
$pques = $_POST["pques"];
$opt1 = $_POST["opt1"];
$opt2 = $_POST["opt2"];
$opt3 = $_POST["opt3"];
$opt4 = $_POST["opt4"];
$opt5 = $_POST["opt5"];
if((trim($pques)!="")&&(trim($opt1)!="")&&(trim($opt2)!=""))
{
$pex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_polls WHERE pqst LIKE '".$pques."'"));
if($pex[0]==0)
{
$res = mysql_query("INSERT INTO ibwf_polls SET pqst='".$pques."', opt1='".$opt1."', opt2='".$opt2."', opt3='".$opt3."', opt4='".$opt4."', opt5='".$opt5."', pdt='".time()."'");
if($res)
{
$pollid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_polls WHERE pqst='".$pques."' "));
mysql_query("UPDATE ibwf_topics SET pollid='".$pollid[0]."' WHERE id='".$tid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Your poll created successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>There's already a poll with the same question";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>The poll must have a question, and at least 2 options";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This Topic Already Has A poll";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You should have at least 500 Gold to create a poll<br/>To get Gold. Exchange Plusses at the <a href=\"bank.php?action=bank&sid=$sid\">»Wapirate Bank</a>!";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
////////////////////////////////add blog
else if($action=="addblg")
{
if(!getgold(getuid_sid($sid))>50)
{
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "Only 50+ plusses can add blogs<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
$btitle = $_POST["btitle"];
$msgtxt = $_POST["msgtxt"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Adding a blog","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Blog<br/></div>";
echo "<p align=\"center\">";
$crdate = time();
$uid = getuid_sid($sid);
$res = false;
if((trim($msgtxt)!="")&&(trim($btitle)!=""))
{
$res = mysql_query("INSERT INTO ibwf_blogs SET bowner='".$uid."', bname='".$btitle."', bgdate='".$crdate."', btext='".$msgtxt."'");
}
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Blog Posted Successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Blog";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////////
else if($action=="addvlt")
{
if(!getgold(getuid_sid($sid))>19)
{
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "Only 20+ Gold can add a vault item<br/>To get Gold. Exchange Plusses at the <a href=\"bank.php?action=bank&sid=$sid\">»Wapirate Bank</a>!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
echo "</html>";
exit();
}
$viname = $_POST["viname"];
$vilink = $_POST["vilink"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Adding a vault Item","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Vault Item<br/></div>";
echo "<p align=\"center\">";
$crdate = time();
//$uid = getuid_sid($sid);
$res = false;
if((trim($vilink)!="")&&(trim($viname)!=""))
{
$res = mysql_query("INSERT INTO ibwf_vault SET uid='".$uid."', title='".mysql_escape_string($viname)."', pudt='".$crdate."', itemurl='".$vilink."'");
}
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Item added Successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error adding an item";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////shout
else if($action=="shout")
{
$shtxt = $_POST["shtxt"];
addonline(getuid_sid($sid),"Shouting","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Shout<br/></div>";
echo "<p align=\"center\">";
if(getgold(getuid_sid($sid))<10)
{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You should have at least 10 Gold to shout!<br/>To get Gold. Exchange Plusses at the <a href=\"bank.php?action=bank&sid=$sid\">»Wapirate Bank</a>!";
}else{
$shtxt = $shtxt;
//$uid = getuid_sid($sid);
$shtm = time();
$res = mysql_query("INSERT INTO ibwf_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'");
if($res)
{
$shts = mysql_fetch_array(mysql_query("SELECT shouts from ibwf_users WHERE id='".$uid."'"));
$shts = $shts[0]+1;
mysql_query("UPDATE ibwf_users SET shouts='".$shts."' WHERE id='".$uid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Shout added successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Announce
else if($action=="annc")
{
$antx = $_POST["antx"];
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Announcing","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Announce<br/></div>";
$cow = mysql_fetch_array(mysql_query("SELECT owner, coowner FROM ibwf_clubs WHERE id='".$clid."'"));
$uid = getuid_sid($sid);
echo "<p align=\"center\">";
if($cow[0]||$cow=$uid)
{
$shtxt = $shtxt;
//$uid = getuid_sid($sid);
$shtm = time();
$res = mysql_query("INSERT INTO ibwf_announcements SET antext='".$antx."', clid='".$clid."', antime='".$shtm."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Announcement Added!";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>This is not your club!";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
////////////////////////////////////
else if($action=="rateb")
{
$brate = $_POST["brate"];
$bid = $_GET["bid"];
addonline(getuid_sid($sid),"Rating a blog","");
//$uid = getuid_sid($sid);
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Rate blog<br/></div>";
echo "<p align=\"center\">";
$vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_brate WHERE uid='".$uid."' AND blogid='".$bid."'"));
if($vb[0]==0)
{
$res = mysql_query("INSERT INTO ibwf_brate SET uid='".$uid."', blogid='".$bid."', brate='".$brate."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Blog rated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You have rated this blog before<br/>";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////////////
else if($action=="delfgb")
{
$mid = $_GET["mid"];
addonline(getuid_sid($sid),"Deleting GB Message","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Guestbook Message<br/></div>";
echo "<p align=\"center\">";
if(candelgb(getuid_sid($sid), $mid))
{
$res = mysql_query("DELETE FROM ibwf_gbook WHERE id='".$mid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Message Deleted From Guestbook<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You can't delete this message";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////
else if($action=="delvlt")
{
$vid = $_GET["vid"];
addonline(getuid_sid($sid),"Deleting Vault Item","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Vault<br/></div>";
echo "<p align=\"center\">";
$itemowner = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_vault WHERE id='".$vid."'"));
if(ismod(getuid_sid($sid))||getuid_sid($sid)==$itemowner[0])
{
$res = mysql_query("DELETE FROM ibwf_vault WHERE id='".$vid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Item Deleted From Vault<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You can't delete this item";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////
else if($action=="delbl")
{
$bid = $_GET["bid"];
addonline(getuid_sid($sid),"Deleting A Blog","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Blog<br/></div>";
echo "<p align=\"center\">";
if(candelbl(getuid_sid($sid), $bid))
{
$res = mysql_query("DELETE FROM ibwf_blogs WHERE id='".$bid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Blog Deleted<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You can't delete this blog";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////////////
else if($action=="rpost")
{
$pid = $_GET["pid"];
addonline(getuid_sid($sid),"Main Page","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Report Post<br/></div>";
echo "<p align=\"center\">";
$pinfo = mysql_fetch_array(mysql_query("SELECT reported FROM ibwf_posts WHERE id='".$pid."'"));
if($pinfo[0]=="0")
{
$str = mysql_query("UPDATE ibwf_posts SET reported='1' WHERE id='".$pid."' ");
if($str)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Post reported to mods successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Can't report post at the moment";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>This Post is already reported";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////////
else if($action=="rtpc")
{
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Main Page","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Report Topic<br/></div>";
echo "<p align=\"center\">";
$pinfo = mysql_fetch_array(mysql_query("SELECT reported FROM ibwf_topics WHERE id='".$tid."'"));
if($pinfo[0]=="0")
{
$str = mysql_query("UPDATE ibwf_topics SET reported='1' WHERE id='".$tid."' ");
if($str)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Topic reported to mods successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Can't report topic at the moment";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>This Topic is already reported";
}
echo "<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
else if($action=="bud")
{
$todo = $_GET["todo"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding/Removing Buddy","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Buddies<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$unick = getnick_uid($uid);
$tnick = getnick_uid($who);
if($todo=="add")
{
if(budres($uid,$who)!=3){
if(arebuds($uid,$who))
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is already your buddy<br/>";
}else if(budres($uid, $who)==0)
{
$res = mysql_query("INSERT INTO ibwf_buddies SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>A request has been sent to $tnick<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
}
}
else if(budres($uid, $who)==1)
{
$res = mysql_query("UPDATE ibwf_buddies SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick Added to your buddy list successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
}
}
else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't add $tnick to your buddy list<br/>";
}
}else if($todo="del")
{
$res= mysql_query("DELETE FROM ibwf_buddies WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick removed from your buddy list<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>can't remove $tnick from your buddy list<br/>";
}
}
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Update buddy message
else if($action=="upbmsg")
{
addonline(getuid_sid($sid),"Updating Buddy message","");
$bmsg = $_POST["bmsg"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Buddy Message<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$res = mysql_query("UPDATE ibwf_users SET budmsg='".$bmsg."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Buddy message updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>can't update your buddy message<br/>";
}
echo "<br/>";
echo "<a href=\"lists.php?action=buds&sid=$sid\">";
echo "Buddies List</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Select Avatar
else if($action=="upav")
{
addonline(getuid_sid($sid),"Updating Avatar","");
$avid = $_GET["avid"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Avatar<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$avlnk = mysql_fetch_array(mysql_query("SELECT avlink FROM ibwf_avatars WHERE id='".$avid."'"));
$res = mysql_query("UPDATE ibwf_users SET avatar='".$avlnk[0]."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Avatar Selected<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
echo "<br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Chatmood
else if($action=="upcm")
{
addonline(getuid_sid($sid),"Updating Chatmood","");
$cmid = $_GET["cmid"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Mood<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$res = mysql_query("UPDATE ibwf_users SET chmood='".$cmid."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Mood Selected<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
echo "<br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">";
echo "Chatrooms</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Give GPs
else if($action=="givegp")
{
addonline(getuid_sid($sid),"Giving Game Plusses","");
$who = $_GET["who"];
$ptg = $_POST["ptg"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Give Game Plusses<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$gpsf = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$who."'"));
if($gpsf[0]>=$ptg){
$gpsf = $gpsf[0]-$ptg;
$gpst = $gpst[0]+$ptg;
$res = mysql_query("UPDATE ibwf_users SET gplus='".$gpst."' WHERE id='".$who."'");
if($res)
{
$res = mysql_query("UPDATE ibwf_users SET gplus='".$gpsf."' WHERE id='".$uid."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Game Plusses Updated Successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You don't have enough GPs to give<br/>";
}
echo "<br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////// add club
else if($action=="addcl")
{
addonline(getuid_sid($sid),"Adding Club","");
$clnm = trim($_POST["clnm"]);
$clnm = str_replace("$", "", $clnm);
$clds = trim($_POST["clds"]);
$clds = str_replace("$", "", $clds);
$clrl = trim($_POST["clrl"]);
$clrl = str_replace("$", "", $clrl);
$cllg = trim($_POST["cllg"]);
$cllg = str_replace("$", "", $cllg);
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Club<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
if(getgold($uid)>=500)
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."'"));
if($noi[0]<3)
{
if(($clnm=="")||($clds=="")||($clrl==""))
{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Please be sure to fill, club name, description and rules";
}else{
$nmex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE name LIKE '".$clnm."'"));
if($nmex[0]>0)
{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Club Name Already exist";
}else{
$res = mysql_query("INSERT INTO ibwf_clubs SET name='".$clnm."', owner='".$uid."', description='".$clds."', rules='".$clrl."', logo='".$cllg."', plusses='0', created='".time()."'");
if($res)
{
$clid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_clubs WHERE owner='".$uid."' AND name='".$clnm."'"));
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Congratulations! you have your own club, your own rules, message board, chatroom, announcements board, 50 club points also for you";
mysql_query("UPDATE ibwf_users SET gold=gold-500 WHERE id='".$uid."'");
mysql_query("INSERT INTO ibwf_clubmembers SET uid='".$uid."', clid='".$clid[0]."', accepted='1', points='50', joined='".time()."'");
//$ups = getplusses($uid);
//$ups += 5;
//mysql_query("UPDATE ibwf_users SET plusses='".$ups."' WHERE id='".$uid."'");
$fnm = $clnm;
$cnm = $clnm;
mysql_query("INSERT INTO ibwf_forums SET name='".$fnm."', position='0', cid='0', clubid='".$clid[0]."'");
mysql_query("INSERT INTO ibwf_rooms SET name='".$cnm."', pass='', static='1', mage='0', chposts='0', perms='0', censord='0', freaky='0', lastmsg='".time()."', clubid='".$clid[0]."'");
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error!";
}
}
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You already have 3 clubs";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You cant add clubs";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Give BPs
else if($action=="batp")
{
addonline(getuid_sid($sid),"Giving Game Plusses","");
$who = $_GET["who"];
$ptg = $_POST["ptbp"];
$giv = $_POST["giv"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Give Battle Points<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$judg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'"));
if(ismod(getuid_sid($sid))||$judg[0]>0)
{
if ($giv=="1")
{
$gpst = $gpst[0]+$ptg;
}else{
$gpst = $gpst[0]-$ptg;
if($gpst<0)$gpst=0;
}
$res = mysql_query("UPDATE ibwf_users SET battlep='".$gpst."' WHERE id='".$who."'");
if($res)
{
$vnick = getnick_uid($who);
if ($giv=="1")
{
$ms1 = " Added $ptg points to ";
}else{
$ms1 = " removed $ptg points from ";
}
mysql_query("INSERT INTO ibwf_mlog SET action='bpoints', details='<b>".getnick_uid(getuid_sid($sid))."</b> $ms1 $vnick', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Battle Points Updated Successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't do this<br/>";
}
echo "<br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////Add remove from ignoire list
else if($action=="ign")
{
addonline(getuid_sid($sid),"Updating ignore list","");
$todo = $_GET["todo"];
$who = $_GET["who"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Ignore List<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$tnick = getnick_uid($who);
if($todo=="add")
{
if(ignoreres($uid, $who)==1)
{
$res= mysql_query("INSERT INTO ibwf_ignore SET name='".$uid."', target='".$who."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick was added successfully to your ignore list<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Updating Database<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You can't Add $tnick to your ignore list<br/>";
}
}else if($todo="del")
{
if(ignoreres($uid, $who)==2)
{
$res= mysql_query("DELETE FROM ibwf_ignore WHERE name='".$uid."' AND target='".$who."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>$tnick was deleted successfully from your ignore list<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Updating Database<br/>";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>$tnick is not ignored by you<br/>";
}
}
echo "<br/><a href=\"lists.php?action=ignl&sid=$sid\">";
echo "Ignore List</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Update profile
else if($action=="uprof")
{
addonline(getuid_sid($sid),"Updating Settings","");
$savat = $_POST["savat"];
$semail = $_POST["semail"];
$usite = $_POST["usite"];
//$ubday = $_POST["ubday"];
$year = $_POST["year"];
$month = $_POST["month"];
$day = $_POST["day"];
$uloc = $_POST["uloc"];
$usig = $_POST["usig"];
$usex = $_POST["usex"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Settings<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$res = mysql_query("UPDATE ibwf_users SET avatar='".$savat."', email='".$semail."', site='".$usite."', birthday='".$year.$month.$day."', location='".$uloc."', signature='".$usig."', sex='".$usex."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your profile was updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating your profile<br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////////////////
else if($action=="siteset")
{
addonline(getuid_sid($sid),"Updating Theme","");
$theme = $_POST["thms"];
$size = $_POST["size"];
$uid = getuid_sid($sid);
$exist = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$uid."'"));
if ($exist[0]>0)
{
$res = mysql_query("UPDATE ibwf_users SET theme='".$theme."_".$size.".css' WHERE id='".$uid."'");
}else{
$res = mysql_query("UPDATE ibwf_users SET theme='".$theme."_".$size.".css' WHERE id='".$uid."'");
}
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/".$theme."_".$size.".css\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Theme<br/></div>";
echo "<p align=\"center\">";
echo mysql_error();
if($res)
{
echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your theme has been updated successfully<br/><br/><br/>";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/><br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Update profile
else if($action=="shsml")
{
addonline(getuid_sid($sid),"Updating Smilies","");
$act = $_GET["act"];
$acts = ($act=="dis" ? 0 : 1);
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Update Smilies<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
$res = mysql_query("UPDATE ibwf_users SET hvia='".$acts."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Smileys Visibility updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating your profile<br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Change Password
else if($action=="upwd")
{
addonline(getuid_sid($sid),"Updating Settings","");
$npwd = $_POST["npwd"];
$cpwd = $_POST["cpwd"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Change Pass<br/></div>";
echo "<p align=\"center\">";
//$uid = getuid_sid($sid);
if($npwd!=$cpwd)
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Your Password and Confirmation Password Don't match<br/>";
}else if((strlen($npwd)<4) || (strlen($npwd)>15)){
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Your password should be between 4 and 15 letters only<br/>";
}else{
$pwd = md5($npwd);
$res = mysql_query("UPDATE ibwf_users SET pass='".$pwd."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your password was updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating your password<br/>";
}
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////
else if($action=="addphoto")
{
$imglink = $_POST["imglink"];
$sex = $_POST["sex"];
$uid = getuid_sid($sid);
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Photo<br/></div>";
echo "<p align=\"center\">";
$res = mysql_query("INSERT INTO ibwf_gallery SET uid='".$uid."', imglink='".$imglink."', sex='".$sex."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"O\"/>User Photo Added<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error<br/>";
}
echo "<a href=\"gallery.php?action=main&sid=$sid\">User Gallery</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////ADD CO-OWNER
else if($action=="coowner")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding A Member To Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Co-Owner<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
if($cowner[0]==$uid){
$res = mysql_query("UPDATE ibwf_clubs SET coowner='".$who."' WHERE id='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Co-Owner added to your club";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////DELETE CO-OWNER
else if($action=="delcoowner")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding A Member To Club","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Delete Co-Owner<br/></div>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$cowner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
if($cowner[0]==$uid){
$res = mysql_query("UPDATE ibwf_clubs SET coowner='0' WHERE id='".$clid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Co-Owner deleted from your club";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error!";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>This club ain't yours";
}
echo "<br/><a href=\"index.php?action=gocl&sid=$sid&clid=$clid\">Back To Club</a><br/>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Change Menu Images On
else if($action=="menu")
{
addonline(getuid_sid($sid),"Looking for Treasure","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Images On<br/></div>";
echo "<p align=\"center\">";
$menu = 1;
$res = mysql_query("UPDATE ibwf_users SET menu='".$menu."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Menu Images Turned On Successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Updating Menu Images<br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
//////////////////////////////////////////Change Menu Images Off
else if($action=="nomenu")
{
addonline(getuid_sid($sid),"Looking for Treasure","");
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Images Off<br/></div>";
echo "<p align=\"center\">";
$menu = 0;
$res = mysql_query("UPDATE ibwf_users SET menu='".$menu."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Menu Images Turned Off Successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error Updating Menu Images<br/>";
}
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
///////////////////////////////////add quiz words
else if($action=="addquiz"){
$question = $_POST["question"];
$answer = $_POST["answer"];
$points = $_POST["points"];
$qnick = $_POST["qnick"];
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Add Quiz Word<br/></div>";
echo "<p align=\"center\">";
echo "<br/>";
$res = mysql_query("INSERT INTO quizuser SET question='".$question."', answer='".$answer."', points='".$points."', who='".$qnick."'");
if($res){
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Quiz Question added successfully<br/>Your points will be added as soon as your question is validated by a member of staff!";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error adding Quiz Question ";
}
echo "<br/><br/><a href=\"quiz.php?action=addquiz&sid=$sid&rid=1\">Add Another Quiz Question?</a><br/><br/>";
echo "<a href=\"quiz.php?rid=1&sid=$sid\">Quiz</a><br/>";
echo "<br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
/////////////////////////////
else{
echo "<head>";
echo "<title>wapirate</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div><br/>Doh!<br/></div>";
echo "<p align=\"center\">";
echo "I don't know how you got in here, but there's nothing to show<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "<div>$addy</div>";
echo "</body>";
exit();
}
echo "</html>";
?>