Chat Commands

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

    Chat Commands

    // how to set chat commands
    // this is a short idea-tutorial
    // what it's a command?
    // in my opinion chat command it's a way to change one or more settings in the same time with the chat writings
    // whay to edit settings in the same way with the chat writings?
    // because this is more fast like to go into cpanel or settings and sometime you need to be fast
    // for example you may set the theme or the refresh time for chat, send mass message to all buddyes, or to some registered users on site
    // personal i use this command for more than that, one example may be: i see where it's each of my buddyes(buddilist)
    // or u see who and where it's online and i stay in chat with the m8's


    Code:
    <?php
    // define the command
    // whay m? choose another command!
    $mbc = "/m";
    
    // define a message - this it's a test
    // the message it's catched from $_POST @ of chat formular
    // this $_POST contain:
    // the message + command + space between the message and command
    $message = "/m You Smile like a Fox!";
    
    // make all lower 
    // whay? because i want all lower - i dont like "ASDFGHhjklRbHSISmmm" chars
    $ms = strtolower($message);
    
    // extract the command if exist
    $c = substr($message, 0, 2); // return "/m"
    
    // clear message
    $cm = substr($message, 3); // return "You Smile like a Fox"
    // one more thing: 
    // entire $_POST message contains X characters - 
    // - count the space between the message and command!
    
    if ($c == $mbc){
    // here you put the command
    // the command may be:
    // insert into mysql,update mysql table,mysql delete, etc
    // you may set the lines in chat,refresh,theme,smilies yes or no, etc
        
    		
    	}else{
    // here you make insert into chat with the message - "You Smile like a Fox"
    // all users from chat may see the insert
    // the insert may be: 
    // insert into chat by user the message "You Smile like a Fox"
    }
    ?>
    i wait here the ideas, criticism, etc
    http://ngeo.ro

    #2
    good tutorial but i shal wait for a cue of people to be askin help from u nw lol..
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      nice idea and simply explained :D Thanks!

      PHP Code:
      foreach ($_SERVER as $server => $value)
      {
      echo 
      "$server is $value<br />";

      Comment

      Working...
      X