Chat Admin (lavalair Script)

Started on the old forum in March 2008 · view the original in the archive · old links redirect here

16 replies · 3,169 views · started 18 years ago · 3 min read

12 participants
hypetype Developer · 128 posts #1

the code is below, coded by hypetype, took only couple minutes. jus follow the instructions... thank ya. lol

CODE\\\ THE SQL \\\\


-- -- Table structure for table ibwf_chatadmin

CREATE TABLE ibwf_chatadmin ( id int(100) NOT NULL auto_increment, uid int(100) NOT NULL default '0', PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8;

-- -- Dumping data for table ibwf_chatadmin

INSERT INTO ibwf_chatadmin (id, uid) VALUES (1, 1);

\\\\\\\\\\ ADD THIS TO core.php \\\\\\\\\\

////////////////////////////////////////////is chat admin

function ischatadmin($uid) { //$chatadmin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid='".$uid."'"));

if($chatadmin[0]>0) { return true; } }

\\\\\\\\\\\\\\\\\\ ADD THIS TO chat.php (in action say2) \\\\\\\\\\\\\\\\\\
$uid = getuid_sid($sid); $chatadmin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid='".$uid."'")); if($chatadmin[0]>0) { echo "<a href="index.php?action=cadmin&sid=$sid&who=$who">+Trash $unick</a> "; }

\\\\\\\\\\\\\\\\
ADD THIS TO admincp.php (in acui) \\\\\\\\\\\\\\\\
$cadmn = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid='".$tid."'")); if($cadmn[0]>0) { echo "<a href="admproc.php?action=delchat&sid=$sid&who=$tid">»Disable Chat Admin</a> "; }else{ echo "<a href="admproc.php?action=addchat&sid=$sid&who=$tid">»Enable Chat Admin</a> "; }

\\\\\\\\\\\\\\\\
ADD THIS TO admproc.php \\\\\\\\\\\\\\\\
else if($action=="addchat") { $who = $_GET["who"]; echo "<card id="main" title="$sitename">"; echo " "; echo " "; $res = mysql_query("INSERT INTO ibwf_chatadmin SET uid='".$who."'");

	if($res)
  {
	echo "<img src=\"images/ok.gif\" alt=\"O\"/>Chat Admin  added successfully";
  }else{
	echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error adding Chat Admin ";
  }

  echo "

<a href="admincp.php?action=chuinfo&sid=$sid">"; echo "Users Info</a> "; echo "<a href="index.php?action=admincp&sid=$sid"><img src="images/admn.gif" alt=""/>"; echo "Admin CP</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt=""/>"; echo "Home</a>";

  echo "

</card>"; }

else if($action=="delchat") { $who = $_GET["who"]; echo "<card id="main" title="$sitename">"; echo " "; echo " "; $res = mysql_query("DELETE FROM ibwf_chatadmin WHERE uid='".$who."'");

	if($res)
  {
	echo "<img src=\"images/ok.gif\" alt=\"O\"/>Chat Admin  deleted successfully";
  }else{
	echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error deleting Chat Admin";
  }

  echo "

<a href="admincp.php?action=chuinfo&sid=$sid">"; echo "Users Info</a> "; echo "<a href="index.php?action=admincp&sid=$sid"><img src="images/admn.gif" alt=""/>"; echo "Admin CP</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt=""/>"; echo "Home</a>";

  echo "

</card>"; }

\\\\\\\\\\
ADD THIS TO index.php \\\\\\\\\\
//////////////////////////////////chat tools else if($action=="cadmin") {

$who = $_GET["who"];
addonline(getuid_sid($sid),"Chat Admin Tools","index.php?action=online");
echo "<card id=\"main\" title=\"Chat Admin Tools\">";
echo "

"; $unick = getnick_uid($who); echo "Trash $unick from chatrooms Trash - this user cant type message in chatrooms ";

$uid = getuid_sid($sid); $chatadmin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid='".$uid."'")); if($chatadmin[0]>0) { $pen[0]="Trash $unick"; echo "Penalty: <select name="pid">"; for($i=0;$i<count($pen);$i++) { echo "<option value="$i">$pen[$i]</option>"; } echo "</select> "; echo "Reason: <input name="pres" maxlength="100"/> "; echo "Days: <input name="pds" format="*N" maxlength="4"/> "; echo "Hours: <input name="phr" format="*N" maxlength="4"/> "; echo "Minutes: <input name="pmn" format="*N" maxlength="2"/> "; echo "Seconds: <input name="psc" format="*N" maxlength="2"/> "; echo "<anchor>Trash Now!"; echo "<go href="genproc.php?action=trash&sid=$sid" method="post">"; echo "<postfield name="who" value="$who"/>"; echo "<postfield name="pid" value="$(pid)"/>"; echo "<postfield name="pres" value="$(pres)"/>"; echo "<postfield name="pds" value="$(pds)"/>"; echo "<postfield name="phr" value="$(phr)"/>"; echo "<postfield name="pmn" value="$(pmn)"/>"; echo "<postfield name="psc" value="$(psc)"/>"; echo "</go></anchor> "; }else{ echo "You are not a chat admin "; } echo "

";

$chs = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_chonline")); echo "<a href="index.php?action=chat&sid=$sid">Chatrooms($chs[0])</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt=""/>"; echo "Home</a>";

echo "

"; echo "</card>"; }

\\\\\\\\\\\
ADD THIS TO genproc.php \\\\\\\\\\\
else if($action=="trash") { $pid = $_POST["pid"]; $who = $_POST["who"]; $pres = $_POST["pres"]; $pds = $_POST["pds"]; $phr = $_POST["phr"]; $pmn = $_POST["pmn"]; $psc = $_POST["psc"]; echo "<card id="main" title="Chat Admin Tools">"; echo " ";

$uid = getuid_sid($sid); $chatadmin = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_chatadmin WHERE uid='".$uid."'")); if($chatadmin[0]>0) { $uip = ""; $ubr = ""; $pmsg[0]="Trashed"; $pmsg[1]="Banned"; $pmsg[2]="IP-Banned"; if($pid=='2') { //ip ban $uip = getip_uid($who); $ubr = getbr_uid($who); } if(trim($pres)=="") { echo "<img src="images/notok.gif" alt="X"/>You must Specify a reson for punishing the user"; }else{ $timeto = $pds246060; $timeto += $phr6060; $timeto += $pmn*60; $timeto += $psc; $ptime = $timeto + time(); $unick = getnick_uid($who); $res = mysql_query("INSERT INTO ibwf_penalties SET uid='".$who."', penalty='".$pid."', exid='".getuid_sid($sid)."', timeto='".$ptime."', pnreas='".mysql_escape_string($pres)."', ipadd='".$uip."', browserm='".$ubr."'"); if($res) { mysql_query("UPDATE ibwf_users SET lastpnreas='".$pmsg[$pid].": ".mysql_escape_string($pres)."' WHERE id='".$who."'"); mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='".getnick_uid(getuid_sid($sid))." $pmsg[$pid] The user ".$unick." For ".$timeto." Seconds', actdt='".time()."'");

		echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick is $pmsg[$pid] for $timeto Seconds";
	  }else{
		echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
	  }

}

}else{ echo "You are not a chat admin "; } $chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline")); echo "<a href="index.php?action=chat&sid=$sid">Chatrooms($chs[0])</a> "; echo "

