Hey, I got a forum script from a site (nothing like PHPBB), and It's pretty good. The only problem I am having is after the stickys are shown, I want the posts to show up in a list depending on which thread was posted in last.
Example:
Forum Name
STICKY
Test 1
Test 2
I go into Test 2, and post, then afterwards it shows:
Forum Name
STICKY
Test 2
Test 1
I hope you understand...
That's the bit where it shows the forum names, and threads.
If nobody can figure this out, then if somebody could tell me how to do this:
If you look at the code above, it orders by sticky, is it possible to do something like:
I was wondering cause it would be easier because it would display the stickys, then afterwards the rest (including the example above)...
So, pretty much, I want it to reorder the forums that ARE NOT STICKED below the stickys...
I hope you understand, this seems to be a big problem for me. Thanks A LOT guys!!
Example:
Forum Name
STICKY
Test 1
Test 2
I go into Test 2, and post, then afterwards it shows:
Forum Name
STICKY
Test 2
Test 1
I hope you understand...
| Code: |
| $fetch2 = mysql_query("SELECT * FROM `forum_thread` WHERE `top_id` = '$_GET[id]' ORDER BY `sticky` DESC"); // get mysql
echo "<tr></table><table width='100%' cellspacing='0'>"; // end, then start table while ($thread = mysql_fetch_array($fetch2)) { $threadtitle = "$thread[title]"; $bbctt1 = BBCODE($threadtitle); if($thread[locked] == Yes) { // CHECKS IF LOCKED, IF IT IS DISPLAY echo "<tr><td width='10%'><center><img src='/images/locked.gif'></center></td>"; } else { // ELSE DISPLAY echo "<td width='10%'></td>"; } if($thread[sticky] == Yes) { // CHECKS IF ITS STICKYED, IF IT IS DISPLAY echo "<td width='40%'><img src='/images/stickyforum.gif'> - <a href='?page=forumdisplay&id=$thread[id]'> $bbctt1</a><td>"; } else { // ELSE DISPLAY echo "<td width='40%'><a href='?page=forumdisplay&id=$thread[id]'> $bbctt1</a><td>"; } echo " <td width='10%'><a href='/members/members.php?username=$thread[poster]'>$thread[poster]</a></td> <td width='10%'> ?</td> <td width='30%'> ?</td></tr><tr>"; } // ABOVE SHOWS THE REST, WHICH DOESN'T NEED TO BE IN THE ELSES |
That's the bit where it shows the forum names, and threads.
If nobody can figure this out, then if somebody could tell me how to do this:
| Code: |
| $fetch2 = mysql_query("SELECT * FROM `forum_thread` WHERE `top_id` = '$_GET[id]' ORDER BY `sticky` DESC"); |
If you look at the code above, it orders by sticky, is it possible to do something like:
| Code: |
| $fetch2 = mysql_query("SELECT * FROM `forum_thread` WHERE `top_id` = '$_GET[id]' ORDER BY `sticky` THEN `something here` DESC"); |
I was wondering cause it would be easier because it would display the stickys, then afterwards the rest (including the example above)...
So, pretty much, I want it to reorder the forums that ARE NOT STICKED below the stickys...
I hope you understand, this seems to be a big problem for me. Thanks A LOT guys!!
