User Control Panel
Advertisements

HELP US, HELP YOU!

Status

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
demonbot
Newbie
Newbie


Joined: 31 May 2006
Posts: 2


PostPosted: Sat Jun 24, 2006 5:59 pm    Post subject: Status Reply with quote

Does anyone know of a working status script for the latest version of blobsy that inserts whether a user is online or not?

- Adam

I found this but it doesnt work.


Code:

<?

//
// +--------------------------------------------------------+
// |   Status Handler                              |
// |   Add's data to MYSQL table for a statistic report    |
// |                                          |
// |   FILE VERSION :       1.0 / 11 Dec 2005            |
// |    BLOBSY BOT 2.0                              |
// +--------------------------------------------------------+
// |   AUTHOR :    John Walsh                         |
// |            john.walshuk@gmail.com               |
// +========================================================+
//

class Status {

   function Status() {
       global $msnsb, $handlers;
      

   
         # attach to error messages
         $ret = $handlers->HandlerAdd('MSN_INITIALLYONLINELISTITEM', array(&$this, 'StatusChange'));
         $ret = $handlers->HandlerAdd('MSN_USERSTATECHANGED', array(&$this, 'StatusChange'));
         $handlers->HandlerRun('BLOBSY_LOG', array('msg' => 'Initialized User Status Configuration'));
   }
   
   function StatusChange($args=''){
         global $msnsb, $handlers;
      $status = $args['status']; $UserEmail = $args['email']; $Nickname = $args['nick'];
      ########################
      # MYSQL Status Updater #
      ########################
      switch($status):
        case 'NLN':
      #Online
         $Column = "Online";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'BSY':
      #Busy
         $Column = "Busy";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'BRB':
      #Be Right Back
         $Column = "BRB";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'AWY':
      #Away
         $Column = "Away";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'PHN':
      #On The Phone
         $Column = "`On The Phone`";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'LUN':
      #Out to Lunch
         $Column = "`Out To Lunch`";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      case 'FLN':
      #Out to Lunch
         $Column = "Offline";
         $this->InsertDB($Column, $UserEmail, $Nickname);
        break;
      endswitch;
   
   }
   
   function InsertDB($Column, $UserEmail, $Nickname){
   global $msnsb, $handlers;


mysql_connect("localhost", "darkdem", "lorddemon") or die(mysql_error());
mysql_select_db("darkdem_demonbot") or die(mysql_error());

   # Set your statistics
      if($Column=="Offline"){
         $query1="UPDATE Contacts SET Status='".$Column."' WHERE Email='".$UserEmail."'";
         mysql_query($query1);
      } else {
      $query="UPDATE Status SET ".$Column."=".$Column." +1 WHERE Email='".$UserEmail."'";
      mysql_query($query);
      # Set your current status
      $query1="UPDATE Contacts SET Status='".$Column."', Nickname='".$Nickname."' WHERE Email='".$UserEmail."'";
      mysql_query($query1);
      }
   }
}
?>

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group