11 | | $this->comments_ = array(); |
12 | | $qry = new DBQuery(true); |
13 | | $qry->execute("SELECT *,id FROM kb3_comments WHERE `kll_id` = '".$kll_id."' order by posttime asc"); |
14 | | while ($row = $qry->getRow()) |
15 | | { |
16 | | $this->comments_[] = array('time' => $row['posttime'], 'name' => $row['name'], 'comment' => stripslashes($row['comment']), 'id' => $row['id'], 'ip' => $row['ip']); |
17 | | } |
18 | | } |
| 11 | $this->comments_ = array(); |
| 12 | $qry = new DBQuery(true); |
| 13 | $qry->execute("SELECT *,id FROM kb3_comments WHERE `kll_id` = '".$kll_id."' order by posttime asc"); |
| 14 | while ($row = $qry->getRow()) |
| 15 | { |
| 16 | $this->comments_[] = array('time' => $row['posttime'], 'name' => $row['name'], 'comment' => stripslashes($row['comment']), 'id' => $row['id']); |
| 17 | } |
| 18 | } |
32 | | $name = slashfix(strip_tags($name)); |
33 | | $qry = new DBQuery(); |
34 | | $qry->execute("INSERT INTO kb3_comments (`kll_id`,`comment`,`name`,`posttime`,`ip`) |
35 | | VALUES ('".$this->id_."','".$comment."','".$name."','".kbdate('Y-m-d H:i:s')."','".$_SERVER["REMOTE_ADDR"]."')"); |
| 32 | $name = slashfix(strip_tags($name)); |
| 33 | $qry = new DBQuery(true); |
| 34 | $qry->execute("INSERT INTO kb3_comments (`kll_id`,`comment`,`name`,`posttime`) |
| 35 | VALUES ('".$this->id_."','".$comment."','".$name."','".kbdate('Y-m-d H:i:s')."')"); |
| 36 | $id = $qry->getInsertID(); |
| 37 | $this->comments_[] = array('time' => kbdate('Y-m-d H:i:s'), 'name' => $name, 'comment' => stripslashes($comment), 'id' => $id); |
50 | | function postRaw($bool) |
51 | | { |
52 | | $this->raw_ = $bool; |
53 | | } |
54 | | |
55 | | function bbencode($string) |
56 | | { |
57 | | if (!$this->raw_) |
58 | | { |
59 | | $string = strip_tags(stripslashes($string)); |
60 | | } |
61 | | $string = str_replace(array('[b]','[/b]','[i]','[/i]','[u]','[/u]'), |
62 | | array('<b>','</b>','<i>','</i>','<u>','</u>'), $string); |
63 | | $string = preg_replace('^\[color=(.*?)](.*?)\[/color]^', '<font color="\1">\2</font>', $string); |
64 | | $string = preg_replace('^\[kill=(.*?)](.*?)\[/kill]^', '<a href="\?a=kill_detail&kll_id=\1">\2</a>', $string); |
65 | | $string = preg_replace('^\[pilot=(.*?)](.*?)\[/pilot]^', '<a href="\?a=pilot_detail&plt_id=\1">\2</a>', $string); |
66 | | return nl2br(addslashes($string)); |
67 | | } |
68 | | } |
69 | | ?> |
| 54 | function bbencode($string) |
| 55 | { |
| 56 | if (!$this->raw_) |
| 57 | { |
| 58 | $string = strip_tags(stripslashes($string)); |
| 59 | } |
| 60 | $string = str_replace(array('[b]','[/b]','[i]','[/i]','[u]','[/u]'), |
| 61 | array('<b>','</b>','<i>','</i>','<u>','</u>'), $string); |
| 62 | $string = preg_replace('^\[color=(.*?)](.*?)\[/color]^', '<font color="\1">\2</font>', $string); |
| 63 | $string = preg_replace('^\[kill=(.*?)](.*?)\[/kill]^', '<a href="\?a=kill_detail&kll_id=\1">\2</a>', $string); |
| 64 | $string = preg_replace('^\[pilot=(.*?)](.*?)\[/pilot]^', '<a href="\?a=pilot_detail&plt_id=\1">\2</a>', $string); |
| 65 | return nl2br(addslashes($string)); |
| 66 | } |
| 67 | } |
| 68 | ?> |