All pastes #466900 Raw Edit

Miscellany

public php v1 · immutable
·published 2007-05-02 05:12 UTC
rendered paste body
<?php/** Online Status Web Module for BeBot <http://bebot.shadow-realm.org/>* Module coded by Craized <http://www.craized.net >/*Add a "_" at the beginning of the file (w_lookup.php) if you do not want it to be loaded.*/$w_lookup = new Status($bot);$cron["2sec"][] = &$w_lookup;/*The Class itself...*/class Status {  var $bot;  /*  Constructor:  Hands over a referance to the "Bot" class.  */  function Status (&$bot) {    $this -> bot = &$bot;    $this -> bot -> highlight_color = !$this -> bot -> highlight_color ? '<font color=#CB11C9>' : '<font color='.$this -> bot -> highlight_color.'>';    }  }  function cron() {  $handle = mysql_query("SELECT * FROM w_lookup");  while(TRUE===($f[] = mysql_fetch_array($handle)));  if(isset($f)) {    foreach($f as $key=>$value) {      $status = $this -> bot -> lookup($value['name']);      $status != $value['status'] ? mysql_query("UPDATE w_lookup SET status='".$status."' WHERE id='".$value['id']."' LIMIT 1") : NULL;    }  }   }?>