summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-10-07 18:16:41 +0000
committerDries Buytaert <dries@buytaert.net>2003-10-07 18:16:41 +0000
commit22c889e7c05b1c2dd98ad5e6b3547234a3f6596f (patch)
tree8b63c79053762af3284384a7e8c54a2d3e9b0d45 /modules/comment/comment.module
parentfbc674f14301fd92f97f2506a72c22b7d51c1c43 (diff)
downloadbrdo-22c889e7c05b1c2dd98ad5e6b3547234a3f6596f.tar.gz
brdo-22c889e7c05b1c2dd98ad5e6b3547234a3f6596f.tar.bz2
- Help system improvements: eliminated the _system hook. Patch by Michael.
- Bloggerapi module fixes. Patch by Kjartan. - Coding style fixes. Patch by Michael.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module33
1 files changed, 12 insertions, 21 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index e0f4cce9d..a03f236d9 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -68,9 +68,9 @@ function comment_help($section = "admin/comment/help") {
$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") ));
+ $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':
+ case 'admin/system/modules#description':
$output = t("Enables user to comment on content (nodes).");
break;
case 'admin/system/modules/comment':
@@ -89,7 +89,7 @@ function comment_help($section = "admin/comment/help") {
$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")));
+ $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>");
@@ -110,15 +110,6 @@ function comment_help($section = "admin/comment/help") {
return $output;
}
-function comment_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() {
$output .= form_select(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), _comment_get_modes(), t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together."));
@@ -178,7 +169,7 @@ function comment_access($op, $comment) {
}
function comment_referer_save() {
- $_SESSION["comment_referer"] = arg(0)."/".arg(1)."/".arg(2);
+ $_SESSION["comment_referer"] = arg(0) ."/". arg(1) ."/". arg(2);
}
/*
@@ -439,7 +430,7 @@ function comment_post($edit) {
// We need to get the value at the correct depth:
$parts = explode(".", $max);
- $parent_depth = count(explode(".",$parent->thread));
+ $parent_depth = count(explode(".", $parent->thread));
$last = $parts[$parent_depth];
/*
@@ -457,7 +448,7 @@ function comment_post($edit) {
}
// Finally build the thread field for this new comment:
- $thread = "$parent->thread.".$decimals.$units."/";
+ $thread = "$parent->thread.". $decimals.$units ."/";
}
}
@@ -511,7 +502,7 @@ function comment_links($comment, $return = 1) {
*/
if ($return) {
- $links[] = l(t("parent"), comment_referer_load()."#$comment->cid");
+ $links[] = l(t("parent"), comment_referer_load() ."#$comment->cid");
}
/*
@@ -728,7 +719,7 @@ function comment_render($node, $cid = 0) {
** Start a form, to use with comment control and moderation.
*/
- $result = pager_query($query, $comments_per_page, 0, "SELECT COUNT(*) FROM {comments} WHERE nid = '".check_query($nid)."'");
+ $result = pager_query($query, $comments_per_page, 0, "SELECT COUNT(*) FROM {comments} WHERE nid = '". check_query($nid) ."'");
if ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
@@ -1015,7 +1006,7 @@ function comment_admin_overview($status = 0) {
$result = pager_query($sql, 50);
while ($comment = db_fetch_object($result)) {
- $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small"). "</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
+ $rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = pager_display(NULL, 50, 0, "admin", tablesort_pager())) {
@@ -1033,7 +1024,7 @@ function comment_mod_matrix($edit) {
db_query("DELETE FROM {moderation_roles} ");
foreach ($edit as $role_id => $votes) {
foreach ($votes as $mid => $value) {
- $sql[] = "('$mid', '$role_id', '". ($value ? $value : 0 ) ."')";
+ $sql[] = "('$mid', '$role_id', '". ($value ? $value : 0) ."')";
}
}
db_query("INSERT INTO {moderation_roles} (mid, rid, value) VALUES ". implode(", ", $sql));
@@ -1114,7 +1105,7 @@ function comment_mod_votes($edit) {
$output = status("Vote added");
}
- $output .= "<h3>" . t("Moderation votes overview") . "</h3>";
+ $output .= "<h3>". t("Moderation votes overview") ."</h3>";
$header = array(t("votes"), t("weight"), t("operations"));
$result = db_query("SELECT mid, vote, weight FROM {moderation_votes} ORDER BY weight");
@@ -1382,7 +1373,7 @@ function comment($comment, $links = 0) {
}
function comment_folded($comment) {
- print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load()."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") . " " . format_name($comment) ."</span></div>";
+ print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
}
function comment_flat_collapsed($comment, $threshold) {