]>
src.bluestatic.org Git - bugdar.git/blob - editcomment.php
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 require_once('./global.php');
19 $comment = $db->query_first("
20 SELECT comment.*, user.email, user.showemail, user.displayname
21 FROM " . TABLE_PREFIX
. "comment AS comment
22 LEFT JOIN " . TABLE_PREFIX
. "user AS user
23 ON (comment.userid = user.userid)
24 WHERE comment.commentid = " . intval($bugsys->in
['commentid'])
29 echo 'alert: bad comment';
33 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "bug WHERE bugid = $comment[bugid]");
35 if (!((can_perform('caneditown') AND $bugsys->userinfo
['userid'] == $comment['userid']) OR can_perform('caneditothers')))
41 // ###################################################################
43 if (empty($_REQUEST['do']))
45 $_REQUEST['do'] = 'edit';
48 #*# do these later after we work out some kind of permission system
49 // ###################################################################
51 if ($_REQUEST['do'] == 'kill')
53 // run code to remove item in database
56 // ###################################################################
58 if ($_REQUEST['do'] == 'delete')
60 // display delete confirmation message
63 // ###################################################################
65 if ($_POST['do'] == 'update')
67 if (!$bugsys->in
['comment'])
69 echo 'you need to enter some text';
73 $bugsys->in
['comment_parsed'] = $bugsys->in
['comment'];
75 if (!$bugsys->options
['allowhtml'])
77 $bugsys->in
['comment_parsed'] = $bugsys->sanitize($bugsys->in
['comment_parsed']);
81 UPDATE " . TABLE_PREFIX
. "comment
82 SET comment = '" . $bugsys->in
['comment'] . "',
83 comment_parsed = '" . nl2br($bugsys->in
['comment_parsed']) . "'
84 WHERE commentid = $comment[commentid]"
87 log_action($bug['bugid'], 'log_update_comment', array($comment['commentid']));
89 echo "<a href=\"showreport.php?bugid=$bug[bugid]\">comment saved</a>";
92 // ###################################################################
94 if ($_REQUEST['do'] == 'edit')
96 $comment['posttime'] = datelike('standard', $comment['dateline']);
97 $comment['postby'] = construct_user_display($comment);
98 $comment['comment'] = $bugsys->sanitize($comment['comment']);
99 eval('$template->flush("' . $template->fetch('editcomment') . '");');
102 /*=====================================================================*\
103 || ###################################################################
106 || ###################################################################
107 \*=====================================================================*/