Someone help me please!
I want to basically… everytime I create a new topic. I want the new topic to be over the old topic (which has already been created before) but whenever I create a new one, it goes below the old one instead of on top of it.
The php coding is…
<?php session_start(); include_once("includes/db_connect.php"); include_once("includes/functions.php"); include_once("includes/smile.php"); logincheck(); $username=$_SESSION['username']; $fetch = mysql_fetch_object(mysql_query("SELECT * FROM `users` WHERE `username` = '$username'")); $re = makesafe($_GET['re']); $forum = makesafe($_GET['forum']); if(!$_GET['forum']){ $forum = $fetch->forum; } if($re){ $target = "right"; }else{ $target = "_self"; } $view = makesafe($_GET['view']); $crew = $fetch->crew; $change = makesafe($_GET['change']); $id = makesafe($_GET['id']); $crew = $fetch->crew; if($_GET['give']){ $give = makesafe($_GET['give']); if($fetch->userlevel == "0"){ echo"You cant give respect, your not staff!"; } elseif($fetch->userlevel == "4" || $fetch->userlevel == "1"){ mysql_query("UPDATE users SET respect=respect+50 WHERE username='$give'"); echo " "; }} if($_GET['take']){ $take = $_GET['take']; if($fetch->userlevel == "0"){ echo"You cant take respect, your not staff!"; } elseif($fetch->userlevel == "4" || $fetch->userlevel == "1"){ mysql_query("UPDATE users SET respect=respect-50 WHERE username='$take'"); echo " "; }} //This is the value that sets how long the user must wait after posting or creating a topic (In Minutes) - 0 for none. define("POSTTIMER", 2.5); ////page//// $query_count = "SELECT * FROM `topics` WHERE forum='$forum'"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); $query="SELECT * FROM `topics` WHERE forum='$forum' ORDER BY `lastreply` DESC LIMIT 68, $totalrows"; $query=mysql_query("$query"); while($fo=mysql_fetch_object($query)){ mysql_query("DELETE FROM topics WHERE id='$fo->id'"); mysql_query("DELETE FROM replys WHERE idto='$fo->id'"); } ////page//// //If you have any other forums other than the ones below please add them... Case sensitive if(!in_array($forum, array('NewsUpdatesNotices', 'Chat', 'PictureProfile', 'Ads', 'OCBJAds', 'HelpBugsSuggestions', 'crew'))){ die; } if($fetch->userlevel == "0"){ if(!$crew && $forum == 'crew'){ die("You Are Not In A Crew."); } } $fetchc=mysql_fetch_object(mysql_query("SELECT * FROM crews WHERE name='$crew' LIMIT 1")); $forumm = 0; if($forum == "crew"){ if(($fetchc->owner == $username) || ($fetchc->underboss == $username) || ($fetchc->lhm == $username) || ($fetchc->rhm == $username)){ $forumm = 1; }} if($fetch->userlevel == "3" || $fetch->userlevel == "4" || $fetch->userlevel == "1"){ $forumm = 1; } if($forum == 'crew' && $crew) { $getTopics = mysql_query("SELECT * FROM `topics` WHERE `forum` = '$forum' AND `crew` = '$crew' ORDER BY `sticky` DESC, `lastreply` DESC"); } else { $getTopics = mysql_query("SELECT * FROM `topics` WHERE `forum` = '$forum' ORDER BY `sticky` DESC, `lastreply` DESC"); } $totalTopics = mysql_num_rows($getTopics); $topics_per_page = 20; $offset = (int)$_GET['fpage'] * $topics_per_page; $pages = ceil($totalTopics / $topics_per_page); for ($i=0;$i<$pages;$i++) { $n = $i+1; if ($_GET['fpage'] == $i) { $page .= "$n "; } else { $page .= "$n "; }} if($forum == 'crew' && $crew) { $getTopics = mysql_query("SELECT * FROM `topics` WHERE `forum` = '$forum' AND `crew` = '$crew' ORDER BY `sticky` DESC, `lastreply` DESC LIMIT $offset, $topics_per_page"); } else { $getTopics = mysql_query("SELECT * FROM `topics` WHERE `forum` = '$forum' ORDER BY `lastreply` DESC LIMIT $offset, $topics_per_page"); } if($forumm == 1){ $topicListOptions = "Topic |
|
"; if ($fo->imp == “1” ){ echo"Important: "; } if ($fo->sticky == “1” ){ echo"Sticky: "; } echo “$fo->title | DELETE - Imp - Sticky - Lock | ”;|
"; if ($fo->imp == “1” ){ echo"Important: "; } if ($fo->sticky == “1” ){ echo"Sticky: "; } echo “$fo->title | DELETE - Imp - Sticky - Lock | ”;|
>"; if ($fo->imp == “1” ){ echo"Important: "; } if ($fo->sticky == “1” ){ echo"Sticky: "; } echo “$fo->title | DELETE - Imp - Sticky - Lock | ”;|
"; if ($fo->imp == “1” ){ echo"Important: "; } if ($fo->sticky == “1” ){ echo"Sticky: "; } echo “$fo->title | ”;$hehe |
index_navigation($forum_look, $forum_count, $num);
?>
I’d really appreciate if you help me thanks 8)