poster_id; $title = $post->title; $content = decodeUserLink($post->content); $section = $post->section=="math"?"HL Math":ucwords($post->section); $section = $post->section=="none"?"":ucwords($post->section); $type = $post->type=="other"?"":strtolower($post->type); $type = $section==""?ucwords($type):$type; $section = $section==$type?"No topic":$section; $date = $post->date; $images = $post->image; $poster = getUserInfo($poster_id)->name; //Clearing post of reports if($_GET["clearPost"]){ $stmt = $conn->prepare("UPDATE forums SET reports=null WHERE post_id=:id"); $stmt->bindParam(":id", $_GET["post"]); $stmt->execute(); if($stmt){ msg("Post cleared of all reports"); header("Location: /forum/post/?post=".$_GET["post"]); } } ?>

What should happen to the below post?

Should this post be >deleted or >cleared of reports?

Posted by

"; foreach(explode(",", substr($images, 0, -1)) as $file){ //substr gets rid of the last comma, explode makes the array $exType = substr($file, strpos($file, '.')+1); $docFiles = ["doc", "docx", "pdf"]; $imgFiles = ["jpg", "jpeg", "png"]; //image stuff if(in_array($exType, $docFiles)){ echo ""; // }else if(in_array($exType, $imgFiles)){ echo ""; } } } ?>