? 481278-forum-search-views.tar.gz
? 481278-forum-search.patch
? defeat-garland-comment-wrapper.patch
? fix-new-numbering-anchors.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.18
diff -u -p -r1.149.2.18 advanced_forum.module
--- advanced_forum.module	16 Jun 2009 01:44:09 -0000	1.149.2.18
+++ advanced_forum.module	17 Jun 2009 21:34:11 -0000
@@ -768,6 +768,38 @@ function advanced_forum_get_forum_list($
 }
 
 /**
+ * Post render a view and replace any advanced forum tokens.
+ */
+function advanced_forum_views_post_render(&$view, &$output) {
+  if (!$view->style_plugin->uses_row_plugin()) {
+    return;
+  }
+
+  $plugin = $view->display_handler->get_option('row_plugin');
+  if ($plugin == 'node' || $plugin == 'nodecomment_threaded') {
+    // Look for token matches in the output:
+    $matches = array();
+    $tokens = array();
+
+    // We want to change the look of the 'new' marker from the default, slightly:
+    $tokens['<span class="new">' . t('new') . '</span>'] = '<span class="new">(' . t('new') . ')</span>';
+
+    if (preg_match_all('/<!--post:author-pane-([\d]+)-->/us', $output, $matches)) {
+      foreach ($matches[1] as $match => $uid) {
+        $token = $matches[0][$match]; // This is the exact string that matched.
+        if (!isset($tokens[$token])) {
+          $account = user_load($uid);
+          $tokens[$token] = theme('author_pane', $account, advanced_forum_path_to_images(), 'advanced_forum-author-pane');
+        }
+      }
+    }
+
+    // Perform replacements.
+    $output = strtr($output, $tokens);
+  }
+}
+
+/**
  * Allow themable wrapping of all comments.
  */
 function advanced_forum_comment_wrapper($content, $node) {
Index: includes/advanced_forum_preprocess_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/advanced_forum_preprocess_node.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 advanced_forum_preprocess_node.inc
--- includes/advanced_forum_preprocess_node.inc	15 Jun 2009 17:51:23 -0000	1.1.2.1
+++ includes/advanced_forum_preprocess_node.inc	17 Jun 2009 21:34:11 -0000
@@ -57,8 +57,15 @@ function _advanced_forum_preprocess_node
 
   /* User information / author pane */
   $variables['account'] = user_load(array('uid' => $variables['node']->uid));
-  $variables['author_pane'] = theme('author_pane', $variables['account'], advanced_forum_path_to_images(), 'advanced_forum-author-pane');
-
+  // Only do this if post rendering is supported:
+  if (method_exists('views_plugin_cache', 'post_render')) {
+    // Place a token that will later be replaced by the author pane, which
+    // will keep the pane fresh even when the view result is cached.
+    $variables['author_pane'] = '<!--post:author-pane-' . $variables['node']->uid . '-->';
+  }
+  else {
+    $variables['author_pane'] = theme('author_pane', $variables['account'], advanced_forum_path_to_images(), 'advanced_forum-author-pane');
+  }
   /* Signatures */
   if (module_exists('signature_forum')) {
     // If Signature For Forums is installed, use that
Index: styles/naked/advanced_forum-post.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/styles/naked/Attic/advanced_forum-post.tpl.php,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 advanced_forum-post.tpl.php
--- styles/naked/advanced_forum-post.tpl.php	10 Jun 2009 03:54:25 -0000	1.1.2.3
+++ styles/naked/advanced_forum-post.tpl.php	17 Jun 2009 21:34:11 -0000
@@ -39,11 +39,11 @@
     <div class="posted-on">
       <?php print $date ?>
 
-      <?php if (!$top_post && !empty($new)): ?>
+      <?php if (!$top_post): ?>
         <?php if (!empty($first_new)): ?>
           <?php print $first_new; ?>
         <?php endif; ?>
-        <span class="new">(<?php print $new ?>)</span>
+        <?php print $new_output; ?>
       <?php endif; ?>
     </div>
 
