prepare("SELECT * FROM comments WHERE post_id = :pid ORDER BY date ASC"); $stmt->bindParam(":pid", $_GET["post"]); $stmt->execute(); $row = $stmt->fetchAll(); if(isset($_GET["a"])){ conn(); $stmt = $GLOBALS['conn']->prepare("SELECT * FROM alerts WHERE id = :id"); $stmt->bindParam(":id", $_GET["a"]); $stmt->execute(); $res = $stmt->fetch(PDO::FETCH_OBJ); if($res->mentionee == $current_user){ alertDelete($_GET["a"]); } } ?>
prepare("SELECT * FROM comments WHERE id = :id"); $rid = $_GET["report"]; $stmt->bindParam(":id", $rid); $stmt->execute(); $comment = $stmt->fetch(PDO::FETCH_OBJ); $commentID = intval($comment->id); if($commentID!=""){ $stmt = $conn->prepare("SELECT * FROM comments WHERE id = :id"); $stmt->bindParam(":id", $commentID); $stmt->execute(); $return = $stmt->fetch(PDO::FETCH_OBJ); $current = $return->reports; if(strpos($current, $current_user) === false){ $new = $current.$current_user.","; $stmt = $conn->prepare("UPDATE comments SET reports = :new WHERE id = :id"); $stmt->bindParam(":new", $new); $stmt->bindParam(":id", $commentID); $stmt->execute(); if($stmt){ msg("Comment reported."); header("Refresh:0"); }else{ msg("Error reporting comment."); header("Refresh:0"); } }else{ msg("Your report has already been recorded."); header("Refresh:0"); } } } if(isset($_GET["reply"])){ $name = getUserInfo($_GET["reply"])->name; $reply = "&reply=".$_GET["reply"]; $repNotif = "

(Replying to $name)

"; }else{ $reply = $repNotif = ""; } ?>
>

Remember: we have rules!

name; $comment["text"] = decodeUserLink($comment["text"]); $teacher = getUserInfo($comment["poster_id"])->teacher?"school":""; if($comment["poster_id"] == $current_user){ $repDel = "

delete

"; }else{ $repDel = "report"; } if($_GET["a"]==$comment['id']){ $a = "current"; echo ""; }else{ $a = ""; } echo "

".$uname."".$teacher." ".makeDate($comment['date'])."

".hyperlink($comment['text'])."
".$repDel." Reply
"; } ?>