? discuss.patch ? files ? phpinfo.php ? replace.php ? simpletest ? modules/policy ? sites/10.0.1.2 ? sites/localhost ? sites/mwpb-2.local Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.353 diff -F^f -u -r1.353 comment.module --- modules/comment.module 22 May 2005 21:14:59 -0000 1.353 +++ modules/comment.module 11 Jun 2005 20:56:22 -0000 @@ -147,6 +147,13 @@ function comment_menu($may_cache) { 'callback' => 'node_page', 'type' => MENU_CALLBACK); } + if ((arg(0) == 'node') && is_numeric(arg(1)) && variable_get('comment_task', FALSE)) { + $title = t('discuss'); + $num = comment_num_all(arg(1)); + $title .= " ($num)"; + $items[] = array('path' => ('node/'. arg(1) .'/discuss'), 'title' => $title, + 'callback' => 'comment_task', 'callback arguments' => array(arg(1), arg(3)), 'type' => MENU_LOCAL_TASK, 'access' => user_access('access comments')); + } } return $items; @@ -315,6 +322,7 @@ function comment_configure() { } $group = form_radios(t('Default display mode'), 'comment_default_mode', variable_get('comment_default_mode', 4), _comment_get_modes(), t('The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.')); + $group .= form_checkbox(t('Show comments on own tab when viewing a post.'), 'comment_task', 1, variable_get('comment_task', FALSE)); $group .= form_radios(t('Default display order'), 'comment_default_order', variable_get('comment_default_order', 1), _comment_get_orders(), t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.')); $group .= form_select(t('Default comments per page'), 'comment_default_per_page', variable_get('comment_default_per_page', '50'), _comment_per_page(), t('Default number of comments for each page: more comments are distributed in several pages.')); $group .= form_radios(t('Comment controls'), 'comment_controls', variable_get('comment_controls', 3), array(t('Display above the comments'), t('Display below the comments'), t('Display above and below the comments'), t('Do not display')), t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.')); @@ -704,6 +712,16 @@ function comment_links($comment, $return return $links; } +function comment_task($nid, $cid = 0) { + $node = node_load(array('nid' => $nid)); + $output = comment_render($node, $cid); + // if (!$output) { + // drupal_set_message(t('there are no comments for this post.')); + // } + drupal_set_title($node->title); + return $output; +} + function comment_render($node, $cid = 0) { global $user; @@ -1310,7 +1328,8 @@ function comment_save_settings() { $_SESSION['comment_threshold'] = $threshold; $_SESSION['comment_comments_per_page'] = $comments_per_page; } - drupal_goto('node/'. $edit['nid'] .'#comment'); + dprint_r($_GET);die(); + drupal_goto($_GET['q']); } function comment_num_all($nid) { Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.496 diff -F^f -u -r1.496 node.module --- modules/node.module 6 Jun 2005 14:07:04 -0000 1.496 +++ modules/node.module 11 Jun 2005 20:56:24 -0000 @@ -522,7 +522,7 @@ function node_prepare($node, $teaser = F function node_show($node, $cid) { $output = node_view($node, FALSE, TRUE); - if (function_exists('comment_render') && $node->comment) { + if (!variable_get('comment_task', FALSE) && function_exists('comment_render') && $node->comment) { $output .= comment_render($node, $cid); }