Flatforum doesn't take into account comment links. For example, if you click on a "Recent Comments" block link, it takes you to the top of the forum node instead of taking you to the post/comment/reply you wanted.

Comments

ricmadeira’s picture

Oops, spoke too soon. The anchor links for comments (like <a id="comment-1283"></a>) are actually there, on the forum nodes, but for some reason the browser doesn't act on them. I tried several themes and several browsers (IE6 and Firefox), so it's definitely something wrong with the HTML output of flatforum, though for the life of me I can't figure out what it is.

trungdong’s picture

The problem is that comment links are put in by the function theme_comment_view, which puts them between

and

tags. I guess this is the reason why these bookmarks are unsuable.

I modify the file template.php so that comment links are put in a

cell instead:
case 'comment' :
        $variables['template_file'] = 'node-forum';
        $variables['row_class'] = _row_class();
        $variables['name'] = $vars['author'];
        $joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
        $variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
        $posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
        $variables['posts'] = $posts ? $posts : 0;
        $variables['submitted'] = format_date($vars['comment']->timestamp);
        $subject = $vars['comment']->subject;
        $variables['title'] = empty($subject) ? '&nbsp' : $subject;
        $variables['content'] = $vars['comment']->comment;
        $variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
        $bookmark = "<a id=\"comment-".$vars['comment']->cid."\"></a>\n";
        if (node_mark($comment->nid, $comment->timestamp) != MARK_READ) {
          $bookmark = "<a id=\"new\"></a>" . $bookmark;
        }
	$variables['bookmark'] = $bookmark;

and

function phptemplate_comment_view($comment, $links = '', $visible = 1) {
  if (_is_forum()) {
	$output = '';
    $comment->new = node_mark($comment->nid, $comment->timestamp);
	// Switch to folded/unfolded view of the comment
	if ($visible) {
	  $comment->comment = check_output($comment->comment, $comment->format);
	  $output .= theme('comment', $comment, $links);
	}	
	else {
      $output .= theme('comment_folded', $comment);
	}
    return $output; 
  }
  else {
	return theme_comment_view($comment, $links, $visible) ;
  }
} 

Please note that I show above only the parts where I put my new codes in template.php.

Ayman’s picture

Status: Active » Fixed

This is fixed in new CSS version, thanks.

Ayman’s picture

Status: Fixed » Closed (fixed)