Index: includes/tablesort.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v
retrieving revision 1.36
diff -u -F^f -r1.36 tablesort.inc
--- includes/tablesort.inc      25 Aug 2005 21:14:16 -0000      1.36
+++ includes/tablesort.inc      29 Sep 2005 10:00:14 -0000
@@ -43,17 +43,20 @@ function tablesort_pager() {
  * @param $before
  *   An SQL string to insert after ORDER BY and before the table sorting code.
  *   Useful for sorting by important attributes like "sticky" first.
+ * @param $after
+ *   An SQL string to insert after the table sorting code.
+ *   Useful for ensuring overall ordering, e.g. always ordered by "created".
  * @return
  *   An SQL string to append to the end of a query.
  *
  * @ingroup database
  */
-function tablesort_sql($header, $before = '') {
+function tablesort_sql($header, $before = '', $after = '') {
   $ts = tablesort_init($header);
   if ($ts['sql']) {
     $sql = db_escape_string($ts['sql']);
     $sort = drupal_strtoupper(db_escape_string($ts['sort']));
-    return " ORDER BY $before $sql $sort";
+    return " ORDER BY $before $sql $sort $after";
   }
 }

Index: modules/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum.module,v
retrieving revision 1.272
diff -u -F^f -r1.272 forum.module
--- modules/forum.module        27 Sep 2005 15:06:35 -0000      1.272
+++ modules/forum.module        29 Sep 2005 10:00:14 -0000
@@ -714,7 +714,7 @@ function forum_get_topics($tid, $sortby,
   $term = taxonomy_get_term($tid);

   $sql = db_rewrite_sql("SELECT n.nid, f.tid, n.title, n.sticky, u.name, u.uid, n.created AS timestamp, n.comment AS comment_mode, l.last_comment_timestamp, IF(l.last_comment_uid, cu.name, l.last_comment_name) AS last_comment_name, l.last_comment_uid, l.comment_count AS num_comments FROM {node} n, {node_comment_statistics} l, {users} cu, {term_node} r, {users} u, {forum} f WHERE n.status = 1 AND l.last_comment_uid = cu.uid AND n.nid = l.nid AND n.nid = r.nid AND r.tid = %d AND n.uid = u.uid AND n.vid = f.vid");
-  $sql .= tablesort_sql($forum_topic_list_header, 'n.sticky DESC,');
+  $sql .= tablesort_sql($forum_topic_list_header, 'n.sticky DESC,', ', n.created DESC');

   $sql_count = db_rewrite_sql("SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum'");

