? 481278-forum-search-views.tar.gz
? 481278-forum-search.patch
? defeat-garland-comment-wrapper.patch
? fix-new-numbering-anchors.patch
? multiple-posts-in-forum-list.patch
? post-render.patch
Index: advanced_forum.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/advanced_forum.module,v
retrieving revision 1.149.2.41
diff -u -p -r1.149.2.41 advanced_forum.module
--- advanced_forum.module	20 Jul 2009 20:58:25 -0000	1.149.2.41
+++ advanced_forum.module	27 Jul 2009 20:46:15 -0000
@@ -526,7 +526,7 @@ function advanced_forum_path_to_theme() 
  */
 function advanced_forum_add_template_suggestions($template, &$template_suggestions) {
   // We only need to calculate the style lineage once per page load.
-  static $lineage ;
+  static $lineage;
 
   if (empty($lineage)) {
     $lineage = advanced_forum_style_lineage();
@@ -615,8 +615,8 @@ function advanced_forum_get_reply_link($
 
       $reply_link->class = 'reply-allowed';
       $reply_link->link = l(t('Post Reply') . '<span class="image-replace"></span>', $href, array('fragment' => $fragment, 'query' => $query, 'html' => TRUE, 'attributes' => $attributes));
-      
-      // Add a couple more properties that lets this function be reused for 
+
+      // Add a couple more properties that lets this function be reused for
       // the purpose of getting the link into the node links when the form
       // is on the same page.
       $reply_link->href = $href;
Index: includes/advanced_forum_preprocess_forum_list.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/advanced_forum_preprocess_forum_list.inc,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 advanced_forum_preprocess_forum_list.inc
--- includes/advanced_forum_preprocess_forum_list.inc	15 Jul 2009 17:16:22 -0000	1.1.2.9
+++ includes/advanced_forum_preprocess_forum_list.inc	27 Jul 2009 20:46:15 -0000
@@ -9,7 +9,7 @@
 
 function _advanced_forum_preprocess_forum_list(&$variables) {
   advanced_forum_add_template_suggestions("forum-list", $variables['template_files']);
-  
+
   // This will be the ID of the container or forum we are in. If empty,
   // we are on the root forum page.
   $parent_id = arg(1);
@@ -23,8 +23,8 @@ function _advanced_forum_preprocess_foru
     $container = taxonomy_get_term($parent_id);
     $container->container = TRUE;
     $container->num_topics = 0;
- 
-    // Add in the "container" at the top and bump up the depth of everything 
+
+    // Add in the "container" at the top and bump up the depth of everything
     // underneath. Note that we can't use array_unshift to add the container
     // to the top as that changes all the keys.
     $orginal_forums = $variables['forums'];
@@ -36,10 +36,10 @@ function _advanced_forum_preprocess_foru
       $variables['forums'][$id]->depth++;
     }
   }
-  
+
   // Determine if we want to use taxonomy image outside of the loop.
   $variables['use_taxonomy_image'] = (function_exists(taxonomy_image_display) && variable_get('advanced_forum_use_taxonomy_image', TRUE));
-  
+
   global $user;
   $row = 0;
   // Sanitize each forum so that the template can safely print the data.
@@ -63,9 +63,9 @@ function _advanced_forum_preprocess_foru
       }
       $variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
     }
-    
+
     $variables['forums'][$id]->last_reply = theme('forum_submitted', $forum->last_post);
-  
+
     $variables['forums'][$id]->new_posts = 0;
     $variables['forums'][$id]->new_text_posts = '';
     $variables['forums'][$id]->new_url_posts = '';
@@ -95,17 +95,17 @@ function _advanced_forum_preprocess_foru
       $variables['forums'][$id]->icon_classes = "forum-icon forum-folder";
       $variables['forums'][$id]->icon_text = t("No new");
     }
-    
+
     // Add in the taxonomy image, if any
     if ($variables['use_taxonomy_image']) {
       $variables['forums'][$id]->forum_image = taxonomy_image_display($forum->tid);
     }
-    
+
     if ($variables['forums'][$id]->depth > 1) {
       // This is a subforum. Add it to the list for the compact listing.
       $parent_id = $variables['forums'][$id]->parents['0'];
       $variables['forums'][$parent_id]->subforum_list[$id] = $variables['forums'][$id];
-    }     
+    }
   }
 
   foreach ($variables['forums'] as $id => $forum) {
@@ -115,7 +115,7 @@ function _advanced_forum_preprocess_foru
      }
    }
 
