diff --git a/quote_plus.module b/quote_plus.module index a25584d7e1778f159d22784dc7d8d65f4783acba..cea18796ce3b61b779fbff9323aa71470da0b28c 100644 --- a/quote_plus.module +++ b/quote_plus.module @@ -59,7 +59,6 @@ function quote_plus_comment(&$a1, $op) { case 'view': // Optionally add the thread-specific "vancode" ID in a readable form // like #1, #2, # - #dsm($a1); break; } } @@ -423,7 +422,7 @@ function quote_plus_link($type, $object, $teaser = FALSE) { $multiquote_link_title_node, $multiquote_link_title_comment, $multiquote_link_tip, $multiquotes, $multiquote_unlink_title_node, $multiquote_unlink_title_comment, $multiquote_unlink_title_node, - $multiquote_unlink_tip; + $multiquote_unlink_tip, $collapsed; static $node_data = array(); static $enable_quote = array(); @@ -447,6 +446,13 @@ function quote_plus_link($type, $object, $teaser = FALSE) { ) == COMMENT_FORM_BELOW; } + // 3. Does the current user view expanded or collapsed comments? + // (Important for adding multiquote links at all.) + if(!isset($collapsed)) { + $collapsed = _comment_get_display_setting('mode', $master_node); + $collapsed = $collapsed == COMMENT_MODE_FLAT_COLLAPSED || $collapsed == COMMENT_MODE_THREADED_COLLAPSED; + } + // We also need the data of the node the current object is (related to). // But we do not want to load a node any more often than once. if (!isset($node_data[$object->nid])) { @@ -552,6 +558,8 @@ function quote_plus_link($type, $object, $teaser = FALSE) { && $has_comment_form && + !$collapsed + && $object->nid == $master_node->nid ) { // Determine whether this object is to be multiquoted.