172800 => get_string('numdays', '', 2),
604800 => get_string('numdays', '', 7))));
$temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
+ $temp->add(new admin_setting_configcheckbox('blogusecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
+ $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', get_string('showcommentscount', 'admin'), get_string('configshowcommentscount', 'admin'), 1));
$ADMIN->add('appearance', $temp);
// Navigation settings
global $USER, $CFG, $COURSE, $DB, $OUTPUT, $PAGE;
$user = $DB->get_record('user', array('id'=>$this->userid));
- // Comments
- $cmt = new stdClass();
- $cmt->context = get_context_instance(CONTEXT_USER, $user->id);
- $cmt->courseid = $PAGE->course->id;
- $cmt->area = 'format_blog';
- $cmt->env = 'blog';
- $cmt->itemid = $this->id;
- $options->comments = $cmt;
+ $options = new stdclass;
+ if ($CFG->blogusecomments) {
+ // Comments
+ $cmt = new stdClass();
+ $cmt->context = get_context_instance(CONTEXT_USER, $user->id);
+ $cmt->courseid = $PAGE->course->id;
+ $cmt->area = 'format_blog';
+ $cmt->env = 'blog';
+ $cmt->itemid = $this->id;
+ $cmt->showcount = $CFG->blogshowcommentscount;
+ $options->comments = $cmt;
+ }
$this->summary = file_rewrite_pluginfile_urls($this->summary, 'pluginfile.php', SYSCONTEXTID, 'blog_post', $this->id);
$template['body'] = format_text($this->summary, $this->summaryformat, $options);
$string['configsessioncookiepath'] = 'If you need to change where browsers send the Moodle cookies, you can change this setting to specify a subdirectory of your web site. Otherwise the default \'/\' should be fine.';
$string['configsessiontimeout'] = 'If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended). This variable specifies how long this time should be.';
$string['configshowblocksonmodpages'] = 'Some activity modules support blocks on their pages. If you turn this on, then teachers will be able to add side blocks on those pages, otherwise the interface does not show this feature.';
+$string['configshowcommentscount'] = 'Show comments count, it will cost one more query when display comments link';
$string['configshowsiteparticipantslist'] = 'All of these site students and site teachers will be listed on the site participants list. Who shall be allowed to see this site participants list?';
$string['configsitedefaultlicense'] = 'Default site license';
$string['configsitedefaultlicensehelp'] = 'Default license will be used to publish content on this site';
$string['settingmemorylimit'] = 'Insufficient memory detected, please set higher memory limit in PHP settings.';
$string['settingsafemode'] = 'Moodle is not fully compatible with safe mode, please ask server administrator to turn it off. Running Moodle under safe mode is not supported, please expect various problems if you do so.';
$string['showblocksonmodpages'] = 'Show blocks on module pages';
+$string['showcommentscount'] = 'Show comments count';
$string['showdetails'] = 'Show details';
$string['simpletest'] = 'Unit tests';
$string['simplexmlrequired'] = 'The SimpleXML PHP extension is now required by Moodle.';