--- advanced_forum.module	2008-10-21 13:17:47.000000000 +1000
@@ -820,6 +820,14 @@
 
       // Send the NID into the icon theme code so it can be linked to the topic
       $variables['topics'][$id]->icon = theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky, $topic->nid);
+	    if ( !is_null($variables['topics'][$id]->vid) ) {
+			foreach (taxonomy_node_get_terms($variables['topics'][$id])  as $term ) {		
+			    if ($image = taxonomy_image_display($term->tid)) {
+			      $variables['topics'][$id]->icon = $image;
+			    }
+			} 
+		}
+
 
       // Add in the number of views
       if (module_exists('statistics')) {
@@ -874,7 +882,13 @@
   if ($tid && !in_array($tid, variable_get('forum_containers', array()))) {
     $topics = forum_get_topics($tid, $sortby, $forum_per_page);
   }
-
+  // Retrieve the $Vid for each Topic.
+	foreach ( $topics as $topic_id => $topic ) {
+		if ( is_null($topic->vid) ) {
+			$topic->vid = db_result(db_query("SELECT vid FROM {node} WHERE nid = %d", $topic->nid));
+		}
+		$topics[$topic_id] = $topic; 
+	}
   return theme('forums', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
 }
 
