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 $fetchtemplates = array(
17 define('SVN', '$Id$');
19 require_once('./global.php');
21 if (!can_perform('canpostcomments'))
23 $message->error_permission();
26 // ###################################################################
28 if (empty($_REQUEST['do']))
30 $_REQUEST['do'] = 'add';
33 // ###################################################################
35 if ($_POST['do'] == 'insert')
37 $bugsys->in
['comment_parsed'] = $bugsys->in
['comment'];
39 if (!$bugsys->options
['allowhtml'])
41 $bugsys->in
['comment_parsed'] = $bugsys->sanitize($bugsys->in
['comment_parsed']);
47 INSERT INTO " . TABLE_PREFIX
. "comment
48 (bugid, userid, dateline, comment, comment_parsed)
50 (" . intval($bugsys->in
['bugid']) . ", " . $bugsys->userinfo
['userid'] . ",
51 $time, '" . $bugsys->in
['comment'] . "',
52 '" . nl2br($bugsys->in
['comment_parsed']) . "'
56 $commentid = $db->insert_id();
59 UPDATE " . TABLE_PREFIX
. "bug
60 SET lastposttime = $time,
61 lastpostby = " . $bugsys->userinfo
['userid'] . ",
62 hiddenlastposttime = $time,
63 hiddenlastpostby = " . $bugsys->userinfo
['userid'] . "
64 WHERE bugid = " . intval($bugsys->in
['bugid'])
68 require_once('./includes/class_history.php');
70 $log->bugid
= $bugsys->in
['bugid'];
71 $log->language
= 'log_new_comment';
72 $log->arguments
= array($commentid);
75 $message->redirect('comment inesrted', "showreport.php?bugid=" . intval($bugsys->in
['bugid']));
78 // ###################################################################
80 if ($_REQUEST['do'] == 'add')
82 $bug = $db->query_first("SELECT bug.*, comment.comment FROM " . TABLE_PREFIX
. "bug AS bug LEFT JOIN " . TABLE_PREFIX
. "comment AS comment ON (bug.bugid = comment.bugid) WHERE bug.bugid = " . intval($bugsys->in
['bugid']));
85 $message->error('alert: bad bug');
88 eval('$template->flush("' . $template->fetch('newcomment') . '");');
91 /*=====================================================================*\
92 || ###################################################################
95 || ###################################################################
96 \*=====================================================================*/