I know that this is traditionally not a problem with Adv Forum but my testing seems to have identified it as the source of my troubles.The problem specifically being that I cannot modify the forum comment wrapper in template.php while Adv Forum is activated. Here is the code I have in template.php right now (default with a slight div modification):

function phptemplate_comment_wrapper($content, $type = null) {
  static $node_type;
  if (isset($type)) $node_type = $type;

  if (!$content || $node_type == 'forum') {
    return '<div id="comments">'. $content . '</div>';
  }
  else {
    return '<div class="comfield"><h2 class="comments"><a href="#">Comments</a></h2><div class="comwrapper">'. $content .'</div></div>';
  }
}

Now it should work just fine and not display the "Comments" heading, and it does for vanilla Drupal forums, but when Adv Forum is active the comment wrapper is no longer modified. I can't really think of a reason for this to be as I am pretty sure the content type isn't changed so it should reference the same. Hopefully you might have a hunch :).

Comments

michelle’s picture

Hmm.... Interesting. I always assumed this was a bug in Garland and commented out that whole function to get rid of the "Comments". It never occured to me that it could be an advforum bug because I don't do anything with that function. I'll have a look and see if I can figure it out.

Michelle

michelle’s picture

Category: bug » support
Status: Active » Fixed

Oh! Ironically, I just now had an unrelated conversation on IRC that made me realize what the problem is. That function never gets the node type set to "forum", which I thought was a bug in Garland. But I just realized it's because I don't have the call to that function in the .tpl file to set the static variable.

This isn't really a bug, just a minor incompatibility with the theme. There's a couple of ways around it (off the top of my head, untested):

1) Add this to the top of advf-forum-post.tpl.php: phptemplate_comment_wrapper(NULL, $node->type);

2) Restructure the phptemplate_comment_wrapper code that so it doesn't do the modified div if $type isn't set.

If neither of those fix it, re-open this and I'll look at it closer. Either way, I'd appreciate a comment back to let me know what works and I'll document it in the troubleshooting section.

Michelle

Kripsy’s picture

Thanks Michelle, your quick support is appreciated. I only tried remedy 1) because it worked just fine. Cheers.

michelle’s picture

Thanks for the update. I documented this in the troubleshooting section.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

navi85sin’s picture

hi,

i want to uplaod an different tpl file for comment, then how can i do that as in advf-forum-post.tpl.php which shows the combined comments and topics,

what i want is to seperate them.

any solution?