From 7ebd772f417fe7bd6324fdd12707c1b9c89ce324 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 16 Oct 2004 07:22:26 +0000 Subject: - Patch #10664 by TDobes: fixed collapsed comments + updated the code comments. --- modules/comment.module | 7 ++++++- modules/comment/comment.module | 7 ++++++- modules/node.module | 3 +-- modules/node/node.module | 3 +-- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/comment.module b/modules/comment.module index e2938f22d..f8b08f27f 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -136,6 +136,11 @@ function comment_menu($may_cache) { $items[] = array('path' => 'comment', 'title' => t('reply to comment'), 'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK); } + else if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) { + $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'), + 'callback' => 'node_page', + 'type' => MENU_CALLBACK); + } return $items; } @@ -1577,7 +1582,7 @@ function theme_comment($comment, $links = 0) { function theme_comment_folded($comment) { $output = "
\n"; - $output .= ' '. l($comment->subject, comment_node_url() .'/view/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ($comment->new ? ' '. theme('mark') : '') .' '; + $output .= ' '. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ($comment->new ? ' '. theme('mark') : '') .' '; $output .= ''. t('by') .' '. format_name($comment) ."\n"; $output .= "
\n"; return $output; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index e2938f22d..f8b08f27f 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -136,6 +136,11 @@ function comment_menu($may_cache) { $items[] = array('path' => 'comment', 'title' => t('reply to comment'), 'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK); } + else if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) { + $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'), + 'callback' => 'node_page', + 'type' => MENU_CALLBACK); + } return $items; } @@ -1577,7 +1582,7 @@ function theme_comment($comment, $links = 0) { function theme_comment_folded($comment) { $output = "
\n"; - $output .= ' '. l($comment->subject, comment_node_url() .'/view/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ($comment->new ? ' '. theme('mark') : '') .' '; + $output .= ' '. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ($comment->new ? ' '. theme('mark') : '') .' '; $output .= ''. t('by') .' '. format_name($comment) ."\n"; $output .= "
\n"; return $output; diff --git a/modules/node.module b/modules/node.module index 996e7631e..dc7598177 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1449,9 +1449,8 @@ function node_page() { $op = $_POST['op'] ? $_POST['op'] : arg(1); $edit = $_POST['edit']; - // Temporary solution for backward compatibility. if (is_numeric($op)) { - $op = arg(2) ? arg(2) : 'view'; + $op = (arg(2) && !is_numeric(arg(2))) ? arg(2) : 'view'; } switch ($op) { diff --git a/modules/node/node.module b/modules/node/node.module index 996e7631e..dc7598177 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1449,9 +1449,8 @@ function node_page() { $op = $_POST['op'] ? $_POST['op'] : arg(1); $edit = $_POST['edit']; - // Temporary solution for backward compatibility. if (is_numeric($op)) { - $op = arg(2) ? arg(2) : 'view'; + $op = (arg(2) && !is_numeric(arg(2))) ? arg(2) : 'view'; } switch ($op) { -- cgit v1.2.3