? af-#992428.patch
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/CHANGELOG.txt,v
retrieving revision 1.101.2.184
diff -u -p -r1.101.2.184 CHANGELOG.txt
--- CHANGELOG.txt	26 Jan 2011 05:43:28 -0000	1.101.2.184
+++ CHANGELOG.txt	27 Jan 2011 17:01:41 -0000
@@ -2,6 +2,10 @@ $Id: CHANGELOG.txt,v 1.101.2.184 2011/01
 
 ****************************** DRUPAL 6 - 2.x BRANCH ********************************
 
+January 27, 2011
+----------------
+#992428 by Michelle: Fixed mark as read so it's not displayed on containers.
+
 January 25, 2011
 ----------------
 #935778 by troky, Michelle: Remove 'views' column when statistics not enabled.
Index: advanced_forum.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/advanced_forum.module,v
retrieving revision 1.149.2.90
diff -u -p -r1.149.2.90 advanced_forum.module
--- advanced_forum.module	16 Jan 2011 05:21:29 -0000	1.149.2.90
+++ advanced_forum.module	27 Jan 2011 17:01:42 -0000
@@ -1116,7 +1116,7 @@ function advanced_forum_node_type_create
  */
 function advanced_forum_forum_tools($tid=0) {
   global $user;
-
+  
   if ($tid > 0) {
     $targets[url("forum/active", array('query' => "forum[]=$tid"))] = "View active posts in this forum";
     $targets[url("forum/unanswered", array('query' => "forum[]=$tid"))] = "View unanswered posts in this forum";
@@ -1126,9 +1126,7 @@ function advanced_forum_forum_tools($tid
       
       if (module_exists('nodecomment')) {
         $targets[url("forum/user", array('query' => "forum[]=$tid"))] = "View your posts in this forum";
-      }
-      
-      $targets[url("forum/markasread/$tid")] = "Mark this forum read";
+      }    
     }    
   }
   else {
@@ -1141,11 +1139,22 @@ function advanced_forum_forum_tools($tid
       if (module_exists('nodecomment')) {
         $targets[url("forum/user")] = "View your forum posts";
       }
-      
-      $targets[url("forum/markasread")] = "Mark all forums read";
     }      
   }
   
+  // Add mark as read to the jump list.
+  // This code is a little odd and needs explaining. The return value of
+  // the mark_as_read function is already formed HTML and so is unsuitable
+  // for the jump list. The function already has built in the ability
+  // to add to an existing $links array, which has the URL and title text
+  // separated. Rather than add a third method just for the jump menu, I
+  // reused that functionality here.
+  $mark_as_read = array();
+  advanced_forum_get_mark_read_link($tid, $mark_as_read);
+  if (!empty($mark_as_read['mark-read']['href'])) {
+    $targets[url($mark_as_read['mark-read']['href'])] = $mark_as_read['mark-read']['title'];
+  }
+
   $options['choose'] = t("- Forum Tools -");
 
   // Create and return the jump menu.
Index: includes/mark-read.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/mark-read.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 mark-read.inc
--- includes/mark-read.inc	9 Jul 2010 04:38:12 -0000	1.1.2.1
+++ includes/mark-read.inc	27 Jan 2011 17:01:42 -0000
@@ -11,7 +11,7 @@
  * Either fill a $links array or return a string version of the link to mark read.
  */
 function advanced_forum_get_mark_read_link($tid = 0, &$links = array()) {
-  if (advanced_forum_markasread_access()) {
+  if (advanced_forum_markasread_access() && !in_array($tid, variable_get('forum_containers', array()))) {
     if ($tid) {
       $links['mark-read']['title'] = t('Mark all topics read');
       $links['mark-read']['href'] = "forum/markasread/$tid";
Index: plugins/content_types/forum_mark_read.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/plugins/content_types/Attic/forum_mark_read.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 forum_mark_read.inc
--- plugins/content_types/forum_mark_read.inc	26 Jan 2011 02:36:08 -0000	1.1.2.2
+++ plugins/content_types/forum_mark_read.inc	27 Jan 2011 17:01:42 -0000
@@ -38,7 +38,8 @@ function advanced_forum_forum_mark_read_
   $block->title = ''; // by default this has no title.
   _advanced_forum_add_files();
 
-  $block->content = '<div class="forum-mark-read">' . advanced_forum_get_mark_read_link($tid) . '</div>';
+  $mar_link = advanced_forum_get_mark_read_link($tid);
+  $block->content = (empty($mar_link)) ? '' : '<div class="forum-mark-read">' . advanced_forum_get_mark_read_link($tid) . '</div>';
 
   return $block;
 }
