]>
src.bluestatic.org Git - bugdar.git/blob - newcomment.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 if (! can_perform ( 'canpostcomments' ))
25 // ###################################################################
27 if ( empty ( $_REQUEST [ 'do' ]))
29 $_REQUEST [ 'do' ] = 'add' ;
32 // ###################################################################
34 if ( $_POST [ 'do' ] == 'insert' )
36 $bugsys- > in
[ 'comment_parsed' ] = $bugsys- > in
[ 'comment' ];
38 if (! $bugsys- > options
[ 'allowhtml' ])
40 $vars [ 'comment_parsed' ] = $bugsys- > sanitize ( $bugsys- > in
[ 'comment_parsed' ]);
46 INSERT INTO " . TABLE_PREFIX
. "comment
47 (bugid, userid, dateline, comment, comment_parsed)
49 ( $vars [bugid], " . $bugsys- > userinfo
[ 'userid' ] . ",
50 $time , '" . $bugsys- > in
[ 'comment' ] . "',
51 '" . nl2br ( $bugsys- > in
[ 'comment_parsed' ]) . "'
55 $db- > query ( "UPDATE " . TABLE_PREFIX
. "bug SET lastposttime = $time , lastpostby = " . $bugsys- > userinfo
[ 'userid' ] . " WHERE bugid = " . intval ( $bugsys- > in
[ 'bugid' ]));
57 echo "<a href= \" showreport.php?bugid=" . intval ( $bugsys- > in
[ 'bugid' ]) . " \" >comment inserted</a>" ;
60 // ###################################################################
62 if ( $_REQUEST [ 'do' ] == 'add' )
64 $bug = $db- > query_first ( "SELECT bug.*, comment.comment FROM " . TABLE_PREFIX
. "bug LEFT JOIN " . TABLE_PREFIX
. "comment AS comment ON (bug.bugid = comment.bugid) WHERE bug.bugid = " . intval ( $bugsys- > in
[ 'bugid' ]));
67 echo 'alert: bad bug' ;
71 eval ( ' $template- >flush("' . $template- > fetch ( 'newcomment' ) . '");' );
74 /*=====================================================================*\
75 || ###################################################################
78 || ###################################################################
79 \*=====================================================================*/