? 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
? preprocess-for-styles.patch
? root-forum-containers.patch
? styles/cloudless_day/cloudless_day.inc
Index: advanced_forum.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/advanced_forum.module,v
retrieving revision 1.149.2.42
diff -u -p -r1.149.2.42 advanced_forum.module
--- advanced_forum.module	28 Jul 2009 21:04:30 -0000	1.149.2.42
+++ advanced_forum.module	28 Jul 2009 21:40:19 -0000
@@ -151,6 +151,7 @@ function advanced_forum_theme() {
  * Implementation of hook_theme_registry_alter().
  */
 function advanced_forum_theme_registry_alter(&$theme_registry) {
+  advanced_forum_load_style_includes();
   // Garland's phptemplate_comment_wrapper really sucks. Chances are, a theme
   // does NOT want to control this on forum nodes anyway, so we're going to take
   // it over:
@@ -231,7 +232,6 @@ function advanced_forum_theme_registry_a
   foreach ($templates as $template) {
     // Sanity check in case the template is not being used.
     if (!empty($theme_registry[$template])) {
-
       // If there was a path in there, store it.
       $existing_path = array_shift($theme_registry[$template]['theme paths']);
 
@@ -248,6 +248,30 @@ function advanced_forum_theme_registry_a
 
       // Put the active theme's path last since that takes precidence.
       $theme_registry[$template]['theme paths'][] = advanced_forum_path_to_theme();
+
+      // Add preprocess functions if our style has them.
+      $preprocess = array();
+      foreach ($lineage as $key => $path) {
+        if (function_exists('advanced_forum_' . $key . '_preprocess_' . $template)) {
+          $preprocess[] = 'advanced_forum_' . $key . '_preprocess_' . $template;
+        }
+      }
+
+      // There are preprocess functions to add, so figure out where we want to add
+      // them.
+      if ($preprocess) {
+        $position = 0;
+        foreach ($theme_registry[$template]['preprocess functions'] as $function) {
+          $position++;
+          // If we see either of these items, that means we can place our
+          // preprocess functions after this.
+          if (substr($function, 0, 25) == 'advanced_forum_preprocess' || substr($function, 0, 34) == 'template_preprocess_advanced_forum') {
+            break;
+          }
+        }
+        // Add in our new preprocess functions:
+        array_splice($theme_registry[$template]['preprocess functions'], $position, 0, $preprocess);
+      }
     }
   }
 }
@@ -583,6 +607,8 @@ function _advanced_forum_add_files() {
         }
       }
     }
+
+    advanced_forum_load_style_includes();
   }
 }
 
Index: includes/style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/style.inc,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 style.inc
--- includes/style.inc	28 Jul 2009 21:04:31 -0000	1.1.2.7
+++ includes/style.inc	28 Jul 2009 21:40:20 -0000
@@ -97,6 +97,18 @@ function advanced_forum_style_lineage($s
 }
 
 /**
+ * Load any .inc files related to the style so that preprocess
+ * functions can run as appropriate.
+ */
+function advanced_forum_load_style_includes($style = NULL) {
+  $lineage = advanced_forum_style_lineage($style);
+  foreach ($lineage as $key => $path) {
+    if (file_exists("$path/$key.inc")) {
+      require_once("$path/$key.inc");
+    }
+  }
+}
+/**
  * Get the info for a style, using an additive notation to
  * include all items from the parent lineage.
  */
