summaryrefslogtreecommitdiff
path: root/modules/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment.module')
-rw-r--r--modules/comment.module80
1 files changed, 60 insertions, 20 deletions
diff --git a/modules/comment.module b/modules/comment.module
index caaca8f09..b8429670d 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -19,12 +19,12 @@ function comment_help($section = "admin/comment/help") {
$output .= "<li><b>Expanded</b> -- Displays the title and text for each post.</li>";
$output .= "<li><b>Collapsed</b> -- Displays only the title for each post.</li>";
$output .= "</ul>";
- $output .= strtr("<p>When a user chooses <i>save settings</i>, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in %comment-config.</p>",array("%comment-config" => l(t("site configuration &raquo; modules &raquo; comment"), "admin/system/modules/comment") ));
+ $output .= "<p>When a user chooses <i>save settings</i>, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in %comment-config.</p>";
$output .= "<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>";
$output .= "<h3>Additional comment configurations</h3>";
- $output .= strtr("<p>Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in %site-config under <i>Submission settings</i>.</p>", array("%site-config" => l(t("site configuration"), "admin/system") ));
- $output .= strtr("<p>Administrators can control access to various comment module functions through %user-permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.</p>", array("%user-permissions" => l(t("user management &raquo; user permissions"), "admin/user/permission") ));
+ $output .= "<p>Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in %site-config under <i>Submission settings</i>.</p>";
+ $output .= "<p>Administrators can control access to various comment module functions through %user-permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.</p>";
$output .= "<p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>";
$output .= "<ul>";
$output .= "<li><b>Access comments</b> -- Allows users to view comments.</li>";
@@ -38,17 +38,17 @@ function comment_help($section = "admin/comment/help") {
$output .= "<p>Drupal provides specific features to inform site members when new comments have been posted:</p>";
$output .= "<ul>";
$output .= "<li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>";
- $output .= strtr("<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. When logged in, members will find a %tracker in their user information block with a link to the %tracker-recent page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>",array("%tracker" => l(t("view recent posts"), "tracker"), "%tracker-recent" => l(t("Recent activity"), "tracker") ));
- $output .= strtr("<li>Some administrators may want to %download-notify, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>", array("%download-notify" => "<a href=\"http://drupal.org/node/view/68\">". t("download") ."</a>" ));
+ $output .= "<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. When logged in, members will find a %tracker in their user information block with a link to the %tracker-recent page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>";
+ $output .= "<li>Some administrators may want to %download-notify, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>";
$output .= "</ul>";
$output .= "<h3>Comment moderation</h3>";
$output .= "<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>";
$output .= "<p>With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.</p>";
- $output .= strtr("<p>To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.</p>", array("%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management &raquo; comment moderation"), "admin/comment/moderation") ));
+ $output .= "<p>To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.</p>";
$output .= "<h4>Moderation votes</h4>";
- $output .= strtr("<p>The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>", array("%comment-votes" => l(t("comment management &raquo; comment moderation &raquo; votes"), "admin/comment/moderation/votes") ));
+ $output .= "<p>The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>";
$output .= "<ul>";
$output .= "<li>Excellent +3</li>";
$output .= "<li>Insightful +2</li>";
@@ -62,24 +62,64 @@ function comment_help($section = "admin/comment/help") {
$output .= "<h4>Moderator vote/values matrix</h4>";
- $output .= strtr("<p>Next go to %comment-matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.</p>", array("%comment-matrix" => l(t("comment management &raquo; comment moderation &raquo; matrix"), "admin/comment/moderation/,atrix") ));
+ $output .= "<p>Next go to %comment-matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.</p>";
$output .= "<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>";
- $output .= "<h4>Creating comment thresholds</h4>
-<p>In <i>comment management &raquo; comment moderation &raquo; thresholds</i>, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.</p>
-<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>
-<p>To see a common example of how thresholds work, you might visit <a href=\"http://slashdot.org/\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
-
-<h4>Initial comment scores</h4>
-<p>Finally, you may want to enter some <i>initial comment scores</i>. In <i>comment management &raquo; initial comment scores </i>you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of <b>0</b> as the default.</p>";
- break;
+ $output .= "<h4>Creating comment thresholds</h4>";
+ $output .= "<p>In %comment-thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting their thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.</p>";
+ $output .= "<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>";
+ $output .= "<p>To see a common example of how thresholds work, you might visit %slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>";
+
+ $output .= "<h4>Initial comment scores</h4>";
+ $output .= "<p>Finally, you may want to enter some <i>initial comment scores</i>. In %comment-inital you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of <b>0</b> as the default.</p>";
+ $output = t($output, array("%comment-config" => l(t("site configuration &raquo; modules &raquo; comment"), "admin/system/modules/comment"), "%site-config" => l(t("site configuration"), "admin/system"), "%user-permissions" => l(t("user management &raquo; user permissions"), "admin/user/permission"), "%tracker" => l(t("view recent posts"), "tracker"), "%tracker-recent" => l(t("Recent activity"), "tracker"), "%download-notify" => "<a href=\"http://drupal.org/node/view/68\">". t("download") ."</a>", "%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management &raquo; comment moderation"), "admin/comment/moderation"), "%comment-votes" => l(t("comment management &raquo; comment moderation &raquo; votes"), "admin/comment/moderation/votes"), "%comment-matrix" => l(t("comment management &raquo; comment moderation &raquo; matrix"), "admin/comment/moderation/matrix"), "%comment-thresholds" => l(t("comment management &raquo; comment moderation %raquo; thresholds"), "admin/comment/moderation/thresholds"), "%slashdot" => "\<a href=\"http://slashdot.org/\">Slashdot<a>", "%comment-inital" => l(t("comment management &raquo; initial comment scores"), "admin/comments/moderation/roles") ));
+ break;
+ case 'admin/system/modules':
+ $output = t("Enables user to comment on content (nodes).");
+ break;
+ case 'admin/system/modules/comment':
+ $output = t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below and slightly indented forming an outline. They also come in two styles: \"expanded\", where you see both the title and the contents, and \"collapsed\" where you only see the title. To set the default threshold you first have to set up thresholds in the %threshold area. Preview comment forces a user to look at their comment by clicking on a \"Preview\" button before they can actually add the comment. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array("%threshold" => l(t("comment management &raquo; comment moderation &raquo; thresholds"), "admin/comment/moderation/filters")));
+ break;
+ case 'admin/comment':
+ $output = t("Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.");
+ break;
+ case 'admin/comment/comments':
+ $output = t("Click on %nup to see your latest comments, or %queue\ to approve new comments.", array("%nup" => l(t("new or updated comments"), "admin/comment/0"), "%queue" => l(t("comment approval queue"), "admin/comment/1")));
+ break;
+ case 'admin/comment/comments/0':
+ $output = t("Below is a list of the latest comments posted your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ break;
+ case 'admin/comment/comments/1':
+ $output = t("Below is a list of the comments posted to your site that need approval. To approve a comment click on <b>\"edit comment\"</b> and then change it's <b>moderation status</b> to Approved.<br />Click on a subject to see the comment, the author's name to edit the author's user information, \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ break;
+ case 'admin/comments/moderation':
+ $output = t("If you have a get a lot of comments, you can enable comment moderation. Once moderation is enabled users can vote on a comment based on dropdown menus. %votes sets up the names in the dropdown menu, and the order in which they appear, using weights. %matrix sets up the value of each user's vote, and %threshold sets up the levels at which a comment will be displayed.", array("%votes" => l(t("Votes"), "admin/comment/moderation/votes"), "%matrix" => l(t("Matrix"),"admin/comment/moderation/matrix"), "%threshold" => l(t("threshold"),"admin/comment/moderation/threshold")));
+ break;
+ case 'admin/comment/moderation/votes':
+ $output = t("Here is where you setup the names of each type of vote. Weight lets you set the order of the drop down menu. Click <b>edit</b> to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To <b>delete</b> a name/weight combiniation go to the <b>edit</b> area.</li></ul>");
+ break;
+ case 'admin/comment/moderation/matrix':
+ $output = t("Here is where you assign a value to each item in the dropdown menu. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the <b>moderate comments</b> permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of <b>lowering</b> a comments over all score.</li></ul>");
+ break;
+ case 'admin/comment/moderation/filters':
+ $output = t("<i>Optional</i> Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already exsisting threashold. To <b>delete</b> a threshold click on \"edit\".");
+ break;
+ case 'admin/comment/moderation/roles':
+ $output = t("Here you can setup the <b>initial</b> vote value of a comment posted by each user role. This value is used before any other users vote on the comment.<br />Note: Blank entries are valued at zero");
+ break;
+ case ' admin/comment/search':
+ $output = t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a comment. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
+ break;
}
- return t($output);
+ return $output;
}
function comment_system($field) {
- $system["description"] = t("Enables user to comment on content (nodes).");
- $system["admin_help"] = t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below the orignal, and slightly indented forming an outline of comments. They also come in two styles: \"expanded\", where you get to see both the title and the contents, and \"collapsed\" where you only see the titles. To set the default threshold you first have to set up thresholds in the <a href=\"%threshold\">comment management &gt;&gt; comment moderation &gt;&gt; thresholds</a> area. Preview comment forces a user to click on a \"Preview\" button so they can see what their comment will look like before they can actually add the comment to the system. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array("%threshold" => url("admin/comment/moderation/filters")));
- return $system[$field];
+ $output = "";
+
+ if ($field == "description") {$output = comment_help("admin/system/modules"); }
+ else if ($field == "admin_help") { $output = comment_help("admin/system/modules/comment"); };
+
+ return $output;
}
function comment_settings() {