Add option to make all site comments formatted like forum comments

chazz - January 23, 2008 - 15:24
Project:Advanced Forum
Version:5.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I like advanced forum module, it's really cool. But i would like my comment to looks the same. When somebody post a new comment in forum, it looks good (with pic on the right, post count etc.) That even counts comments using for other nodes. How to do same template (as forum answers) for comments only ? Maybe some advanced comment module ?

#1

chazz - January 31, 2008 - 14:15

Anybody can help please ?

#2

Michelle - January 31, 2008 - 14:49
Title:How to make a comments to looks like advanced forum ?» Add option to make all site comments formatted like forum comments
Category:support request» feature request

This can't be done without hacking the module at this point because it checks to be sure we're on the forum to avoid changing all site comments. I changed it to a feature request and will look at adding a config option for it.

If you want to hack it for now, you would need to adjust the _is_forum() function so it returns true for all comments.

Michelle

#3

chazz - February 6, 2008 - 13:45

I dont know how to hack it :(
I can donate a few $$ if somebody can do this.
Thank you

#4

cs8c - March 4, 2008 - 02:17

This worked for me, at line 178

    case 'comment':
      if (isset($forum_node_id)) {
        // We already know the node ID of the forum
        // thread on this page, we just need to see
        // if this comment goes with it.
        return $vars['comment']->nid == $forum_node_id;
      } else {
        if (arg(0) == 'comment' && is_numeric(arg(1))) {
          $forum_node_id = $vars['comment']->nid;
          return true;
        }
        return false;
      }
   
    default:
      //
      return false;
  } 
}

change to:

    case 'comment':
      if (isset($forum_node_id)) {
        // We already know the node ID of the forum
        // thread on this page, we just need to see
        // if this comment goes with it.
        return $vars['comment']->nid == $forum_node_id;
      } else {
        if (arg(0) == 'comment' && is_numeric(arg(1))) {
          $forum_node_id = $vars['comment']->nid;
          return true;
        }
        return true;
      }
   
    default:
      //
      return false;
  } 
}

#5

Michelle - April 9, 2008 - 03:47
Status:active» fixed

Yay, finally got to this so I can stop hacking my own module on my own site each time. LOL

Michelle

#6

Anonymous (not verified) - April 23, 2008 - 03:51
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.