--- modules/comment.module Wed Jun 23 13:25:20 2004 +++ comment.module Wed Jun 23 13:24:57 2004 @@ -545,6 +545,7 @@ // Single comment view. $output .= '
\n"; + $output .= form_hidden('return_url', comment_node_url()); $output .= form_hidden('nid', $nid); $result = db_query('SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.picture, u.data, c.score, c.users', $cid); @@ -658,11 +659,13 @@ if (db_num_rows($result) && (variable_get('comment_controls', 0) == 0 || variable_get('comment_controls', 0) == 2)) { $output .= '
\n"; $output .= theme('comment_controls', $threshold, $mode, $order, $comments_per_page); + $output .= form_hidden('return_url', comment_node_url()); $output .= form_hidden('nid', $nid); $output .= '
'; } $output .= '
\n"; + $output .= form_hidden('return_url', comment_node_url()); $output .= form_hidden('nid', $nid); while ($comment = db_fetch_object($result)) { @@ -701,6 +704,7 @@ if (db_num_rows($result) && (variable_get('comment_controls', 0) == 1 || variable_get('comment_controls', 0) == 2)) { $output .= '
\n"; $output .= theme('comment_controls', $threshold, $mode, $order, $comments_per_page); + $output .= form_hidden('return_url', comment_node_url()); $output .= form_hidden('nid', $nid); $output .= '
'; } @@ -854,7 +858,7 @@ case t('Moderate comments'): case t('Moderate comment'): comment_moderate($edit); - drupal_goto('node/'. $edit['nid'] .'#comment'); + drupal_goto($edit['return_url']); break; case 'reply': print theme('page', comment_reply(check_query(arg(3)), check_query(arg(2))), t('Add new comment')); @@ -874,7 +878,7 @@ $comments_per_page = $_POST['comments_per_page']; comment_save_settings(check_query($mode), check_query($order), check_query($threshold), check_query($comments_per_page)); - drupal_goto('node/'. $edit['nid'] .'#comment'); + drupal_goto($edit['return_url']); break; } }