/** * 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); }