prepare("DELETE FROM notices WHERE id = :id"); $stmt->bindParam(":id", $_GET["del"]); $stmt->execute(); header("Location: /forum"); } if(isset($_POST["notif"])&&verifyUser("admin")){ conn(); $stmt = $conn->prepare("INSERT INTO notices (text) VALUES (:text)"); $stmt->bindParam(":text", $_POST["notif"]); $stmt->execute(); unset($_POST["notif"]); header("Location: /forum"); } ?>
prepare("SELECT * FROM notices ORDER BY id DESC"); $stmt->execute(); $notices = $stmt->fetchAll(); foreach($notices as $notice){ if(verifyUser("admin")){ $notice = "
"; }else{ $notice = "".$notice["text"]."
"; } echo $notice; } if($notices==NULL){ echo "No notifs."; } ?>prepare("SELECT * FROM alerts WHERE mentionee = :cu ORDER BY id ASC"); $stmt->bindParam(":cu", $current_user); $stmt->execute(); $alerts = $stmt->fetchAll(); foreach($alerts as $alert){ echo "".getUserInfo($alert['mentioner'])->name." mentioned you"; } if($alerts==NULL){ echo "No mentions"; } ?>
Post ".$post["post_id"]." has been reported $times
"; } if(count($res)==0){ echo "Nothing has been reported.
"; } echo "You can delete any notif by clicking on it. Keep in mind that once you click it, it's gone forever. Don't delete something if you aren't sure it should be deleted!
Make sure notifs apply to everyone!