-  
+
   // Give meaning to $tid for themers. $tid actually stands for term id.
   $variables['forum_id'] = isset($variables['tid']) ? $variables['tid'] : 0;
   unset($variables['tid']);
Index: includes/core-overrides.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/core-overrides.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 core-overrides.inc
--- includes/core-overrides.inc	13 Jul 2009 18:08:32 -0000	1.1.2.2
+++ includes/core-overrides.inc	27 Jul 2009 20:46:16 -0000
@@ -86,13 +86,18 @@ function advanced_forum_get_forums($tid 
       $forum->num_posts = 0;
     }
 
+    $info = advanced_forum_style_info();
+
+    $post_count = isset($info['forum list post count']) ? intval($info['forum list post count']) : 1;
     // This query does not use full ANSI syntax since MySQL 3.x does not support
     // table1 INNER JOIN table2 INNER JOIN table3 ON table2_criteria ON table3_criteria
     // used to join node_comment_statistics to users.
-    $sql = "SELECT n.nid, n.title, n.type,
-                   ncs.last_comment_timestamp,
-                   IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name,
-                   ncs.last_comment_uid
+    $sql = "SELECT n.nid,
+                   n.title as node_title,
+                   n.type,
+                   ncs.last_comment_timestamp as timestamp,
+                   IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS name,
+                   ncs.last_comment_uid as uid
             FROM {node} n
             INNER JOIN {users} u1 ON n.uid = u1.uid
             INNER JOIN {term_node} tn ON n.vid = tn.vid
