Order Subforums by Position

Started by Arceus at Aug 16, 2020 9:42 pm
277 Views
1 Post

Arceus

codemancer
0
30Years Young
75 Posts

They don't think that I listen, oh but I know who they are.


I did just realise that there is a bit of code missing in the backend that sorts subforums by their position order in the ACP. This quick fix will make them order properly.

We're going to open application/core/chronos.php, and find this:

				  $subforums = $metis->db_query(
                                "SELECT
                                    id_forum, for_name, for_desc, for_redirect, for_groups, for_sortmethod, for_sortorder,
                                    for_charpost, for_guestpost, for_jointpost, for_readonly, for_posts, for_threads
                                FROM {db_prefix}forums
                                WHERE id_parent = {id}",
                                array('id' => $id)
                          );

Turn it into this:

				  $subforums = $metis->db_query(
                                "SELECT
                                    id_forum, for_name, for_desc, for_redirect, for_groups, for_sortmethod, for_sortorder,
                                    for_charpost, for_guestpost, for_jointpost, for_readonly, for_posts, for_threads
                                FROM {db_prefix}forums
                                WHERE id_parent = {id}
                                ORDER BY for_position ASC",
                                array('id' => $id)
                          );