require_once("include/functions.php"); require_once("include/config.php"); dbconn(); standardheader('Comments',($GLOBALS["usepopup"]?false:true)); if (!$CURUSER || $CURUSER["uid"]==1) { err_msg(ERROR,ONLY_REG_COMMENT); stdfoot(); exit(); } $id = $_GET["id"]; if (isset($_GET["cid"])) $cid = max(0,$_GET["cid"]); else $cid=0; if (isset($_GET["action"])) { if ($CURUSER["admin_access"]=="yes" && $_GET["action"]=="delete") { @mysql_query("DELETE FROM comments WHERE id=$cid"); redirect("details.php?id=$id#comments"); exit; } } if (isset($_POST["info_hash"])) { if ($_POST["confirm"]==FRM_CONFIRM) { $comment = addslashes($_POST["comment"]); $user=$CURUSER["username"]; if ($user=="") $user="Anonymous"; @mysql_query("INSERT INTO comments (added,text,ori_text,user,info_hash) VALUES (NOW(),\"$comment\",\"$comment\",\"$user\",\"" . StripSlashes($_POST["info_hash"]) . "\")"); redirect("details.php?id=" . StripSlashes($_POST["info_hash"])."#comments"); } else redirect("details.php?id=" . StripSlashes($_POST["info_hash"])."#comments"); } else { block_begin("New Comment"); ?>