@@ -101,20 +106,17 @@ function advanced_forum_get_forums($tid 
             WHERE n.status = 1 AND tn.tid = %d
             ORDER BY ncs.last_comment_timestamp DESC";
     $sql = db_rewrite_sql($sql);
-    $topic = db_fetch_object(db_query_range($sql, $forum->tid, 0, 1));
-
-    $last_post = new stdClass();
-    if (!empty($topic->last_comment_timestamp)) {
-      $last_post->timestamp = $topic->last_comment_timestamp;
-      $last_post->name = $topic->last_comment_name;
-      $last_post->uid = $topic->last_comment_uid;
-      $last_post->nid = $topic->nid;
-      // Note, we call it "node_title" otherwise it gets picked up on the
-      // topic list as well.
-      $last_post->node_title = $topic->title;
-      $last_post->type = $topic->type;
+    if ($post_count) {
+      $result = db_query_range($sql, $forum->tid, 0, $post_count);
+      while ($topic = db_fetch_object($result)) {
+        if ($post_count > 1) {
+          $forum->last_post[] = $topic;
+        }
+        else {
+          $forum->last_post = $topic;
+        }
+      }
     }
-    $forum->last_post = $last_post;
 
     $forums[$forum->tid] = $forum;
   }
Index: includes/style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/style.inc,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 style.inc
--- includes/style.inc	15 Jul 2009 02:54:04 -0000	1.1.2.6
+++ includes/style.inc	27 Jul 2009 20:46:16 -0000
@@ -14,7 +14,7 @@
 function advanced_forum_get_current_style() {
   return variable_get('advanced_forum_style', 'blue_lagoon_stacked');
 }
- 
+
 function advanced_forum_get_style($style) {
   ctools_include('plugins');
   return ctools_get_plugins('advanced_forum', 'styles', $style);
@@ -31,12 +31,12 @@ function advanced_forum_get_all_styles()
 function advanced_forum_path_to_style($requested_style = NULL) {
   // Set a static variable so this is cached after the first call.
   static $style_paths = array();
-  
+
   if (empty($requested_style)) {
     // If no style is passed in, assume the current style is wanted.
     $requested_style = advanced_forum_get_current_style();
   }
-  
+
   if (empty($style_path)) {
     // Get the path information
     $styles = advanced_forum_get_all_styles();
@@ -51,46 +51,78 @@ function advanced_forum_path_to_style($r
  * Starting at a given style, return paths of it and all ancestor styles
  */
 function advanced_forum_style_lineage($style = NULL) {
+  static $lineages = array();
   if (empty($style)) {
     // If no style is passed in, assume the current style is wanted.
     $style = advanced_forum_get_current_style();
   }
 
-  $lineage = array();
-  
-  // Get an array with information from all styles.
-  $all_styles = advanced_forum_get_all_styles();
-
-  // Add the current style to the lineage first
-  $lineage[$style] = $all_styles[$style]['path'];
-  
-  // Check if there is an "extra style" listed. This allows you to grab the 
-  // CSS of one other style and toss it in as a pseudo parent. We do not 
-  // follow the path up its parent. The primary use is for adding in the 
-  // "stacked" CSS but could be used for other purposes as well.
-  if (!empty($all_styles[$style]['extra style']) && !empty($all_styles[$all_styles[$style]['extra style']]['path'])) {
-    $extra_style = $all_styles[$style]['extra style'];
-    $lineage[$extra_style] = $all_styles[$extra_style]['path'];
-  }
-
-  // Grab the style we are looking at. This variable starts out as the current 
-  // style in use on the page but will change as we move up the chain.
-  $current_style = $style;
-  
-  while (!empty($all_styles[$current_style]['base style'])) {
-    // There is a parent style, so move up to it.
-    $current_style = $all_styles[$current_style]['base style'];
-    
-    // Make sure the listed parent style actually exists.
-    if (!empty($all_styles[$current_style]['path'])) {
-      // Add the style to our list.
-      $lineage[$current_style] = $all_styles[$current_style]['path'];
-    }  
-   }
+  if (!array_key_exists($style, $lineages)) {
+    $lineage = array();
 
-  return $lineage;
+    // Get an array with information from all styles.
+    $all_styles = advanced_forum_get_all_styles();
+
+    // Add the current style to the lineage first
+    $lineage[$style] = $all_styles[$style]['path'];
+
+    // Check if there is an "extra style" listed. This allows you to grab the
+    // CSS of one other style and toss it in as a pseudo parent. We do not
+    // follow the path up its parent. The primary use is for adding in the
+    // "stacked" CSS but could be used for other purposes as well.
+    if (!empty($all_styles[$style]['extra style']) && !empty($all_styles[$all_styles[$style]['extra style']]['path'])) {
+      $extra_style = $all_styles[$style]['extra style'];
+      $lineage[$extra_style] = $all_styles[$extra_style]['path'];
+    }
+
+    // Grab the style we are looking at. This variable starts out as the current
+    // style in use on the page but will change as we move up the chain.
+    $current_style = $style;
+
+    while (!empty($all_styles[$current_style]['base style'])) {
+      // There is a parent style, so move up to it.
+      $current_style = $all_styles[$current_style]['base style'];
+
+      // Make sure the listed parent style actually exists.
+      if (!empty($all_styles[$current_style]['path'])) {
+        // Add the style to our list.
+        $lineage[$current_style] = $all_styles[$current_style]['path'];
+      }
+    }
+
+    $lineages[$style] = $lineage;
+  }
+
+  return $lineages[$style];
 }
 
+/**
+ * Get the info for a style, using an additive notation to
+ * include all items from the parent lineage.
+ */
+function advanced_forum_style_info($style = NULL) {
+  static $info = array();
+  if (empty($style)) {
+    // If no style is passed in, assume the current style is wanted.
+    $style = advanced_forum_get_current_style();
+  }
+
+  if (!array_key_exists($style, $info)) {
+    $info[$style] = array();
+    $lineage = advanced_forum_style_lineage();
+    foreach ($lineage as $key => $dir) {
+      // using the + operator is additive but will not overwrite.
+      // $lineage comes out as the actual style with each
+      // successive style after it, so simply adding the arrays
+      // together means that all info will be combined and keys
+      // in the parent info will be defaults passed down to children
+      // only if they do not override them.
+      $info[$style] += advanced_forum_get_style($key);
+    }
+  }
+
+  return $info[$style];
+}
 
 /**
  * This function returns TRUE if the node/comment should be themed and
@@ -109,7 +141,7 @@ function advanced_forum_treat_as_forum_p
       if ($variables['node']->comment_target_nid == $forum_node_id) {
         $decision = TRUE;
       }
-    } 
+    }
     else {
       $vid = variable_get('forum_nav_vocabulary', '');
       $vocabulary = taxonomy_vocabulary_load($vid);
@@ -198,12 +230,12 @@ function advanced_forum_treat_as_forum_p
   return $decision;
 }
 
-// CTOOLS INTEGRATION FOR STYLES ********************************************/ 
-function advanced_forum_ctools_plugin_styles() { 
+// CTOOLS INTEGRATION FOR STYLES ********************************************/
+function advanced_forum_ctools_plugin_styles() {
   return array(
-    'info file' => TRUE, 
+    'info file' => TRUE,
     'load themes' => TRUE,
-  ); 
+  );
 }
 
 function advanced_forum_ctools_plugin_directory($module, $plugin) {
