<?php
include("config.php");
include("core.php");
echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML Mobile 1.0//EN\"". " \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $sitename; ?></title>
<meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
<?php
connectdb();
$sid = $_GET["sid"];
echo gettheme($sid);
?>
</head>
<body>
<?php
echo "<font size=\"".getfontsize($sid)."\">";
$action = $_GET["action"];
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
boxstart("Error!");
echo "<img src=\"images/notok.gif alt=\"\"/><center>You are not logged in<br/>";
echo "or your session has expired.<br/><br/>";
echo "
<form action=\"login.php\" method=\"get\">
<img src=\"images/user.gif\" alt=\"\"/>Enter username:<br/>
<input id=\"inputText\" name=\"loguid\" maxlength=\"30\"/><br/>
<img src=\"images/pass.gif\" alt=\"\"/>Enter password:<br/>
<input id=\"inputText\" type=\"password\" format=\"*x\" name=\"logpwd\" maxlength=\"30\"/><br/>
<input id=\"inputButton\" type=\"submit\" value=\"Login\"/><br/>
</form>
<br/><br/><img src=\"images/register.gif\" alt=\"\"/><a href=\"register.php\">Register</a>
<br/><img src=\"images/home.gif\" alt=\"\"/><a href=\"index.php\">Home</a>
</center>";
boxend();
echo "</font></body></html>";
exit();
}
if(isbanned($uid))
{
boxstart("Error!");
echo "<img src=\"images/notok.gif alt=\"\"/><center>";
echo "You are presently banned!<br/><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "Time to finish your penalty: $rmsg<br/><br/>";
echo "</center>";
boxend();
echo "</font></body></html>";
exit();
}
gettimebar();
boxstart("Done!");
echo "<center>";
if($action=="newtopic")
{
if (isforumblocked(getuid_sid($sid))){
boxstart("Error!");
echo "<img src=\"notok.gif\"/>";
echo "Your forum access has been blocked by a moderator!!!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center>";
boxend();
echo "</font></body></html>";
exit();
}
$fid = $_POST["fid"];
$ntitle = $_POST["ntitle"];
$tpctxt = $_POST["tpctxt"];
if(!canaccess(getuid_sid($sid), $fid))
{
boxstart("Error!");
echo "<img src=\"notok.gif\"/>";
echo "You can't access the contents of thism forum!!!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center></div></div></font></body></html>";
exit();
}
addonline(getuid_sid($sid),"Created New Topic","");
$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]+5;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
$tnm = htmlspecialchars($ntitle);
echo "Thanks! Your topic <b>$tnm</b> has been 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 "Back To Topic</a>";
}else{
echo "Error Creating New Topic!";
}
}else{
$af = $topic_af -$antiflood;
echo "Flood Control!!! You tried posting a new topic very soon, it might be a network problem! Please wait for $af seconds before posting a new topic again!";
}
}else{
echo "This topic name already exists! Please choose another name!<br/><a href=\"index.php?action=newtopic&sid=$sid&fid=$fid\">Back</a>";
}
$fname = getfname($fid);
echo "<br/><a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "Back To $fname</a>";
}
/////////////////
else if($action=="rateb")
{
$brate = $_POST["brate"];
$bid = $_GET["bid"];
addonline(getuid_sid($sid),"Rating a blog","");
//$uid = getuid_sid($sid);
$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=\"lists.php?action=blogs&sid=$sid&who=$uid\">My Blogs</a><br/>";
}
/////////////////Upload avatar////////////////////////
else if($action=="upavat"){
addonline(getuid_sid($sid),"Uploading avatar image","");
$size = $_FILES['attach']['size']/1024;
$origname = $_FILES['attach']['name'];
$res = false;
$ext = explode(".", strrev($origname));
switch(strtolower($ext[0])){
case "gpj":
$res = true;
break;
case "gepj":
$res = true;
break;
}
$tm = time();
$uploaddir = "./avatars";
if($size>512){
echo "File is larger than 512KB";
}
else if ($res!=true){
echo "File type not supported! Please attach only a JPG/JPEG.";
}
else{
$name = getuid_sid($sid);
$uploadfile = $name.".".$ext;
$uppath=$uploaddir."/".$uploadfile;
move_uploaded_file($_FILES['attach']['tmp_name'], $uppath);
$filewa=$uppath;
list($width, $height, $type, $attr) = getimagesize($filewa);
$newname=$uploaddir."/".$name."u.jpg";
$newheight = ($height*128)/$width;
$newimg=imagecreatetruecolor(128, $newheight);
$largeimg=imagecreatefromjpeg($filewa);
imagecopyresampled($newimg, $largeimg, 0, 0, 0, 0, 128, $newheight, $width, $height);
imagejpeg($newimg, $newname);
imagedestroy($newimg);
imagedestroy($largeimg);
$file1=$name."u.jpg";
unlink($filewa);
$res1 = mysql_query("UPDATE ibwf_users SET avatar='./avatars/$file1' WHERE id='".$name."'");
}
if($res1){
echo "Your file $origname was successfully uploaded and set to your profile!";
}
else {
echo "File couldn't be processed! Check error messages and report to a moderator or admin if applicable.";
}
}
/////////////////////////
else if($action=="delfgb")
{
$mid = $_GET["mid"];
addonline(getuid_sid($sid),"Deleting GB Message","");
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=\"lists.php?action=blogs&sid=$sid&who=".getuid_sid($sid)."\">My Blog</a>";
}
///////////////////////////
else if($action=="delbl")
{
$bid = $_GET["bid"];
addonline(getuid_sid($sid),"Deleting A Blog","");
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=\"lists.php?action=blogs&sid=$sid&who=".getuid_sid($sid)."\">My Blogs</a>";
}
/////////////////////
else if($action=="addblg")
{
if(!getpoints(getuid_sid($sid))>50)
{
echo "Only 50+ points can add blogs<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center></div></div></font></body></html>";
exit();
}
$btitle = $_POST["btitle"];
$msgtxt = $_POST["msgtxt"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Adding a blog","");
$crdate = time() + 12.5*60*60;
$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\"/>Message Posted Successfully";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
echo "<br/><br/>";
echo "<a href=\"lists.php?action=blogs&sid=$sid&who=$uid\">My Blogs</a>";
}
////////////////////
else if($action=="signgb")
{
$who = $_POST["who"];
if(!cansigngb(getuid_sid($sid), $who))
{
echo "You cant post comment in this user's blog because you are not in his/her buddy list.<br/><br/>";
echo "<a href=\"lists.php?action=blogs&sid=$sid&who=$who\">My Blog</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center></div></div></font></body>";
echo "</html>";
exit();
}
$msgtxt = $_POST["msgtxt"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Commenting a blog","");
$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/><a href=\"lists.php?action=blogs&sid=$sid&who=$who\">".getnick_uid($who)."'s Blog</a><br/>";
echo "<br/>";
}
//////////////////
else if($action=="delan")
{
//$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Deleting Announcement","");
$clid = $_GET["clid"];
$anid = $_GET["anid"];
$uid = getuid_sid($sid);
$pid = mysql_fetch_array(mysql_query("SELECT owner 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])&&($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\"/>Yo can't delete this announcement!";
}
echo "<a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
///////////
else if($action=="dlcl")
{
//$uid = getuid_sid($sid);
addonline(getuid_sid($sid),"Deleting Club","");
$clid = $_GET["clid"];
$uid = getuid_sid($sid);
$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\"/>Yo can't delete this club!";
}
echo "<br/><a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
///////////////////
else if($action=="reqjc")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Joining A Club","");
$uid = getuid_sid($sid);
$unick = getnick_uid($uid);
$isin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid."'"));
$clown = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$clid."'"));
$clname = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_clubs WHERE id='".$clid."'"));
if($isin[0]==0){
$res = mysql_query("INSERT INTO ibwf_clubmembers SET uid='".$uid."', clid='".$clid."', accepted='0', points='0', joined='".time()."'");
$sql = mysql_query("INSERT INTO ibwf_private SET byuid = '4', touid = '".$clown[0]."', text = 'User $unick wants to join your club [b]$clname[0][/b].[br/]Go to Your Club and Accept or Deny the user.[br/][br/][small][i]P.S. This is an automated P.M. Please do not Reply.[/i][/small]', timesent = '".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/><a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
else if($action=="unjc")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Unjoining club","");
$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/><a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
///////////////////
else if($action=="acm")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding a member to club","");
$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_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 "<a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
/////////////////////
else if($action=="accall")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Adding a member to club","");
$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_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 "<a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
//////////////////////////////
else if($action=="denall")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
addonline(getuid_sid($sid),"Adding a member to club","");
$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("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 "<a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
else if($action=="dcm")
{
//$uid = getuid_sid($sid);
$clid = $_GET["clid"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Deleting a member from club","");
$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("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 "<a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a>";
}
/////////////////////////////////////
else if($action=="post")
{
if (isforumblocked(getuid_sid($sid))){
echo "Your forum access has been blocked by a moderator!!!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center></div></div></font></body>";
echo "</html>";
exit();
}
$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 "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a>";
echo "</center></div></div></font></body>";
echo "</html>";
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Posted A reply","");
$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]+2;
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 "Thanks! Your message has been added to Forums successfully.";
echo "<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid&go=last\">";
echo "Back To Topic</a><br/>";
}else{
echo "Error Posting Message!";
}
}else{
$af = $post_af -$antiflood;
echo "Flood Control!!! You tried posting a new reply very soon, it might be a network problem! Please wait for $af seconds before posting a reply again!";
}
}else{
echo "Topic is closed for posting";
}
$fname = getfname($fid);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$fid\">";
echo "Back To $fname</a><br/>";
}
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","");
$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>";
}
else if($action=="mkroom")
{
$rname = mysql_escape_string($_POST["rname"]);
$rpass = trim($_POST["rpass"]);
addonline(getuid_sid($sid),"Creating Chatroom","");
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\">Chatrooms</a>";
}
//////////////////////////////////////////shout
else if($action=="shout")
{
$shtxt = $_POST["shtxt"];
if (isshoutblocked(getuid_sid($sid))){
echo "Your shoutbox access has been blocked by a moderator!!!<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>";
boxend();
echo "</font></body></html>";
exit();
}
if ($shtxt==""){
echo "This seems to be a blank shout!!! Please go back and try again.<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">Main Menu</a></center>";
boxend();
getfooter($sid);
echo "</font></body></html>";
exit();
}
addonline(getuid_sid($sid),"Shouting","");
$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,plusses from ibwf_users WHERE id='".$uid."'"));
$jshts = $shts[0]+1;
$shpl = $shts[1]+1;
$sql=mysql_query("UPDATE ibwf_users SET shouts='".$jshts."', plusses='".$shpl."' 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=\"lists.php?action=shouts&sid=$sid\">";
echo "Shouts</a>";
}
else if($action=="rpost")
{
$pid = $_GET["pid"];
addonline(getuid_sid($sid),"Reporting Post","");
$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/>";
}
else if($action=="rtpc")
{
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Reporting Topic","");
$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/>";
}
else if($action=="bud")
{
$todo = $_GET["todo"];
$who = $_GET["who"];
addonline(getuid_sid($sid),"Adding/Removing Buddy","");
$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/>";
}
}
}
//////////////////////////////////////////Update buddy message
else if($action=="upbmsg")
{
addonline(getuid_sid($sid),"Updating Buddy message","");
$bmsg = $_POST["bmsg"];
//$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/>";
}
}
///////////////////Adding Reputation
else if($action=="addrepfin"){
$tid = $_POST["tid"];
$rid = $_POST["rid"];
$who = $_POST["who"];
$mnick = getnick_sid($sid);
$indiatime = time() + (addhours());
//$getnick = mysql_fetch_array(mysql_query("SELECT authorid, crdate FROM ibwf_topics WHERE id='".$tid."'"));
$unick = getnick_uid($who);
addonline(getuid_sid($sid),"Adding To $unick\'s Reputation","");
if($mnick==$unick)
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/><b> Error!</b><br/>";
echo "<br/>You Can Not Add To The Reputation Of Yourself!";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a><br/><br/>";
echo "</center></div</div>".getfooter($sid)."</font></body></html>";
exit();
}
else
{
$res = "INSERT INTO `ibwf_reputation` (`tid` ,`user` ,`target` ,`points` ,`time`) VALUES ('".$tid."', '".$mnick."', '".$unick."', '".$rid."', '".$indiatime."')";
$result = mysql_query($res) or die("<img src=\"images/notok.gif\" alt=\"x\"/><b>Error! Unable To Add Reputation!!</b><br/><br/>
»<b>You Have Already Added To Reputation Of $unick For This Post!</b><br/>
<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a><br/><br/>
</center></div></div>".getfooter($sid)."</font></body></html>");
if($res)
{
$reps = mysql_fetch_array(mysql_query("SELECT reps FROM ibwf_users WHERE id='".$who."'"));
$reps = $rid + $reps[0];
mysql_query("UPDATE ibwf_users SET reps='".$reps."' WHERE id='".$who."'");
echo "<img src=\"images/ok.gif\" alt=\"o\"/>You Have Successfully Added To $unick\'s Reputation!<br/>";
echo "<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a>";
}
else
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Unable To Add Reputation!<br/>";
echo "<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a>";
}
}
}
//////////////////////////////////////////Bookmark Topic/////////////////////////
else if($action=="bkmrk")
{
addonline(getuid_sid($sid),"Bookmarking a Topic","");
$tpcid = $_GET["tid"];
$uid = getuid_sid($sid);
$indiatime = time() + (addhours());
$blah = "SELECT name FROM ibwf_topics WHERE id = '".$tpcid."'";
$blah2 = mysql_query($blah);
while($blah3=mysql_fetch_array($blah2)){
$topicname=$blah3[0];
}
$sql = "SELECT COUNT(*) FROM ibwf_bookmarks WHERE userid='".$uid."'";
$result = mysql_query($sql);
while($blah4=mysql_fetch_array($result))
{
$used=$blah4[0];
}
if($used=='50')
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/><b> Unable To Bookmark Topic!</b><br/>";
echo "<br/>You have reached the limit of total Bookmarks Allowed!<br/>Delete existing bookmarks if you want to bookmark more topics!";
echo "<br/><br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tpcid\">Back To Topic</a><br/><br/>";
boxend();
echo "</div></div>".getfooter($sid)."</font></body></html>";
exit();
}
else {
$res = "INSERT INTO `ibwf_bookmarks` (`userid` ,`topic` ,`name` ,`time`) VALUES ('".$uid."', '".$tpcid."', '".$topicname."', '".$indiatime."')";
$result = mysql_query($res) or die("<img src=\"images/notok.gif\" alt=\"x\"/><b>Unable To Bookmark Topic!</b><br/><br/>
<b>Possible Reasons could be -</b> <br/>»You Have Already Bookmarked This Topic!<br/>
»You Have Reached The Limit Of Total Allowed Bookmarks!<br/>
»Other Unknown Error!<br/>
<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tpcid\">Back To Topic</a><br/><br/>
</center></div></div>".getfooter($sid)."</font></body></html>
");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Topic Bookmarked successfully!<br/>";
echo "<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tpcid\">Back To Topic</a>";
echo "<br/><br/><a href=\"index.php?action=bookmarks&sid=$sid\">Go To Bookmarks</a><br/>";
}
else
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Unable To Bookmark Topic!<br/>";
echo "<br/><a href=\"index.php?action=viewtpc&sid=$sid&tid=$tpcid\">Back To Topic</a>";
}
}}
/////////////////////////Delete Bookmark////////////////////////
else if($action=="kaltibkmrk")
{
addonline(getuid_sid($sid),"Deleting a Bookmark","");
$tpcid=$_GET["tpcid"];
$sql="DELETE FROM `ibwf_bookmarks` WHERE `id`='$tpcid'";
$res = mysql_query($sql);
if($res){
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Bookmark deleted!";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Deleting Bookmark!";
}
echo "<br/><br/><center><a href=\"index.php?action=bookmarks&sid=$sid\">Back To Bookmarks</a></center><br/><br/>";
}
//////////////////////////////////////////Select Avatar
else if($action=="upav")
{
addonline(getuid_sid($sid),"Updating Avatar","");
$avid = $_GET["avid"];
//$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/>";
}
//////////////////// 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);
$uid = getuid_sid($sid);
if(getpoints($sid)>=100)
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs WHERE owner='".$uid."'"));
if($noi[0]<7)
{
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='20', 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, 20 plusses as credit for your club so you can give them to the first registerers users at your club, 5 plusses for you, and 50 club points also for you";
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." Board";
$cnm = $clnm." Chat";
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 7 clubs";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>You cant add clubs";
}
echo "<br/><a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a><br/>";
}
//////////////////////////////////////////update chatmood
else if($action=="upcm")
{
addonline(getuid_sid($sid),"Updating Chatmood","");
$cmid = $_GET["cmid"];
//$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/>";
}
else if($action=="ign")
{
addonline(getuid_sid($sid),"Updating ignore list","");
$todo = $_GET["todo"];
$who = $_GET["who"];
$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/>";
}
//////////////////////////////////////////Update profile
else if($action=="uprof")
{
addonline(getuid_sid($sid),"Updating Settings","");
$savat = $_POST["savat"];
$ubdt = $_POST["ubdt"];
$ubdu = $_POST["ubdu"];
$ubdv = $_POST["ubdv"];
$uloc = $_POST["uloc"];
$usig = $_POST["usig"];
$usex = $_POST["usex"];
$likes = $_POST["likes"];
$hates = $_POST["hates"];
$ms = $_POST["ms"];
$rname = $_POST["rname"];
$ubday = $ubdv."-".$ubdu."-".$ubdt;
$blah1 = explode(".", strrev($savat));
if(strtolower(strrev($blah1[0]))=="jpg" || strtolower(strrev($blah1[0]))=="png" || $blah1[0] =="" || strtolower(strrev($blah1[0]))=="jpeg" || strtolower(strrev($blah1[0]))=="gif" || strtolower(strrev($blah1[0]))=="bmp"){
$res = mysql_query("UPDATE ibwf_users SET avatar='".$savat."', birthday='".$ubday."', rname='".$rname."', likes='".$likes."', hates='".$hates."', ms='".$ms."', location='".$uloc."', signature='".$usig."', sex='".$usex."' WHERE id='".$uid."'");
} else{
echo "Please give link to jpg/jpeg/png/bmp/gif images only, as the avatar URL.</p>";
exit();
}
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/>";
}
}
///////////////////Edit Contact Details
else if($action=="ucont")
{
addonline(getuid_sid($sid),"Updating Settings","");
$email = $_POST["email"];
$aim = $_POST["aim"];
$icq = $_POST["icq"];
$msn = $_POST["msn"];
$skype = $_POST["skype"];
$yahoo = $_POST["yahoo"];
$gtalk = $_POST["gtalk"];
$orkut = $_POST["orkut"];
$chk = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_xinfo WHERE uid='".$uid."'"));
if($chk[0]==null)
{$res = mysql_query("INSERT INTO ibwf_xinfo SET uid='".$uid."', aim='".$aim."', icq='".$icq."', msn='".$msn."', skype='".$skype."', yahoo='".$yahoo."', gtalk='".$gtalk."', orkut='".$orkut."'");}
else
{$res = mysql_query("UPDATE ibwf_xinfo SET aim='".$aim."', icq='".$icq."', msn='".$msn."', skype='".$skype."', yahoo='".$yahoo."', gtalk='".$gtalk."', orkut='".$orkut."' WHERE uid='".$uid."'");}
$sql = mysql_query("UPDATE ibwf_users SET email='".$email."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your Contact Details were updated successfully!<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating your Contact Details!<br/>";
}
}
//////////////////////////////////////////Edit club
else if($action=="edcl")
{
addonline(getuid_sid($sid),"Editing club","");
$cid = $_POST["cid"];
$owner = mysql_fetch_array(mysql_query("SELECT owner FROM ibwf_clubs WHERE id='".$cid."'"));
$clds = $_POST["clds"];
$clrl = $_POST["clrl"];
$cllg = $_POST["cllg"];
$clnm = $_POST["clnm"];
$uid=getuid_sid($sid);
if($owner[0]==$uid){
$res = mysql_query("UPDATE ibwf_clubs SET name='".$clnm."', rules='".$clrl."', description='".$clds."', logo='".$cllg."' WHERE id='".$cid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Club was updated successfully!<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating club!<br/>";
}
}
else{
echo "You are not authorized to edit this club!";
}
echo "<br/><a href=\"index.php?action=myclub&sid=$sid\">My Clubs</a><br/>";
}
//////////////////////////////////////////Change Password
else if($action=="upwd")
{
addonline(getuid_sid($sid),"Updating Settings","");
$npwd = $_POST["npwd"];
$cpwd = $_POST["cpwd"];
$opwd = $_POST["opwd"];
$sql = $_POST["sql"];
$uid = getuid_sid($sid);
if($npwd!=$cpwd)
{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Your Password and Confirm Password Doesn't match<br/>";
}
else if((md5($opwd))!=$sql){
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Old Password Is Incorrect!<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/>";
}
}
}
////////////////set ppp///////////////
else if($action=="setppp")
{
addonline(getuid_sid($sid),"Updating posts per page","");
$ppp = $_POST["ppp"];
$res = mysql_query("UPDATE ibwf_users SET ppp='".$ppp."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your posts per page was updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating posts per page. Try again later!<br/>";
}
}
////////////////updating font size///////////////
else if($action=="font")
{
addonline(getuid_sid($sid),"Updating font size","");
$size = $_POST["size"];
$res = mysql_query("UPDATE ibwf_users SET fontsize='".$size."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your font size was updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error updating font size. Try again later!<br/>";
}
}
/////////////////////Authorisation as Admin////////////////////
else if($action=="admauth")
{
addonline(getuid_sid($sid),"Owner Control Panel","");
$apwd = $_POST["apwd"];
$uid = getuid_sid($sid);
$apass = "avadaca6162davra";
if(isadmin($uid))
{
if(($apwd)==($apass))
{ echo "<b><i>Success!!<br/><a href=\"index.php?action=caputdraconis&sid=$sid\">Click Here</a> To Continue to Admin Control Panel</i></b><br/>"; }
else { echo "<b>Authorisation Failed!! <br/> Wrong Password! Try Again!</b>"; }
}
else{
echo "<i><b>You are not an Admin! Are You?<br/> So Get The Hell Out Of Here!</b></i>";
}
}
////////////////edit theme//////////////
else if($action=="theme")
{
addonline(getuid_sid($sid),"Editing Theme","");
$tid=$_POST['tid'];
$blah = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM themes WHERE uid=$uid AND id=$tid"));
if($blah[0]>0){
$res = mysql_query("UPDATE themes SET titlebg='".$_POST['titlebg']."', titleshade='".$_POST['titleshade']."', footershade='".$_POST['footershade']."', titlecolor='".$_POST['titlecolor']."', divbg='".$_POST['divbg']."', alink='".$_POST['alink']."', vlink='".$_POST['vlink']."', timebarbg='".$_POST['timebarbg']."', timebarshade='".$_POST['timebarshade']."', pagebg='".$_POST['pagebg']."', pagetext='".$_POST['pagetext']."', logoshade='".$_POST['logoshade']."', inputboxbg='".$_POST['inputboxbg']."', inputboxtext='".$_POST['inputboxtext']."', inputboxborder='".$_POST['inputboxborder']."', buttonbg='".$_POST['buttonbg']."', buttontext='".$_POST['buttontext']."', buttonborder='".$_POST['buttonborder']."', name='".$_POST['nm']."' WHERE uid=$uid AND id=$tid");
}
else
$res=mysql_query("INSERT INTO themes SET name='".$_POST['nm']."', uid = '".$uid."', footershade='".$_POST['footershade']."', titlebg='".$_POST['titlebg']."', titleshade='".$_POST['titleshade']."', titlecolor='".$_POST['titlecolor']."', divbg='".$_POST['divbg']."', alink='".$_POST['alink']."', vlink='".$_POST['vlink']."', timebarbg='".$_POST['timebarbg']."', timebarshade='".$_POST['timebarshade']."', pagebg='".$_POST['pagebg']."', pagetext='".$_POST['pagetext']."', logoshade='".$_POST['logoshade']."', inputboxbg='".$_POST['inputboxbg']."', inputboxtext='".$_POST['inputboxtext']."', inputboxborder='".$_POST['inputboxborder']."', buttonbg='".$_POST['buttonbg']."', buttontext='".$_POST['buttontext']."', buttonborder='".$_POST['buttonborder']."', applied=1");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your theme was successfully edited!!<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error editing theme. Try again later!<br/>";
}
echo "</p>";
echo "<br/>Not satisfied? <a href=\"index.php?sid=$sid&action=theme&tid=$tid\">Customise again</a> or choose from <a href=\"index.php?action=presetthm&sid=$sid\">preset themes</a>.
";
}
///////////Set Theme/////////////////////////
else if($action=="setthm")
{
addonline(getuid_sid($sid),"Setting Preset Theme","");
$uid = getuid_sid($sid);
$sql = "SELECT COUNT(*) FROM themes WHERE uid='".$uid."'";
$res = mysql_query($sql);
while($blah=mysql_fetch_array($res))
{
$cur=$blah[0];
}
if($cur>=10)
{
echo "You have reached your limit of total allowed themes.<br/> Delete a theme if you want to set another.<br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}
else {
$blah=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM themes WHERE uid=$uid AND name='".$_POST['nm']."'"));
if($blah[0]==0){
$res1 = mysql_query("UPDATE themes SET applied='0' WHERE uid=$uid");
$res=mysql_query("INSERT INTO themes SET uid='".$uid."', titlebg='".$_POST['titlebg']."', footershade='".$_POST['footershade']."', titleshade='".$_POST['titleshade']."', titlecolor='".$_POST['titlecolor']."', divbg='".$_POST['divbg']."', alink='".$_POST['alink']."', vlink='".$_POST['vlink']."', timebarbg='".$_POST['timebarbg']."', timebarshade='".$_POST['timebarshade']."', pagebg='".$_POST['pagebg']."', pagetext='".$_POST['pagetext']."', logoshade='".$_POST['logoshade']."', inputboxbg='".$_POST['inputboxbg']."', inputboxtext='".$_POST['inputboxtext']."', inputboxborder='".$_POST['inputboxborder']."', buttonbg='".$_POST['buttonbg']."', buttontext='".$_POST['buttontext']."', buttonborder='".$_POST['buttonborder']."', name='".$_POST['nm']."', applied='1'");
}
else{
$res1 = mysql_query("UPDATE themes SET applied='0' WHERE uid=$uid");
$res=mysql_query("UPDATE themes SET applied='1' WHERE name='".$_POST['nm']."' AND uid=$uid");
}
}
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Your theme was successfully set!<br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Error saving theme. Try again later!<br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}
}
////////////////Delete Theme////////////////////
else if($action=="delthm"){
addonline(getuid_sid($sid),"Deleting Theme","index.php?action=$action");
$tid = $_GET["tid"];
$who = getuid_sid($sid);
$oid = mysql_fetch_array(mysql_query("SELECT uid,applied FROM themes WHERE id='".$tid."'"));
if($oid[1]==1){
echo "You can't delete a theme which is already applied!!!<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
echo "</center></div></div></font></body></html>";
exit();
}
if($who==$oid[0])
{ $res = mysql_query("DELETE FROM themes WHERE id=$tid");
if($res)
{echo "<img src=\"images/ok.gif\" alt=\"O\"/>Theme Deleted Sucessfully!<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}else
{echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error! Try Again Later.<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}
}
else { echo "This theme aint yours. Trying to be nosy? eh?<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>"; }
}
/////////////////////Apply Theme/////////////////
else if($action=="appthm"){
addonline(getuid_sid($sid),"Applying Theme","index.php?action=$action");
$tid = $_GET["tid"];
$who = $uid;
$res = mysql_query("UPDATE themes SET applied=0 WHERE uid=$uid");
$res = mysql_query("UPDATE themes SET applied=1 WHERE uid=$uid AND id=$tid");
if($res)
{echo "<img src=\"images/ok.gif\" alt=\"O\"/>Theme Applied Sucessfully!<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}else
{echo "<img src=\"images/notok.gif\" alt=\"x\"/>Database Error! Try Again Later.<br/><br/><a href=\"index.php?action=mainthm&sid=$sid\">Themes Menu</a>";
}
}
///////////////////////POLL/////////////////////
else if($action=="pltpc")
{
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Creating Poll","");
if((getpoints($sid)>=50)||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 Eroor!";
}
}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 Have A poll";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>You should have at least 500 plusses to create a poll";
}
echo "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a><br/>";
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
$fname=getfname($tfid[0]);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$tfid[0]\">Back To $fname Forum</a>";
}
else if($action=="votepl")
{
$plid = $_GET["plid"];
$ans = $_GET["ans"];
addonline(getuid_sid($sid),"Poll Voting ;)","");
$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\"/>Thanx for your 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";
}
}
else if($action=="dlpoll")
{
addonline(getuid_sid($sid),"Deleting Poll","");
$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_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 "<a href=\"index.php?action=poll&sid=$sid\">Back To Poll</a>";
}
else if($action=="dltpl")
{
$tid = $_GET["tid"];
addonline(getuid_sid($sid),"Deleting Poll","");
$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 "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$tid\">Back To Topic</a><br/>";
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
$fname=getfname($tfid[0]);
echo "<a href=\"index.php?action=viewfrm&sid=$sid&fid=$tfid[0]\">Back To $fname Forum</a>";
}
else if($action=="crpoll")
{
addonline(getuid_sid($sid),"Creating Poll","");
if(getpoints($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 Eroor!";
}
}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 plusses to create a poll";
}
echo "<a href=\"index.php?action=poll&sid=$sid\">Back To Poll</a>";
}
else{
echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Main Menu</a>";
}
echo "</center>";
boxend();
getfooter($sid);
?>
</font></body>
</html>