<?php /** * Comments Default Configuration * * To enable comments on your own {@link DataObject}'s you need to * call Commenting::add_comments($object_name, $settings); * * Where $object_name is the name of the subclass of DataObject you want * to add the comments to and $settings is a map of configuration options * and values * * Example: mysite/_config.php * * <code> * // uses the default values * Commenting::add('SiteTree'); * * // set configuration * Commenting::add('SiteTree', array( * 'require_login' => true * )); * </code> */ Commenting::add('SiteTree');
<?php if (ClassInfo::exists('Commenting')) { // Add commenting to discussions Commenting::add('Discussion', array("require_login" => true, "required_permission" => "DISCUSSIONS_REPLY", "order_comments_by" => "\"Created\" ASC")); Object::add_extension("Member", "DiscussionsMember"); Object::add_extension("Group", "DiscussionsGroup"); Object::add_extension("Comment", "DiscussionsComment"); if (class_exists('Users_Account_Controller')) { Users_Account_Controller::add_extension('DiscussionsUsersController'); } }