Commit ca8e9a1e authored by Dries's avatar Dries

- Patch #180432 by hunmonk, sun, et al: make comment settings per node type. ...

- Patch #180432 by hunmonk, sun, et al: make comment settings per node type.  This is a new feature that slipped in because it is required for the project module on drupal.org.
parent afb7bf85
......@@ -31,6 +31,32 @@ function comment_update_6001() {
return $ret;
}
/**
* Changed comment settings from global to per-node -- copy global
* settings to all node types.
*/
function comment_update_6002() {
$settings = array(
'comment_default_mode' => COMMENT_MODE_THREADED_EXPANDED,
'comment_default_order' => COMMENT_ORDER_NEWEST_FIRST,
'comment_default_per_page' => 50,
'comment_controls' => COMMENT_CONTROLS_HIDDEN,
'comment_anonymous' => COMMENT_ANONYMOUS_MAYNOT_CONTACT,
'comment_subject_field' => 1,
'comment_preview' => COMMENT_PREVIEW_REQUIRED,
'comment_form_location' => COMMENT_FORM_SEPARATE_PAGE,
);
$types = node_get_types();
foreach ($settings as $setting => $default) {
$value = variable_get($setting, $default);
foreach ($types as $type => $object) {
variable_set($setting .'_'. $type, $value);
}
variable_del($setting);
}
return array();
}
/**
* Implementation of hook_schema().
*/
......
This diff is collapsed.
......@@ -813,7 +813,7 @@ function template_preprocess_forum_topic_list(&$variables) {
$variables['topics'][$id]->new_url = '';
if ($topic->new_replies) {
$variables['topics'][$id]->new_text = t('!count new', array('!count' => $variables['forums'][$id]->new_topics));
$variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->num_comments, $topic->new_replies, $topic->nid), 'fragment' => 'new'));
$variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->num_comments, $topic->new_replies, $topic), 'fragment' => 'new'));
}
}
......
......@@ -57,7 +57,7 @@ function tracker_page($uid = 0) {
if ($new = comment_num_new($node->nid)) {
$comments .= '<br />';
$comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array('query' => comment_new_page_count($node->comment_count, $new, $node->nid), 'fragment' => 'new'));
$comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array('query' => comment_new_page_count($node->comment_count, $new, $node), 'fragment' => 'new'));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment