Ejemplo n.º 1
0
 /**
  * Log a new kill.
  *
  * @param integer $killid
  * @param string $note
  */
 public static function logKill($killid, $note = null)
 {
     if (is_null($note)) {
         $note = "IP:" . logger::getip();
     }
     $qry = DBFactory::getDBQuery(true);
     $qry->execute("INSERT INTO kb3_log (log_kll_id, log_site," . " log_ip_address, log_timestamp) values(" . $killid . ",'" . KB_SITE . "','" . $qry->escape($note) . "', UTC_TIMESTAMP())");
 }
Ejemplo n.º 2
0
 /**
  * Add a comment to a kill.
  *
  * The kill id is set when the Comments object is constructed.
  * @param string $name The name of the comment poster.
  * @param string $text The text of the comment to post.
  */
 function addComment($name, $text)
 {
     $comment = $this->bbencode(trim($text));
     $name = trim($name);
     $qryP = new DBPreparedQuery();
     $sql = "INSERT INTO kb3_comments (`kll_id`,`site`, `comment`,`name`,`posttime`, `ip`)\n                       VALUES (?, ?, ?, ?, ?, ?)";
     $qryP->prepare($sql);
     $site = KB_SITE;
     $date = kbdate('Y-m-d H:i:s');
     $ip = logger::getip();
     $params = array('isssss', &$this->id_, &$site, &$comment, &$name, &$date, &$ip);
     $qryP->bind_params($params);
     $qryP->execute();
     $id = $qryP->getInsertID();
     $this->comments_[] = array('time' => kbdate('Y-m-d H:i:s'), 'name' => $name, 'comment' => $comment, 'id' => $id);
     // create comment_added event
     event::call('comment_added', $this);
 }