2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 define('SVN', '$Id$');
15 require_once('./global.php');
17 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "bug WHERE bugid = " . intval($bugsys->in
['bugid']));
20 $message->error($lang->getlex('error_invalid_id'));
23 if (!can_perform('canpostcomments', $bug['productid']))
25 $message->error_permission();
28 // ###################################################################
30 if ($_POST['do'] == 'insert')
32 $bugsys->in
['comment_parsed'] = $bugsys->in
['comment'];
34 if (!$bugsys->options
['allowhtml'])
36 $bugsys->in
['comment_parsed'] = $bugsys->sanitize($bugsys->in
['comment_parsed']);
42 INSERT INTO " . TABLE_PREFIX
. "comment
43 (bugid, userid, dateline, comment, comment_parsed)
45 (" . intval($bugsys->in
['bugid']) . ", " . $bugsys->userinfo
['userid'] . ",
46 $time, '" . $bugsys->in
['comment'] . "',
47 '" . nl2br($bugsys->in
['comment_parsed']) . "'
51 $commentid = $db->insert_id();
54 UPDATE " . TABLE_PREFIX
. "bug
55 SET lastposttime = $time,
56 lastpostby = " . $bugsys->userinfo
['userid'] . ",
57 hiddenlastposttime = $time,
58 hiddenlastpostby = " . $bugsys->userinfo
['userid'] . "
59 WHERE bugid = " . intval($bugsys->in
['bugid'])
62 $message->redirect($lang->string('Your reply has been added to the comment list.'), "showreport.php?bugid=" . intval($bugsys->in
['bugid']));
65 /*=====================================================================*\
66 || ###################################################################
69 || ###################################################################
70 \*=====================================================================*/