FAIL]
"); } echo "
"; switch($uebergabe2) { case 1: echo "
Topic successfully closed!
"; break; case 2: echo "
Topic successfully deleted!
"; break; case 3: echo "
Topic successfully reopened!
"; break; default: break; } if($uebergabe3 == "1") { echo "
Admin Mode!
"; $admin = 1; } if(preg_match("/[A-Z | a-z]+/",$_POST["search"])) { $search = mysql_real_escape_string($_POST["search"]); } else { $search = ""; } if(preg_match("/[A-Z | a-z]+/",$_POST["sort"])) { $sort = mysql_real_escape_string($_POST["sort"]); } else { $sort = "lastupdate"; } echo "
Sort:
Search:

"; $tbl_name="forum_question"; // Table name $sql="SELECT * FROM $tbl_name WHERE topic LIKE '%".$search."%' ORDER BY ".$sort." DESC"; // OREDER BY id DESC is order result by descending $result=mysql_query($sql); echo ""; if($admin=="1" && $_SESSION["user_admin"]=="1") { echo ""; } if($admin=="1" && $_SESSION["user_admin"]=="1") { echo ""; } if($admin=="1" && $_SESSION["user_admin"]=="1") { echo ""; } echo ""; while($rows=mysql_fetch_array($result)) { if (($_SESSION["user_admin"]=="1" && $rows["r_adminonly"] == "1") || $rows["r_guest"] == "1" || ($rows["r_adminonly"] == "0" &&(isset ($_SESSION["user_id"])))) { echo ""; if($admin=="1" && $_SESSION["user_admin"]=="1") { echo "", ""; } if($admin=="1" && $_SESSION["user_admin"]=="1") { if($rows['closed']!=1) { echo "", ""; } else echo ""; } if($admin=="1" && $_SESSION["user_admin"]=="1") { if($rows['closed']==1) { echo "", ""; } else echo ""; } echo ""; // Exit looping and close connection } } mysql_close(); echo ""; if (isset ($_SESSION["user_admin"])&& $_SESSION["user_admin"]=="1") { if($admin != 1) { echo ""; } else { echo ""; } } else { echo ""; } if (isset ($_SESSION["user_id"])) { echo ""; } else { echo ""; } echo "
# Topic Views Replies Like Date/Time Last changeDeleteCloseOpen
".$rows['id']." "; if($rows['closed']==1) echo "[CLOSED]"; echo "".$rows['topic']." ".$rows['view']." ".$rows['reply']." "; if($rows["like"] > $rows["dislike"]) { echo ""; } if($rows["like"] < $rows["dislike"]) { echo ""; } if($rows["like"] == $rows["dislike"]) { echo ""; } echo " ".$rows['datetime']." ".$rows['lastupdate']."
", "", "
", "", "
", "", "
Go Admin! Leave Admin Mode! Create New Topic

"; ?>