alex clone Posted May 21, 2009 Share Posted May 21, 2009 Hey, My friend had sent my a forum software which I enjoy using alot [Hardly anyone has it - Only me, him and a few other people...] Anyways.. When people create new threads older topics go above the newer topics which it shouldnt be like that :s Eg it goes: Thread 1 Thread 2 Thread 3 Etc.. When it should be: Thread 3 Thread 2 Thread 1 Etc.. Do you get what I mean? The new topics shoul;d go first How do I do that? Plz and thx. Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/ Share on other sites More sharing options...
Adam Posted May 21, 2009 Share Posted May 21, 2009 Need to find the SQL that would look something like: ORDER BY whatever ASC and change the 'ASC' to 'DESC'. Without any kind of idea of the code though can't give any more help. Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839095 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 I insert: ORDER BY DESC via phpmyadmin as a query? Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839099 Share on other sites More sharing options...
Adam Posted May 21, 2009 Share Posted May 21, 2009 No within the code base of your forum. That's not the whole SQL though, it's just a part of the query, also note it'll be near the end. If you know PHP/MySQL, try searching through the files for "ASC" (turn off case matching) and trying to find the relevant query. As I said before though can't help you as we can't see the code. If you still have troubles probably best contacting the developer behind it, or someone else who uses the forum, and asking for help off them. Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839108 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 Hmm yeah still finding it hard Here is my add_thread.php *Removed by Alex Clone* Where would it go in there? Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839114 Share on other sites More sharing options...
BobcatM Posted May 21, 2009 Share Posted May 21, 2009 I do not think it will be located in the Insert of a new post, more like the main page used to view the posts. Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839118 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 Ah kk thanks Sec Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839125 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 Index.php: [i've changed Order by 'Position' to Order by 'DESC' but It doesnt work <?php $select_forum_cata2 = "select * from `runeweb_forum_categories` ORDER BY `position`"; $select_forum_cata1 = mysql_query($select_forum_cata2); if(mysql_num_rows($select_forum_cata1) > 0) { while ($select_forum_cata = mysql_fetch_assoc($select_forum_cata1)) { $cata_id = replace($select_forum_cata['id']); $cata_name = replace($select_forum_cata['name']); ?> <div class="brown_box_forum brown_box_stack"> <table id="forum_group<?php echo $cata_id;?>" class="forum_group"> <tr> <td class="header_groupname" colspan="2"> <div id="showhide_controls<?php echo $cata_id;?>" class="showhide_controls"> </div> <div class="groupname"><?php echo $cata_name;?></div> </td> <td id="header_threads<?php echo $cata_id;?>" class="header_threads title num">Threads</td> <td id="header_posts<?php echo $cata_id;?>" class="header_posts title num">Comments</td> <td id="header_lastpost<?php echo $cata_id;?>" class="header_lastpost title"></td> <?php $select_forum_subcata2 = "select * from `runeweb_forum_sub_categories` WHERE `categorie_id` = '$cata_id' ORDER BY `position`"; $select_forum_subcata1 = mysql_query($select_forum_subcata2); if(mysql_num_rows($select_forum_subcata1) > 0) { while ($select_forum_subcata = mysql_fetch_assoc($select_forum_subcata1)) { $subcata_id = replace($select_forum_subcata['id']); $subcata_name = replace($select_forum_subcata['name']); $subcata_discription = replace($select_forum_subcata['discription']); $subcata_image = replace($select_forum_subcata['image']); $subcata_posts = replace($select_forum_subcata['posts']); $count_threadst1 = mysql_query("SELECT COUNT(id) AS threads FROM `runeweb_forum_threads` where `categorie_id` = '$subcata_id'"); $count_threads = mysql_fetch_object($count_threadst1); ?> <tr class="spacer"> <td colspan="5" style="background:#1D1506 none repeat scroll 0%;"></td></tr> <tr class="item"> <td class="icon lefttd"> <a href=""><img src="content/img/layout/icons/<?php echo $select_forum_subcata['image'];?>.gif" alt=""></a> </td> <td class="frmname"> <span class="bigtitle"><a href="forum.php?x=catagorie&categorie=<?php echo $subcata_id; ?>"><?php echo $subcata_name;?></a></span> <br /> <span class="desc"><?php echo $subcata_discription;?></a></span> </td> <td class="num"><?php echo $count_threads->threads;?></td> <td class="num"><?php echo $subcata_posts; ?></td> <td class="righttd update2"></td> </tr> <?php } } else{} ?> </tr> </table> </div> <script type="text/javascript"> showhide(!is_group_hidden(0),<?php echo $cata_id;?>); </script> <?php } } else { echo"There are no forums yet"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839141 Share on other sites More sharing options...
Adam Posted May 21, 2009 Share Posted May 21, 2009 Replace: $select_forum_subcata2 = "select * from `runeweb_forum_sub_categories` WHERE `categorie_id` = '$cata_id' ORDER BY `position`"; With: $select_forum_subcata2 = "select * from `runeweb_forum_sub_categories` WHERE `categorie_id` = '$cata_id' ORDER BY `position` DESC"; Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839143 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 Yes thanks it worked!!! Wewt [Happy] - thanks 2 both of you =] [Making another topic for a diff topic semi-related] Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839145 Share on other sites More sharing options...
Adam Posted May 21, 2009 Share Posted May 21, 2009 If you don't already have one, create a "last_activity" kind of field within the "runeweb_forum_sub_categories" table with a DATETIME data type. You can then order by that instead... I imagine though you're going to have to do some extra work in order to update this field every time someone makes a post. Make sure there's not one there already... Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839153 Share on other sites More sharing options...
alex clone Posted May 21, 2009 Author Share Posted May 21, 2009 Ah fuck it man lol this is to complicated for me Im going to stick with the old version of this script if I can work out this problem: http://www.phpfreaks.com/forums/index.php/topic,253308.0.html Can you see if u can help me der plz ? Quote Link to comment https://forums.phpfreaks.com/topic/159108-solved-help-dno-wut-title-2-put-s/#findComment-839160 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.