<a href="index.php?action=main&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " </card>"; }

andre3 Developer · 192 posts #6

completed lol External image (may be gone) External image (may be gone)

put this on ur genproc.php

else if($action=="chatban")
{
echo "<card id=\"cb\" title=\"Banning from Chat\">";
echo "<p align=\"center\">";
$who=$_GET["who"];
if (ismod(getuid_sid($sid)))
{

$res = mysql_query("INSERT INTO chat_ban SET uid='".$who."', banstatus='1'");
if($res){
echo "User banned from chatroom Successfully :)
";

}else{

echo "Error Banning
";
}

}else{

echo "Go hang your self lol
";
}

  echo "
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
echo "</card>";
}

else if($action=="chatunban")
{
echo "<card id=\"cb\" title=\"UNBanning from Chat\">";
echo "<p align=\"center\">";
$who=$_GET["who"];
if (ismod(getuid_sid($sid)))
{

$res = mysql_query("Delete From chat_ban WHERE uid='".$who."' and banstatus='1'");
if($res){
echo "User Unbanned from chatroom Successfully :)
";

}else{

echo "Error UnBanning
";
}

}else{

echo "Go hang your self lol
";
}

  echo "
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
echo "</card>";
}

next put this bits on chat.php  in: action=="say2" where the links are

