Chat Admin (lavalair Script)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Chat Admin (lavalair Script)

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


    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\\\\\\
    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 &#39;0&#39;,
    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=&#39;".$uid."&#39;"));

    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=&#39;".$uid."&#39;"));
    if($chatadmin[0]>0)
    {
    echo "<a href=\"index.php?action=cadmin&amp;sid=$sid&amp;wh o=$who\">+Trash $unick</a>
    ";
    }

    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    ADD THIS TO admincp.php (in acui)
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    $cadmn = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid=&#39;".$tid."&#39;"));
    if($cadmn[0]>0)
    {
    echo "<a href=\"admproc.php?action=delchat&amp;sid=$sid&amp ;who=$tid\">»Disable Chat Admin</a>
    ";
    }else{
    echo "<a href=\"admproc.php?action=addchat&amp;sid=$sid&amp ;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 "<p align=\"center\">";
    echo "
    ";
    $res = mysql_query("INSERT INTO ibwf_chatadmin SET uid=&#39;".$who."&#39;");

    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&amp;sid=$sid\">" ;
    echo "Users Info</a>
    ";
    echo "<a href=\"index.php?action=admincp&amp;sid=$sid\"><im g src=\"images/admn.gif\" alt=\"*\"/>";
    echo "Admin CP</a>
    ";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";

    echo "</p></card>";
    }

    else if($action=="delchat")
    {
    $who = $_GET["who"];
    echo "<card id=\"main\" title=\"$sitename\">";
    echo "<p align=\"center\">";
    echo "
    ";
    $res = mysql_query("DELETE FROM ibwf_chatadmin WHERE uid=&#39;".$who."&#39;");

    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&amp;sid=$sid\">" ;
    echo "Users Info</a>
    ";
    echo "<a href=\"index.php?action=admincp&amp;sid=$sid\"><im g src=\"images/admn.gif\" alt=\"*\"/>";
    echo "Admin CP</a>
    ";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";

    echo "</p></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 "<p align=\"left\">";
    $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=&#39;".$uid."&#39;"));
    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&amp;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 "</p><p align=\"center\">";

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

    echo "</p>";
    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 "<p align=\"center\">";

    $uid = getuid_sid($sid);
    $chatadmin = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chatadmin WHERE uid=&#39;".$uid."&#39;"));
    if($chatadmin[0]>0)
    {
    $uip = "";
    $ubr = "";
    $pmsg[0]="Trashed";
    $pmsg[1]="Banned";
    $pmsg[2]="IP-Banned";
    if($pid==&#39;2&#39;)
    {
    //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 = $pds*24*60*60;
    $timeto += $phr*60*60;
    $timeto += $pmn*60;
    $timeto += $psc;
    $ptime = $timeto + time();
    $unick = getnick_uid($who);
    $res = mysql_query("INSERT INTO ibwf_penalties SET uid=&#39;".$who."&#39;, penalty=&#39;".$pid."&#39;, exid=&#39;".getuid_sid($sid)."&#39;, timeto=&#39;".$ptime."&#39;, pnreas=&#39;".mysql_escape_string($pres)."&#39;, ipadd=&#39;".$uip."&#39;, browserm=&#39;".$ubr."&#39;");
    if($res)
    {
    mysql_query("UPDATE ibwf_users SET lastpnreas=&#39;".$pmsg[$pid].": ".mysql_escape_string($pres)."&#39; WHERE id=&#39;".$who."&#39;");
    mysql_query("INSERT INTO ibwf_mlog SET action=&#39;penalties&#39;, details=&#39;".getnick_uid(getuid_sid($sid))." $pmsg[$pid] The user ".$unick." For ".$timeto." Seconds&#39;, actdt=&#39;".time()."&#39;");

    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&amp;sid=$sid\">Chatro oms($chs[0])</a>
    ";
    echo "

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

    #2
    can some1 code ban from chat???

    Comment


      #3
      lol coool bro i will code ban from chat in few minutes hehe
      wapZan Mobile site builder - Yours is here



      http://wapzan.com?ref=2wap

      Comment


        #4
        lol ok bro, have fun coding it.

        Comment


          #5
          wow cool option
          if like my post click:

          http://coding-talk.com/images/totall...ost_thanks.gif

          Comment


            #6
            completed lol

            Code:
            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=&#39;".$who."&#39;, banstatus=&#39;1&#39;");
            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&amp;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=&#39;".$who."&#39; and banstatus=&#39;1&#39;");
            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&amp;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=&#39;".$who."&#39; AND banstatus=&#39;1&#39;"));
            
             if($chat[0]=="1"){
            echo "[size="1"]<a href=\"genproc.php?action=chatunban&amp;sid=$sid&amp;who=$who\">»UnBan From Chat</a>[/size]
            ";
            
            }else{
            echo "[size="1"]<a href=\"genproc.php?action=chatban&amp;sid=$sid&amp;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=&#39;".$who."&#39; AND banstatus=&#39;1&#39;"));
            
             if($chat[0]=="1"){
            echo "<a href=\"genproc.php?action=chatunban&amp;sid=$sid&amp;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=&#39;".$uid."&#39; AND banstatus=&#39;1&#39;"));
             
              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 &#39;&#39;,
              `banstatus` int(55) NOT NULL default &#39;0&#39;,
              PRIMARY KEY  (`id`)
            ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4;
            enjoy mr fwends
            wapZan Mobile site builder - Yours is here



            http://wapzan.com?ref=2wap

            Comment


              #7
              thanks bro, its workin great

              Comment


                #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)

                Comment


                  #9
                  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
                  Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                  <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                  Comment


                    #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 [/b]
                    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?[/b]
                    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 [/b]
                    thats really annoying
                    im giving you code which will show not only chatroom name but also the chatter name only for $action="" in chat.php
                    [attachment=1557:copy___replace.txt]
                    but you need to add the fetched array in card titile of $action="say" and $action="say2"
                    Attached Files

                    Comment


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

                      12 is the number of users in the room


                      Code:
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id=&#39;".$rid."&#39;"));
                      $rname = $rooms[1];
                              $onchat=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid=&#39;".$rid."&#39;"));
                      
                              echo "<card id=\"chat\" title=\"$rname ($onchat[0])\" ontimer=\"chat.php?time=";

                      Comment


                        #12
                        Thank you for these codes...I really appreciate them.

                        WapCHAT Forum Currenltly changing over to xhtml

                        My Dowloads Site

                        Comment


                          #13
                          all codes in here works a treat thanks to tho's who has made them credit to you
                          HELP THEM WHO HELPS YOU



                          i only work on wapdesire v_2 coding only

                          Comment


                            #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.!

                            Comment


                              #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?

                              Comment

                              Working...
                              X