PHP Code:
<?
// -------------------------------------------------------------------------------------
$EnableGZipEncoding = true;
// -------------------------------------------------------------------------------------
// Helper function to detect if GZip is supported by client!
// If not supported the tricks are pointless
function acceptsGZip(){
$accept = str_replace(" ","",
strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])
);
$accept = explode(",",$accept);
return in_array("gzip",$accept);
}
// -------------------------------------------------------------------------------------
function playWithHtml($OutputHtml){
// This will mess up HTML code like my site has done!
// View the source to understand! All ENTERs are removed.
// If your site has PREformated code this will break it!
// Use regexp to find it and save it and place it back ...
// or just uncomment the next line to keep enters
// return $OutputHtml;
return preg_replace("/\s+/"," ",$OutputHtml);
}
// -------------------------------------------------------------------------------------
function obOutputHandler($OutputHtml){
global $EnableGZipEncoding;
//-- Play with HTML before output
$OutputHtml = playWithHtml($OutputHtml);
//-- If GZIP not supported compression is pointless.
// If headers were sent we can not signal GZIP encoding as
// we will mess it all up so better drop it here!
// If you disable GZip encoding to use plain output buffering we stop here too!
if(!acceptsGZip() || headers_sent() || !$EnableGZipEncoding) return $OutputHtml;
//-- We signal GZIP compression and dump encoded data
header("Content-Encoding: gzip");
return gzencode($OutputHtml);
}
// This code has to be before any output from your site!
// If output exists uncompressed HTML will be delivered!
ob_start("obOutputHandler");
// -------------------------------------------------------------------------------------
?>
<?php
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<?php
include("../blocked.php");
include("config.php");
include("core.php");
connectdb();
$action = cleanQuery($_GET["action"]);
$sid = cleanQuery($_GET["sid"]);
$id=isnum((int)$_GET["id"]);
$rid=isnum((int)$_GET["rid"]);
$rpw=cleanQuery($_GET["rpw"]);
$play =cleanQuery($_GET["play"]);
$who = isnum((int) $_GET['who']);
$uid =cleanQuery(getuid_sid($sid));
$uexist = isuser($uid);
$ubr = cleanQuery(browser_agent($_SERVER["HTTP_USER_AGENT"]));
$uip = cleanQuery(get_real_ip());
$name = mysql_fetch_array(mysql_query("SELECT uid FROM sanju_crek WHERE uid='".getuid_sid($sid)."'"));
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
if((islogged($sid)==false)||!$uexist)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<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 "</center>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot enter !<br/>please try again later...<br/><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
$isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'"));
if($isroom[0]==0)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>Room Doesn't Exist</b><br/><br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
$passworded = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'"));
if($passworded[0]!="")
{
if($rpw!=$passworded[0])
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>Wrong Password!</b><br/>";
echo "You can't enter this room<br/><br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
}
if(!canenter($rid,$sid))
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>Permission denied!</b><br/><br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
echo "</center>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
$validated=mysql_fetch_array(mysql_query("SELECT validated FROM ibwf_users WHERE id='".$uid."'"));
if($validated[0]==0)
{
echo "<head>";
echo "<title>Error!!!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$nickk = getnick_sid($sid);
echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
echo "<b>Ur Account is Not Validated Yet</b><br/>";
$totaltimeonline = mysql_fetch_array(mysql_query("SELECT tottimeonl FROM ibwf_users WHERE id='".$uid."'"));
$num = $totaltimeonline[0]/86400;
$days = intval($num);
$num2 = ($num - $days)*24;
$hours = intval($num2);
$num3 = ($num2 - $hours)*60;
$mins = intval($num3);
$num4 = ($num3 - $mins)*60;
$secs = intval($num4);
echo "<b>Your online time:</b> ";
if(($days==0) and ($hours==0) and ($mins==0)){
echo "$secs seconds<br/>";
}else
if(($days==0) and ($hours==0)){
echo "$mins mins, ";
echo "$secs seconds<br/>";
}else
if(($days==0)){
echo "$hours hours, ";
echo "$mins mins, ";
echo "$secs seconds<br/>";
}else{
echo "$days days, ";
echo "$hours hours, ";
echo "$mins mins, ";
echo "$secs seconds<br/>";
}
echo "<br/>You have to Spend at least<u> 20 mins online</u> to get validated ur account. Plz be patient try again this option after 20 Minutes online here..Untill then Explorer and Enjoy other features in Commmunity.<br/>thank you!<br/><br/>";
echo "<br/><b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a><br/>";
echo forumlink($sid,9);
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////////////////////////////////////////////////////////
if ($action=="jnpc"){
echo "<head>";
echo "<title>J N P</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
$who = isnum((int)$_POST["who"]);
$bet =isnum((int)$_POST["bet"]);
$kamay =cleanQuery($_POST["kamay"]);
$tnick = getnick_uid($who);
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
if($uid==$who){
echo "Dont be so stupid to challenge your self!<br/>";
}else{
if($bet>=100){
echo "We accept under 100 bet to make a challenge!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
if($bet<=0){
echo "We accept above 0 bet to make a challenge!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
else{
if(chall($uid,$who)){
echo "You have a pending challenge<br/>";
}else{
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
if($gpsf[0]>=$bet){
if($gpst[0]>=$bet){
$res = mysql_query("INSERT INTO ibwf_jnp SET touid='".$who."', byuid='".$uid."', hand='".$kamay."', reply='1', bet='".$bet."', actime='".time()."'");
if($res){
echo "Challenge with $bet Sent to $tnick<br/>";
}else{
echo "Database error<br/>";
}}else{
echo "Either you Or the recipient has insufficient Points to complete this request!<br/>";
}}else{
echo "Either you Or the recipient has insufficient Points to complete this request!<br/>";
}}}}
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////////////////////////////////////////////////////
else if ($action=="jnp"){
$who = isnum((int)$_POST["who"]);
$kamay =cleanQuery($_POST["kamay"]);
$poy =cleanQuery($_POST["poy"]);
echo "<head>";
echo "<title>JNP Game</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
if($uid==$who){
echo "Dont be so stupid to challenge your self!<br/>";
}else{
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
$number = mysql_fetch_array(mysql_query("SELECT hand, bet FROM ibwf_jnp WHERE id='".$poy."'"));
$number2 = $number[0];
$bet2 = $number[1];
$plus = $number[1];
if($gpsf[0]>=$bet2){
if($gpst[0]>=$bet2){
$unick = getnick_uid($uid);
if ($kamay=="1"){
$pchoice = "Paper";
if ($number2 =="1"){
$cchoice = "Paper";
echo_scores2($uid,$poy,$pchoice,$cchoice,drew);
$msg = "Challenge draw with $unick!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="2"){
$cchoice = "Scissors";
echo_scores2($uid,$poy,$pchoice,$cchoice,lost);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$who."'");
echo "$number[1] plusses has been deducted to your account";
$msg = "You Own The Chalange with $unick in your jack en poy challenge, and you got $plus plusses."."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="3"){
$cchoice = "Rock";
echo_scores2($uid,$poy,$pchoice,$cchoice,won);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$who."'");mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$uid."'");
echo "You won $plus Points added to your account!";
$msg = "You loss The Chalange with $unick $number[1] Points has been deducted form your account!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 ==""){
echo "Not in game!";
}}if ($kamay=="2"){
$pchoice = "Scissors";
if ($number2 =="1"){
$cchoice = "Paper";
echo_scores2($uid,$poy,$pchoice,$cchoice,won);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$who."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$uid."'");
echo "You won $plus Points added to your account!";
$msg = "You defeated by $unick $number[1] Points has been deducted!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="2") {
$cchoice = "Scissors";
echo_scores2($uid,$poy,$pchoice,$cchoice,drew);
$msg = "Challenge draw with $unick!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="3"){
$cchoice = "Rock";
echo_scores2($uid,$poy,$pchoice,$cchoice,lost);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$who."'");
$msg = "You defeated $unick in your jack en poy challenge and you got $plus plusses."."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 ==""){
echo "Not in game!";
}}
if ($kamay=="3"){
$pchoice = "Rock";
if ($number2 =="1"){
$cchoice = "Paper";
echo_scores2($uid,$poy,$pchoice,$cchoice,lost);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$who."'");
$msg = "You defeated $unick in your jack en poy challenge and you got $plus Points."."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="2"){
$cchoice = "Scissors";
echo_scores2($uid,$poy,$pchoice,$cchoice,won);
mysql_query("UPDATE ibwf_users SET plusses=plusses-'$number[1]' WHERE id='".$who."'");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$plus' WHERE id='".$uid."'");
echo "You won $plus Points added to your account!";
$msg = "You defeated by $unick $number[1] Points has been deducted!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}else if ($number2 =="3") {
$cchoice = "Rock";
echo_scores2($uid,$poy,$pchoice,$cchoice,drew);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
$msg = "Challenge draw with $unick!"."";
autopm($msg, $who);
}else if ($number2 ==""){
echo "Not in game!";
}}if ($kamay == 0) {
if($kamay==0){
$msg = "declined";
}else{
$msg = "";
}echo "Challenge declined!<br/>";
$msg = "".getnick_uid(getuid_sid($sid))." has $msg to your challenge!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE touid='".$uid."' AND byuid='".$who."'");
}}else{
echo "Either you Or the recipient has insufficient Points to complete this request!<br/>";
$msg = "Either you Or the recipient has insufficient Points to complete this request!"."";
autopm($msg, $who);
mysql_query("DELETE FROM ibwf_jnp WHERE id='".$poy."'");
}}else{
echo "Either you Or the recipient has insufficient Points to complete this request!<br/>";
}}
echo "<br/><a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
//////////////////////////////////////////////////////////////////////////////////////
if ($action=="card1"){
echo "<head>";
echo "<title>3 Amigoz Cafe</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$who = cleanQuery($_POST["who"]);
$bet =isnum($_POST["bet"]);
$kamay =cleanQuery($_POST["kamay"]);
$tnick = getnick_uid($who);
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
if($uid==$who){
echo "Dont be so stupid to challenge your self!<br/>";
}else{
if($bet>=100){
echo "We accept under 100 bet to make a challenge!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
if($bet<=0){
echo "We accept above 0 bet to make a challenge!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
else{
if(chall1($uid,$who)){
echo "You have a pending challenge<br/>";
}else{
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
if($gpsf[0]>=$bet){
if($gpst[0]>=$bet){
$rn = mt_rand(1,52);
$rn1 = mt_rand(1,52);
$rn2 = mt_rand(1,52);
$rema = $pmfl - $tm;
$total = $rn+$rn1+$rn2;
$ing ="<img src=\"../cards/$rn.png\" alt=\"Card\">";
$ing1 ="<img src=\"../cards/$rn1.png\" alt=\"Card\">";
$ing2 ="<img src=\"../cards/$rn2.png\" alt=\"Card\">";
$res = mysql_query("INSERT INTO ibwf_cgame SET touid='".$who."', byuid='".$uid."', hand='".$total."', reply='1', bet='".$bet."', actime='".time()."'");
if($res){
echo "Your Cards are:<br/>
<center>$ing1$ing$ing2<br/>
Challenge with $bet Points Sent to $tnick Your Taken Total card Value is <b>$total</b><br/>";
}else{
echo "Database error<br/>";
}}else{
echo "Either you Or the recipient has insufficient plusses to complete this request!<br/>";
}}else{
echo "Either you Or the recipient has insufficient Points to complete this request!<br/>";
}}}}
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
////////////////////////////////////////////////////////////////////////////////////////
else if ($action=="card"){
echo "<head>";
echo "<title>3 Amigoz Cafe</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$who = $_POST["who"];
$bet =isnum($_POST["bet"]);
$kamay =$_POST["ans"];
$rid =$_GET["rid"];
$tnick = getnick_uid($who);
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$nam =getnick_uid($uid);
$ncl = mysql_fetch_array(mysql_query("SELECT id, bet, byuid, touid FROM ibwf_cgame WHERE touid='".$uid."' ORDER BY id DESC LIMIT 1"));
$by = getnick_uid($ncl[2]);
if(!chall1($uid,$who)){
echo "Dont be so stupid to You Already Accepted challenge !<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
if ($kamay == 1){
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
$card = mysql_fetch_array(mysql_query("SELECT hand FROM ibwf_cgame WHERE touid='".$uid."'"));
if($gpsf[0]>=$bet){
$rn = mt_rand(1,52);
$rn1 = mt_rand(1,52);
$rn2 = mt_rand(1,52);
$total = $rn+$rn1+$rn2;
$ing ="<img src=\"../cards/$rn.png\" alt=\"Card\">";
$ing1 ="<img src=\"../cards/$rn1.png\" alt=\"Card\">";
$ing2 ="<img src=\"../cards/$rn2.png\" alt=\"Card\">";
if($total>$card[0]){
$result= Win;
mysql_query("UPDATE ibwf_users SET plusses=$gpst[0]-'$bet' WHERE id='".$who."'");
mysql_query("UPDATE ibwf_users SET plusses=$gpsf[0]+'$bet' WHERE id='".$uid."'");
mysql_query("DELETE FROM ibwf_cgame WHERE touid='".$uid."'");
}else{
$result= Loss;
mysql_query("UPDATE ibwf_users SET plusses=$gpst[0]+'$bet' WHERE id='".$who."'");
mysql_query("UPDATE ibwf_users SET plusses=$gpsf[0]-'$bet' WHERE id='".$uid."'");
mysql_query("DELETE FROM ibwf_cgame WHERE touid='".$uid."'");
}
mysql_query("INSERT INTO ibwf_chat SET chatter='5', who='', timesent='".time()."', msgtext='[b]$nam [/b] $result the Card Chalange With $by and $bet Point transfred to Winner Account Secsesfuly!', rid='".$rid."';");
echo "Challenge with $bet Points Acepted !! Your Taken cards are<br/>
<center>$ing1$ing$ing2<br/>
Total Value of Your Cards $total<br/>
$tnick Card Value Was $card[0]<br/>As per result of the game You have $result !!!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
}
}else{
echo "You Have Sucessfully Dinie The challenge with $by!<br/><b>Thank You</b><br/>";
mysql_query("INSERT INTO ibwf_chat SET chatter='5', who='', timesent='".time()."', msgtext='[b]$nam [/b] Refused the Card Chalange With $by !!!', rid='".$rid."';");
mysql_query("DELETE FROM ibwf_cgame WHERE touid='".$uid."'");
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}}
if ($action=="card3"){
echo "<head>";
echo "<title>3 Amigoz Cafe</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$bet =isnum($_POST["bet"]);
if($bet<=0){
echo "<center>We accept above 0 Point to Start the Game!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}if($bet>=100){
echo "<center>We accept Maximum 100 Point For a Card!<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}else{
$game=mysql_fetch_array(mysql_query("SELECT id, point FROM ibwf_cgame1"));
if($game[1]>9){
echo "A Game is Running Now, You Cannot start A new Game!!";
}else{
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
if($gpsf[0]>=$bet){
$rn = mt_rand(1,52);
$rn1 = mt_rand(1,52);
$rn2 = mt_rand(1,52);
$tm = time();
$tm1 = time()+60;
$rema = $tm1 - $tm;
$total = $rn+$rn1+$rn2;
$uid = getuid_sid($sid);
$ing ="<img src=\"../cards/$rn.png\" alt=\"Card\">";
$ing1 ="<img src=\"../cards/$rn1.png\" alt=\"Card\">";
$ing2 ="<img src=\"../cards/$rn2.png\" alt=\"Card\">";
$res = mysql_query("INSERT INTO ibwf_cgame1 SET point='".$bet."', startpoint='".$bet."', winner='".$uid."', start='$tm1'");
$res = mysql_query("UPDATE ibwf_chonline SET point='$total', player='1' WHERE uid='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET plusses=$gpsf[0]-'".$bet."' WHERE id='".$uid."'");
if($res){
echo "<center>Game Sucsessfully Started!!<br/>Your Cards are:<br/>
<center>$ing$ing1$ing2<br/>
Your Taken Total card Value is <b>$total</b><br/>";
}else{
echo "Database error<br/>";
}}else{
echo "You have insufficient Points to complete this request!<br/>";
}}}
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////////////////////////////////////////////////////////////////////////////////////////
if ($action=="card2"){
echo "<head>";
echo "<title>3 Amigoz Cafe</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$uid = getuid_sid($sid);
$pcard = mysql_fetch_array(mysql_query("SELECT point, player FROM ibwf_chonline WHERE uid='".$uid."'"));
if($pcard[1]=="1")
{
echo "Dont be so stupid to You Already Purchaseed card !<br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>Back to Room</b></a><br/>";
exit();
}
$game=mysql_fetch_array(mysql_query("SELECT id, point, startpoint, winner FROM ibwf_cgame1"));
$bet =$game[2];
$gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$win=mysql_fetch_array(mysql_query("SELECT uid, player, point FROM ibwf_chonline where uid='".$game[3]."'"));
if($game[2]<10){
echo "<b>Game Is Over!!!</b><br/>You Can Start A New Game...<br/>";
}else{
if($gpsf[0]>=$bet){
$rn = mt_rand(1,52);
$rn1 = mt_rand(1,52);
$rn2 = mt_rand(1,52);
$ing ="<img src=\"../cards/$rn.png\" alt=\"Card\">";
$ing1 ="<img src=\"../cards/$rn1.png\" alt=\"Card\">";
$ing2 ="<img src=\"../cards/$rn2.png\" alt=\"Card\">";
$rema = $pmfl - $tm;
$total = $rn+$rn1+$rn2;
$uid = getuid_sid($sid);
if($win[2]<$total){
mysql_query("UPDATE ibwf_cgame1 SET winner='$uid'");
}else{}
$g=mysql_fetch_array(mysql_query("SELECT point FROM ibwf_cgame1"));
$new =$g[0]+$game[2];
$res = mysql_query("UPDATE ibwf_cgame1 SET point='$new'");
$res = mysql_query("UPDATE ibwf_chonline SET point='$total', player='1' WHERE uid='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET plusses=$gpsf[0]-'".$bet."' WHERE id='".$uid."'");
if($res){
echo "<center>You have Sucsessfully Participate. Thank You!!<br/>Your Cards are:<br/>
<center>$ing$ing1$ing2<br/>
Your Taken Total card Value is <b>$total</b><br/>";
}else{
echo "Database error<br/>";
}}else{
echo "You have insufficient Points to complete this request!<br/>";
}}
echo "<br/><a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw&type=send&time=$time\"><b>back to room</b></a><br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
////////////////////////////////////////////////////////////////////////////////////////
if($rid==971){
echo "<head>";
echo "<title>3 Amigoz Cafe</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
$st = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='switch'"));
if ($st[0]==off){
echo "<hr/><center>This Room Is Not Active Now, Please Wait, Room Will Be Active When QuizMaster will be Ready! If You Wana Play With our Last 24 Hour Question, Then Send a request to Owner.<br/><b><blink>Thank You!</blink></b><br/><a href=\"index.php?action=main&sid=$sid\">Home</a></center>";
echo "<hr/>";
exit();
}else{
$range_result = mysql_query( " SELECT MAX(`id`) AS max_id , MIN(`id`) AS min_id FROM `ibwf_quiz` ");
$range_row = mysql_fetch_object( $range_result );
$random = mt_rand( $range_row->min_id , $range_row->max_id );
$result = mysql_query( " SELECT question, answer, id FROM `ibwf_quiz` WHERE `id` >= $random LIMIT 0,1 ");
while($rpgds=mysql_fetch_array($result)){
$winner =$rpgds[0];
$winner2 =$rpgds[1];
}
$tm = time();
$time = mysql_fetch_array(mysql_query("SELECT MAX(displaytime) FROM ibwf_quizrooms ORDER by id LIMIT 1"));
$pmfl = $time[0]+60;
if($pmfl<$tm){
mysql_query("INSERT INTO ibwf_chat SET chatter='5', who='', timesent='".time()."', msgtext='[b]Next question Sabmited...[/b]', rid='".$rid."';");
mysql_query("INSERT INTO ibwf_quizrooms SET displaytime='".time()."', question='".$winner."', answer='".$winner2."';");
}else{
$quiz = mysql_query("SELECT question, answer, id FROM ibwf_quizrooms ORDER BY id DESC LIMIT 1");
while($rpgds=mysql_fetch_array($quiz)){
$question =$rpgds[0];
$question2 =$rpgds[1];
$question3 =$rpgds[2];
}
echo "<center><b><blink>--Question Now--</blink><br/><font color=\"blue\">$question</font></b><br/>";
$rema = $pmfl - $tm;
if ($rema==60){
$kano ="60";
}else if ($rema==59){
$kano ="59";
}else if ($rema==58){
$kano ="58";
}else if ($rema==57){
$kano ="57";
}else if ($rema==56){
$kano ="56";
}else if ($rema==55){
$kano ="55";
}else if ($rema==54){
$kano ="54";
}else if ($rema==53){
$kano ="53";
}else if ($rema==52){
$kano ="52";
}else if ($rema==51){
$kano ="51";
}else if ($rema==50){
$kano ="50";
}else if ($rema==49){
$kano ="49";
}else if ($rema==48){
$kano ="48";
}else if ($rema==47){
$kano ="47";
}else if ($rema==46){
$kano ="46";
}else if ($rema==45){
$kano ="45";
}else if ($rema==44){
$kano ="44";
}else if ($rema==43){
$kano ="43";
}else if ($rema==42){
$kano ="42";
}else if ($rema==41){
$kano ="41";
}else if ($rema==40){
$kano ="40";
}else if ($rema==39){
$kano ="39";
}else if ($rema==38){
$kano ="38";
}else if ($rema==37){
$kano ="37";
}else if ($rema==36){
$kano ="36";
}else if ($rema==35){
$kano ="35";
}else if ($rema==34){
$kano ="34";
}else if ($rema==33){
$kano ="33";
}else if ($rema==32){
$kano ="32";
}else if ($rema==31){
$kano ="31";
}else if ($rema==30){
$kano ="30";
}else if ($rema==29){
$kano ="29";
}else if ($rema==28){
$kano ="28";
}else if ($rema==27){
$kano ="27";
}else if ($rema==26){
$kano ="26";
}else if ($rema==25){
$kano ="25";
}else if ($rema==24){
$kano ="24";
}else if ($rema==23){
$kano ="23";
}else if ($rema==22){
$kano ="22";
}else if ($rema==21){
$kano ="21";
}else if ($rema==20){
$kano ="20";
}else if ($rema==19){
$kano ="19";
}else if ($rema==18){
$kano ="18";
}else if ($rema==17){
$kano ="17";
}else if ($rema==16){
$kano ="16";
}else if ($rema==15){
$kano ="15";
}else if ($rema==14){
$kano ="14";
}else if ($rema==13){
$kano ="13";
}else if ($rema==12){
$kano ="12";
}else if ($rema==11){
$kano ="11";
}else if ($rema==10){
$kano ="10";
}else if ($rema==9){
$kano ="9";
}else if ($rema==8){
$kano ="8";
}else if ($rema==7){
$kano ="7";
}else if ($rema==6){
$kano ="6";
}else if ($rema==5){
$kano ="5";
}else if ($rema==4){
$kano ="4";
}else if ($rema==3){
$kano ="3";
}else if ($rema==2){
$kano ="2";
}else if ($rema==1){
$kano ="1";
}else if ($rema==0){
$kano ="0";
}
echo "Time Left to answer:$rema seconds.You can Win: $kano Point!</b>";
}}}if($rid>0){
$uid = getuid_sid($sid);
$nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_jnp WHERE touid='".$uid."' AND reply='1'"));
if($nopop[0]>0){
$ncl = mysql_fetch_array(mysql_query("SELECT id, bet, byuid, touid FROM ibwf_jnp WHERE touid='".$uid."' ORDER BY id DESC LIMIT 1"));
$by = getnick_uid($ncl[2]);
echo "Jack en Poy challenge from $by BET: $ncl[1]<br/>";
echo "<form action=\"chat.php?action=jnp&rid=$rid&sid=$sid&time=$time\" method=\"post\">";
echo "JNP Challenge: <select name=\"kamay\">";
echo "<option value=\"0\">Decline</option>";
echo "<option value=\"1\">Paper</option>";
echo "<option value=\"2\">Scissors</option>";
echo "<option value=\"3\">Rock</option>";
echo "</select>";
echo "<input type=\"hidden\" name=\"who\" value=\"$ncl[2]\"/>";
echo "<input type=\"hidden\" name=\"poy\" value=\"$ncl[0]\"/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form>";
}}
/////////////////////////////////////////////////////////////////////////////////////
////////
if($rid==1149){
$uid = getuid_sid($sid);
$player=mysql_fetch_array(mysql_query("SELECT uid, player, point FROM ibwf_chonline where uid='".$uid."'"));
$game=mysql_fetch_array(mysql_query("SELECT id, point, startpoint, winner FROM ibwf_cgame1"));
$tm = time();
$dam = $game[2];
$time = mysql_fetch_array(mysql_query("SELECT start FROM ibwf_cgame1"));
$rm = $time[0]-time();
if($rm>0){
$msg="Time Left to Purchase Card: $rm seconds.";
}else{
$msg="<b>Game Over!!</b>";
}if($time[0]>0){
if($time[0]<time()){
$mem = mysql_fetch_array(mysql_query("SELECT uid, player, point FROM ibwf_chonline ORDER BY point DESC LIMIT 0,1 "));
$winer=getnick_uid($game[3]);
$pl=getplusses($uid);
$points=$mem[2];
$prize=$game[1];
$plus = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$game[3]."'"));
$op = $plus[0];
$np = $op+$prize;
$r=mysql_query("DELETE FROM ibwf_cgame1 WHERE id>0");
$r=mysql_query("UPDATE ibwf_chonline SET point='', player='0' WHERE uid>0");
$r=mysql_query("UPDATE ibwf_users SET plusses='$np' WHERE id='".$game[3]."'");
if($r){
mysql_query("INSERT INTO ibwf_chat SET chatter='5', who='', timesent='".time()."', msgtext='Card Game Over!!...winner of the game is[b] $winer [/b]Winner card value was $points as reward $prize point deposited to winner account!', rid='".$rid."';");
}else{
}}}if($game[1]<10){
$pl=getplusses($uid);
echo "<form action=\"chat.php?action=card3&sid=$sid&rid=$rid&time=$time\" method=\"post\">";
echo "<center>You Have<b> $pl </b>Points!<br/>Bet Ur Amount: <input name=\"bet\" maxlength=\"3\" size=\"3\" format=\"*N\"/>";
echo "<input type=\"submit\" value=\"Start A Game\"/>";
echo "</form><hr></center>";
echo "<center><a accesskey=\"6\" href=\"chat.php?action=ghelp&sid=$sid&rid=$rid&rpw=$rpw\">How to Play[Help]</a></center><br/>";
}else if($player[1]==0){
$pl=getplusses($uid);
echo "<center>You Have<b> $pl </b>Points!<br/><b><blink>Game Ranning!</blink></b><br/>To Win <b>$game[1]</b> Points
<a href=\"chat.php?action=card2&sid=$sid&rid=$rid&time=$time\" method=\"post\"><b>Purchase</b></a> Your Cards for $dam point<br/>$msg<br/></center>";
}else{
$pl=getplusses($uid);
echo "<center>You Have<b> $pl </b>Points!<br/>Your Total Card Value <b>$player[2]</b>!!<br/>
Game Ranning for $game[1] Points!!<br/>$msg<br/></center>";
}}if($rid>0){
$uid = getuid_sid($sid);
$nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_cgame WHERE touid='".$uid."' AND reply='1'"));
if($nopop[0]>0){
$ncl = mysql_fetch_array(mysql_query("SELECT id, bet, byuid, touid FROM ibwf_cgame WHERE touid='".$uid."' ORDER BY id DESC LIMIT 1"));
$by = getnick_uid($ncl[2]);
echo "You Hv Invited for Card Chalange by $by And bet Amount for the Game $ncl[1] Points<br/>";
echo "<form action=\"chat.php?action=card&rid=$rid&sid=$sid&time=$time\" method=\"post\">";
echo "Please Select: <select name=\"ans\">";
echo "<option value=\"1\">Accept</option>";
echo "<option value=\"0\">Decline</option>";
echo "</select>";
echo "<input type=\"hidden\" name=\"who\" value=\"$ncl[2]\"/>";
echo "<input type=\"hidden\" name=\"bet\" value=\"$ncl[1]\"/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form>";
}}
////////////////////////////////////////////////////////////////////////////////////////////////////
addtochat($uid, $rid);
$timeto = 900;
$timenw = time();
$timeout = $timenw-$timeto;
$deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
$timeout=time()-600;
$deloff = mysql_query("DELETE FROM ibwf_cgame WHERE actvtime <'".$timeout."'");
$nick = getnick_sid($sid);
/////////
if ($action=="")
{
echo "<onevent type=\"onenterforward\">";
echo "<refresh>
<setvar name=\"message\" value=\"\"/>
";
echo "</refresh></onevent>";
echo "<head>";
echo "<title>$nick@$rname</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
$unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'"));
if ($unreadpopup[0]<1)
{
echo "<meta http-equiv=\"refresh\" content=\"160; url=chat.php?time=";
echo "".date("dmHis")."";
echo "&sid=$sid&rid=$rid&rpw=$rpw\">";
}
echo "</head>";
echo "<body>";
addonline($uid,"Chating in $rname","chat.php?rid=$rid");
//echo "<p>";
echo "<div class=\"logo\">$rname</b></div>";
echo"<hr/>";
echo "<center>";
echo popup($sid);
$nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
echo "<b>Coins:</b> $nopl[0]<br/>";
echo "Indian Time: ".date("g:i:s a")."<br/>";
$sml = mysql_fetch_array(mysql_query("SELECT hvia FROM ibwf_users WHERE id='".$uid."'"));
if($sml[0]=="1")
{
echo "<b>New</b><a href=\"genproc.php?action=shsml&sid=$sid&act=dis\">[Off Smilies</a>/";
}else{
echo "<b>New</b><a href=\"genproc.php?action=shsml&sid=$sid&act=enb\">[On Smilies</a>/";
}
echo "<a href=\"search.php?action=sm&sid=$sid\">Search Smilies]</a><br/>";
echo "[<a name=\"top\" id=\"top\" href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">Write Msg!</a>|";
echo '<a href="#down" style="color: #ff0000;">Go Down</a>|';
echo "<a name=\"opt\" id=\"opt\"></a>";
echo "<a accesskey=\"*\" href=\"chat.php?time=";
echo "".date("dmHis")."";
echo "&sid=$sid&rid=$rid&rpw=$rpw\">Refresh</a> | ";
$chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
echo "<a accesskey=\"1\" href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">Inside($chatters[0])</a>]</center><hr/>";
echo "<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\">";
echo "<p><input name=\"message\" type=\"text\" maxlength=\"250\"/><br/>";
echo "<input type=\"Submit\" Name=\"sy2\" value=\"[Say]\"></form> <br/>";
echo "<img src=\"../love.php\" alt=\"X\"/><br/>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
$unrd="".$unreadinbox[0]."";
if ($unreadinbox[0]>0)
{
echo "<b>5 </b><a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
}
/////////////
//echo "</p>";
$message=cleanQuery($_POST["message"]);
$who = cleanQuery($_POST["who"]);
$rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
if (trim($message) != "")
{
if(!isblocked($message,$uid))
{
$tm = time();
$last = mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM ibwf_chat WHERE chatter='".$uid."'"));
$pmfl = $last[0]+10;
if($pmfl>$tm)
{
}else{
$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");
$lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");
$uuid = getnick_uid($uid);
$wwho = getnick_uid($who);
$alli = "by: ".$uuid."
msg to: ".$wwho."
msg: ".$message."
----------";
if(trim($uid)!=""){
$fname = "chatlog/".$uuid.".txt";
$out = fopen($fname,"a+");
fwrite($out,$alli);
fclose($out);}
$hehe=mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$uid."'"));
$totl = $hehe[0]+1;
$msgst= mysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
$hehe2=mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$totl2 = $hehe2[0]+1;
$msgst= mysql_query("UPDATE ibwf_users SET plusses='".$totl2."' WHERE id='".$uid."'");
}
}else{
$bantime = time() + (06*01*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Msg<br/><br/>";
echo "You just tried sending a msg with a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
$user = getnick_sid($sid);
mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>".getnick_uid(1)."</b> auto banned $user for spamming chat', actdt='".time()."'");
mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
mysql_query("INSERT INTO ibwf_private SET text='[b](forwarded spam via Chat)[/b][br/]".$message."', byuid='".$uid."', touid='1', timesent='".time()."'");
mysql_query("DELETE FROM ibwf_ses WHERE uid='".$uid."'");
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
if($rinfo[1]==2)
{
//oh damn i gotta post this message to ravebabe :(
//will it succeed?
$botid = "b63965252e340f2d";
$hostname = "www.pandorabots.com";
$hostpath = "/pandora/talk-xml";
$sendData = "botid=".$botid."&input=".urlencode($message)."&custid=".$custid;
$result = PostToHost($hostname, $hostpath, $sendData);
$pos = strpos($result, "custid=\"");
$pos = strpos($result, "<that>");
if ($pos === false) {
$reply = "";
} else {
$pos += 6;
$endpos = strpos($result, "</that>", $pos);
$reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos));
$reply = mysql_escape_string($reply);
}
$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='5', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
}
$message = "";
}
echo "<br/>";
$chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed, id FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");
$counter=0;
while($chat = mysql_fetch_array($chats))
{
$canc = true;
if($counter<40)
{
if(istrashed($chat[0])){
if($uid!=$chat[0])
{
$canc = false;
}
}
//////good
if(isignored($chat[0],$uid)){
$canc = false;
}
//////////good
if($chat[0]!=$uid)
{
if($chat[1]!=0)
{
if($chat[1]!=$uid)
{
$canc = false;
}
}
}
if($chat[4]=='1' && ismod($uid))
{
$canc = true;
}
if($canc)
{
$cmid = mysql_fetch_array(mysql_query("SELECT chmood FROM ibwf_users WHERE id='".$chat[0]."'"));
$iml = "";
if(($cmid[0]!=0))
{
$mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM ibwf_moods WHERE id='".$cmid[0]."'"));
$iml = "<img src=\"$mlnk[0]\" alt=\"$mlnk[1]\"/>";
}
$chnick = getnick_uid($chat[0]);
$optlink = $iml.$chnick;
if(($chat[1]!=0)&&($chat[0]==$uid))
{
///out
$iml = "<img src=\"../moods/out.gif\" alt=\"!\"/>";
$chnick = getnick_uid($chat[1]);
$optlink = $iml."Pm To ".$chnick;
}
if($chat[1]==$uid)
{
///out
$iml = "<img src=\"../moods/in.gif\" alt=\"!\"/>";
$chnick = getnick_uid($chat[0]);
$optlink = $iml."Pm By ".$chnick;
}
if($chat[4]=='1')
{
///out
$iml = "<img src=\"../moods/point.gif\" alt=\"!\"/>";
$chnick = getnick_uid($chat[0]);
$tonick = getnick_uid($chat[1]);
$optlink = "$iml By ".$chnick." To ".$tonick;
}
$ds= date("h:i:s a", $chat[2]);
$text = parsepm($chat[3], $sid);
$nos = substr_count($text,"<img src=");
if(isspam($text))
{
$chnick = getnick_uid($chat[0]);
echo addchatmsg($chat[0],$text,1,"*Oi! $chnick, No Spamming!*");
}
else if($nos>3){
$chnick = getnick_uid($chat[0]);
echo addchatmsg($chat[0],$text,1,"*Hey! $chnick, U Can Only Use 3 Smilies Per Msg!*");
}else{
$sres = substr($chat[3],0,3);
if($sres == "/me")
{
$chco = strlen($chat[3]);
$goto = $chco - 3;
$rest = substr($chat[3],3,$goto);
$tosay = parsepm($rest, $sid);
echo addchatmsg($chat[0],$tosay,1,"");
}
else{
if($rinfo[0]==0){$tosay = parsepm($chat[3], $sid, 0);}
else{$tosay = parsepm($chat[3], $sid, 1);}
if($rinfo[1]==1){$tosay = strrev($tosay);}
$avlink = getavatar($chat[0]);
if ($avlink!=""){
$ext = getext($avlink);
$av="<img src=\"../phpThumb/phpThumb.php?src=$avlink&h=34&w=34%20alt=\" width=\"34\" height=\"34\" class=\"online\" alt=\"avatar\"/>";
}else{
$av="";
}
$delid = isnum((int) $chat[5]);
if(isowner($uid))
{$delch = "<a href=\"chat.php?action=delp&sid=$sid&who=$chat[0]&delid=$delid&lstloc=cht&rid=$rid&rpw=$rpw\">[x]</a>";}
echo "$av<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a><b> »</b> ";
echo $tosay." $delch<hr/>";
}
}
$counter++;
}
}
}
echo "<br/>";
echo "<b>» </b><a name=\"down\" id=\"down\" href=\"#top\">Go TOP</a><br/> ";
echo "<b>» </b><a accesskey=\"2\" href=\"lists.php?action=smilies&sid=$sid\">Smilies List</a><br/>";
echo "<b>» </b><a href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">Write Msg!</a> |";
echo "<a href=\"chat.php?action=options&sid=$sid&rid=$rid&rpw=$rpw\">Chat Options</a><br/>";
echo "<b>» </b><a href=\"index.php?action=online&sid=$sid\">Online ".getnumonline()."</a><br/>";
echo "<b>» </b><a href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a href=\"lists.php?action=buds&sid=$sid\">Friends List</a><br/>";
echo "<b>» </b><a href=\"index.php?action=chat&sid=$sid\">Change Room</a><br/>";
echo "<b>» </b><a href=\"index.php?action=main&sid=$sid\">Back To Home</a><br/>";
//include("mkhoj.php");
include("../mojiva.php");
//echo "<br/>";
//include("../admob.php");
echo "</p><hr/>";
echo "<div><b>© SX100</b></div>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////////////////////////////////////////////////////SAY
else if ($action=="say")
{
echo "<head>";
echo "<title>Write Msg</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
addonline($uid,"Writing Chat Msg","");
if(getplusses(getuid_sid($sid))<50)
{
echo "50 Plusses required to chat<br/>";
}else{
echo "<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\">";
echo "<p>Message:<input name=\"message\" type=\"text\" maxlength=\"250\"/><br/>";
echo "<input type=\"Submit\" Name=\"sy2\" value=\"Say\"></form><br/>";
}
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<br/><b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<br/><b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a><hr/>";
include("../mojiva.php");
echo "<br/>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
////////////////////////////////////////////
/////////////////////////////////////////////////////SAY2
else if ($action=="say2") {
echo "<head>";
echo "<title>Send Pm</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$unick = getnick_uid($who);
echo "<b>Send Pm To $unick</b>";
echo "</p>";
if($rid>0){
echo "<form action=\"chat.php?action=jnpc&sid=$sid&rid=$rid&time=$time\" method=\"post\">";
echo "Play JNP Challenge: <select name=\"kamay\">";
echo "<option value=\"1\">Paper</option>";
echo "<option value=\"2\">Scissors</option>";
echo "<option value=\"3\">Rock</option>";
echo "</select>";
echo "<br/>Set BET Amount: <input name=\"bet\" maxlength=\"4\" size=\"3\" format=\"*N\"/><br/>";
echo "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form><hr>";
}
echo "<form action=\"chat.php?action=card1&sid=$sid&rid=$rid&time=$time\" method=\"post\">";
echo "Play Card Challenge:";
echo "<br/>Set BET Amount: <input name=\"bet\" maxlength=\"3\" size=\"3\" format=\"*N\"/><br/>";
echo "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form><hr>";
addonline($uid,"Writing Chat Msg","");
if(getplusses(getuid_sid($sid))<75)
{
echo "75 Plusses required to private pm<br/>";
}else{
echo "<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\">";
echo "<input type=\"Hidden\" name=\"who\" value=\"$who\">";
echo "<p>Message:<input name=\"message\" type=\"text\" maxlength=\"250\"/><br/>";
echo "<input type=\"Submit\" name=\"private\" Value=\"Private\"></form>";
}
echo "<br/>";
if(ismod($uid))
{
echo "<b>* </b><a accesskey=\"*\" href=\"chat.php?action=kickk&sid=$sid&who=$who&lstloc=cht&rid=$rid\">Kick $unick</a><br/>";
echo "<b>* </b><a accesskey=\"*\" href=\"chat.php?action=clear&sid=$sid&who=$who&lstloc=cht&rid=$rid\">Clear Msgs</a><br/>";
}
echo "<br/><b>»</b><a accesskey=\"1\" href=\"index.php?action=viewuser&sid=$sid&who=$who&lstloc=cht&rid=$rid\">View $unick's Profile</a><br/>";
echo "<b>»</b><a accesskey=\"2\" href=\"chat.php?action=expose&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Expose $unick's Msgs</a><br/>";
echo "<b>»</b><a accesskey=\"2\" href=\"chat.php?action=hug&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Hug $unick's </a><br/>";
echo "<b>»</b><a accesskey=\"2\" href=\"chat.php?action=smooch&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Smooch $unick's </a><br/>";
echo "<b>»</b><a accesskey=\"2\" href=\"chat.php?action=kick&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Kick $unick's </a><br/>";
echo "<b>»</b><a accesskey=\"2\" href=\"chat.php?action=poke&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Poke $unick's </a><br/>";
$ires = ignoreres($uid, $who);
if($ires==1)
{
echo "<b>»</b><a href=\"genproc.php?action=ign&who=$who&sid=$sid&todo=add\">Block $unick!</a><br/>";
}
if(isignored($who, $uid))
{
echo "<b>»</b><a href=\"genproc.php?action=ign&who=$who&sid=$sid&todo=del\">UnBlock $unick!</a><br/>";
}
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>»</b><a accesskey=\"»\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
include("../mojiva.php");
include("../admob.php");
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////////////////////////////////////////////////////CHAT OPTIONS
else if ($action=="options")
{
echo "<head>";
echo "<title>Chat Options</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
addonline($uid,"Chat Options","");
echo "<b>»</b><a accesskey=\"1\" href=\"lists.php?action=chmood&sid=$sid&page=1\">Chat Mood</a><br/>";
echo "<br/><b>»</b><a accesskey=\"2\" href=\"lists.php?action=smilies&sid=$sid\">Smilies List</a><br/>";
echo "<b>»</b><a accesskey=\"3\" href=\"index.php?action=cpanel&sid=$sid&rid=$rid&rpw=$rpw\">Settings</a><br/>";
echo "<br/><b>»</b><a accesskey=\"3\" href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">Who's Inside</a><br/>";
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>»</b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<br/><b>»</b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>»</b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<br/><b>»</b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a><br/>";
echo "<b> * </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo "</p>";
include("../mojiva.php");
include("../admob.php");
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
////////////////////////////////////////////
//////////////////////////////inside//////////
else if ($action=="inside") {
addonline($uid,"Viewing Chat UserList","");
echo "<head>";
echo "<title>Chat UserList</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p><br/>";
$inside=mysql_query("SELECT DISTINCT * FROM ibwf_chonline WHERE rid='".$rid."' and uid IS NOT NULL");
while($ins=mysql_fetch_array($inside))
{
$unick = getnick_uid($ins[1]);
$userl = "[<a href=\"chat.php?action=say2&sid=$sid&who=$ins[1]&rid=$rid&rpw=$rpw\"><u> $unick </u></a>]<br/>";
echo "$userl";
}
echo "<br/>";
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<br/><b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a><br/>";
include("../mojiva.php");
echo "<br/>";
include("../admob.php");
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
//////////////////////////////////////////////////////////////////////////////
else if ($action=="expose") {
addonline($uid,"Exposing ChatUser","");
echo "<head>";
echo "<title>Exposing ChatUser</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\"><br/>";
mysql_query("UPDATE ibwf_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'");
$unick = getnick_uid($who);
echo "$unick messages to you have been exposed to staff";
echo "<br/><br/>";
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo mobads();
include("../mojiva.php");
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////
else if(($action=="kickk")&&(ismod($uid)))
{
addonline($uid,"Chat Tools","");
echo "<head>";
echo "<title>Clearing Users Msgs</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\"><br/>";
$trgtnick=getnick_uid($who);
$perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
$trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));
if($trgtperm>$perm){
echo "<b><img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error!!!<br/>Permission Denied...</b><br/>";
echo "<br/>U Cannot Clear $trgtnick's Msgs<br/>";
}else{
if(($who!="")||($who!=0))
{
$textt = "[green][i][b]".getnick_uid($uid)."[/b][/i][i] Kicked ".$trgtnick." -kick- .tongue1. [/i][/green][br/]";
$res = mysql_query("DELETE FROM ibwf_ses WHERE uid='".$who."'");
$res = mysql_query("INSERT INTO ibwf_chat SET chatter='0', who='0', timesent='".time()."', msgtext='".$textt."', rid='".$rid."'");
if($res)
{
echo "$trgtnick kicked<br/>";
}else{
echo "Failed to kick $trgtnick <br/>";
}
}else{
echo "Username doesnot exist<br/>";
}
}
echo "<br/>";
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
//////CHAT FUN ZONE
else if ($action=="hug" || $action=="smooch" || $action=="kick" || $action=="poke")
{
$trgtnick=getnick_uid($who);
echo "<head>";
echo "<title>$trgtnick's Chat Fun Zone</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
if($nopl[0]<600)
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You should have at least 600 game plusses to perform an action on other members<br/><br/>";
}else{
if($uid==$who)
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Why on earth you wanna $action your self?<br/><br/>";
}else{
mysql_query("UPDATE ibwf_users SET plusses=plusses-60 WHERE id='".$uid."'");
echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You just have ".$action."ed $wnick, where did you do that, I'm not gonna tell you <img src=\"../smilies/spiteful.gif\" alt=\"haba\"/><br/><br/>";
echo "60 Coins were subtracted from you<br/><br/>";
$usr = getnick_uid($uid);
if($action==hug)
{
$msgg = "[red][b]$usr ".$action."ed $trgtnick ,hug2,[/b] [/red][br/]";
}else
if($action==smooch)
{
$msgg = "[red][b]$usr ".$action."ed $trgtnick -smooch- [/b][/red][br/]";
}else
if($action==kick)
{
$msgg = "[red][b]$usr ".$action."ed $trgtnick -kick- [/b][/red][br/]";
}else
if($action==poke)
{
$msgg = "[red][b]$usr ".$action."ed $trgtnick -xpoke- [/b][/red][br/]";
}
$res = mysql_query("INSERT INTO ibwf_chat SET chatter='0', who='0', timesent='".time()."', msgtext='".$msgg."', rid='".$rid."'");
}
}
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
///////////
else if ($action=="ghelp")
{
addonline($uid,"3amigoz Game Help","");
echo "<head>";
echo "<title>3amigoz Game Helpr</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<div class=\"logo\"><b><center><u>3Amigoz Help</u></center></b><br/><p align=\"center\"><img src=\"../images/3amigoz.jpeg\" alt=\"*\"/><br/><b>";
echo "What is 3Amigoz??</b><br/>";
echo "<p align=\"center\"><br/>";
echo "3Amigoz is the <u>1st Multiplayer ONLINE game in a Wapsite.</u> in another words, in Millions of wap sites, ONE and ONLY multiplayer Card Game that you can WIN credits!!<br/><br/>";
echo "<b>How to Play it??</b><br/>";
echo "*Any user can start the game Click on <u>Start the Game link</u><br/>";
echo "*Then you can take Play cards.<b><u>(There are 1 to 100 valued Play cards at the game.</u></b> so When u take a card, ur card will be selected as randomly valued of 1 -100)<br/>";
echo "*U can take two cards totally. but it depend on u.(becoz if u think ,ur 1st card high valued card..u dont wanna be worry to take ur second card)<br/>";
echo "* Dont tell wats ur card(s) to other players.<br/><br/>";
echo "<b>How To Win it??</b><br/>";
echo "*Winning of this game depends 50% on ur luck and 50% on ur Skills.<br/>";
echo "*120 seconds to wait to select a Winner<br/>";
echo "*the user who takes <u>maximum Valued card</u> will win<br/><br/>";
echo "<b>how much Credits i will win??</b><br/>";
echo "*It depends on how much cards totally taken by users.<br/>";
echo "at <u>Pot Crdts:</u> field you can see, totally how much credits you can win.<br/>";
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
/////
addonline(getuid_sid($sid),"Chat Tools","");
if($action=="delp")
{
$delid = isnum((int)$_GET["delid"]);
echo "<head>";
echo "<title>Chat Tools</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"left\">";
echo "<b>Chat Tools</b><br/><br/>";
$trgtnick=getnick_uid($who);
$perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
$trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));
if($trgtperm>$perm){
echo "<b><img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error!!!<br/>Permission Denied...</b><br/>";
echo "<br/>U Cannot Clear $trgtnick's Msgs<br/>";
}else{
$res = mysql_query("DELETE FROM ibwf_chat WHERE id='".$delid."'");
if($res)
{
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Chat Post Message Deleted";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error";
}
}
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<br/><br/><b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Go To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\">Home</a></p>";
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
///////////
else if(($action=="clear")&&(ismod($uid)))
{
addonline($uid,"Chat Tools","");
echo "<head>";
echo "<title>Clearing Users Msgs</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\"><br/>";
$trgtnick=getnick_uid($who);
$perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
$trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));
if($trgtperm>$perm){
echo "<b><img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error!!!<br/>Permission Denied...</b><br/>";
echo "<br/>U Cannot Clear $trgtnick's Msgs<br/>";
}else{
if(($who!="")||($who!=0))
{
$res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'");
if($res)
{
echo "$trgtnick msgs have been cleared<br/>";
}else{
echo "Failed clearing $trgtnick msgs<br/>";
}
}else{
echo "Username doesnot exist<br/>";
}
}
echo "<br/>";
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
echo "<b>» </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
echo "<b>» </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
echo "<b>» </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
echo "<b>» </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
echo "</body>";
echo "</html>";
mysql_close();
exit();
}
?>
</html>
please check this CHAT.PHP and help me why jack en poy chat room not working thanks