if (ismod(getuid_sid($sid)))
{
 $chat = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chat_ban WHERE uid='".$who."' AND banstatus='1'"));

 if($chat[0]=="1"){
echo "[size="1"]<a href=\"genproc.php?action=chatunban&sid=$sid&who=$who\">»UnBan From Chat</a>[/size]
";

}else{
echo "[size="1"]<a href=\"genproc.php?action=chatban&sid=$sid&who=$who\">»Ban From Chat</a>[/size]
";

}
   }  

next put this on users profile below the modcp link:

 $chat = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chat_ban WHERE uid='".$who."' AND banstatus='1'"));

 if($chat[0]=="1"){
echo "<a href=\"genproc.php?action=chatunban&sid=$sid&who=$who\">UnBan From Chat</a>
";

}else{

}

put this on core.php

///////////////////////////////////////////chat room ban

function isbannedchat($uid)
{
 
  $chat = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chat_ban WHERE uid='".$uid."' AND banstatus='1'"));
 
  if($chat[0]>0)
  {
    return true;
  }else{
    return false;
  }
}

now here is the sql :D 

CREATE TABLE `chat_ban` (
  `id` int(11) NOT NULL auto_increment,
  `uid` varchar(11) NOT NULL default '',
  `banstatus` int(55) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4;

enjoy mr fwends External image (may be gone)

mcKeny Developer · 130 posts #8

yeah pretty cool ...i remember coding this feature for a dude but i enable staff to band from specific areas eg. ...chat,forum specific rooms and categories ...got ma point?

R.M.C

PHP Adovocate B)

rukiya Lead · 569 posts #10

guys since the topic is about chat.php i just want a lil help can u plz tell me the code how to get the chatroom name in the title of the chat after u select the room? in my rw it only shows the site name not chatroom name in title External image (may be gone)

you you wanted same thing in 3 places including here.

guys hel with chatroom title from select chat room and in chat room title name of the chatroom in rw?

please tell me code to put the chatroom title on the chat.php of rw? it dont show room name in the title after u enter the chatroom External image (may be gone)

thats really annoying External image (may be gone) im giving you code which will show not only chatroom name but also the chatter name only for $action="" in chat.php

but you need to add the fetched array in card titile of $action="say" and $action="say2"

Attachments: copy___replace.txt
hypetype Developer · 128 posts #11

the code below will show eg: General Chat (12)

12 is the number of users in the room External image (may be gone)

$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
        $onchat=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));

        echo "<card id=\"chat\" title=\"$rname ($onchat[0])\" ontimer=\"chat.php?time=";
brand Senior · 391 posts #13

all codes in here works a treat thanks to tho's who has made them credit to you

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

Vayne Developer · 106 posts #14

i don`t get, why that chat admin is needed? crap the code with useless sentences, orly? just add link to mod cp and all is done.

Nous Ne Dansos Pas, Nous Sommes Le Danse.!

WhiteWarrior Principal · 1,419 posts #15

i just love it when people say things like

"the code is below, coded by hypetype, took only couple minutes. jus follow the instructions... thank ya. lol"

Then you look at the coding and its got lavalair written all over it! it even has the ibwf_ SQL quires! lmao!! reminds me of back in the day! hasn't something new come out yet?

wap_king Developer · 126 posts #16

lol nothing else is gonna come out everybody is coding there own noob stuffs lol...these days

something else Fellow · 2,296 posts #17

WhiteWarrior wrote: i just love it when people say things like

"the code is below, coded by hypetype, took only couple minutes. jus follow the instructions... thank ya. lol"

Then you look at the coding and its got lavalair written all over it! it even has the ibwf_ SQL quires! lmao!! reminds me of back in the day! hasn't something new come out yet?

"reminds me of back in the day!" ???? what like back in 2008 when hypetype posted this and you was still using lava as your main forum?

How about ibwf_chappel or what ever it was called ? did you forget you called that your coding? lol ..... contradicting yourself by any chance? 😛

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close