diff options
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 33 |
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 » modules » comment"), "admin/system/modules/comment"), "%site-config" => l(t("site configuration"), "admin/system"), "%user-permissions" => l(t("user management » 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 » comment moderation"), "admin/comment/moderation"), "%comment-votes" => l(t("comment management » comment moderation » votes"), "admin/comment/moderation/votes"), "%comment-matrix" => l(t("comment management » comment moderation » matrix"), "admin/comment/moderation/matrix"), "%comment-thresholds" => l(t("comment management » comment moderation » thresholds"), "admin/comment/moderation/thresholds"), "%slashdot" => "<a href=\"http://slashdot.org/\">Slashdot</a>", "%comment-inital" => l(t("comment management » initial comment scores"), "admin/comments/moderation/roles") )); + $output = t($output, array("%comment-config" => l(t("site configuration » modules » comment"), "admin/system/modules/comment"), "%site-config" => l(t("site configuration"), "admin/system"), "%user-permissions" => l(t("user management » 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 » comment moderation"), "admin/comment/moderation"), "%comment-votes" => l(t("comment management » comment moderation » votes"), "admin/comment/moderation/votes"), "%comment-matrix" => l(t("comment management » comment moderation » matrix"), "admin/comment/moderation/matrix"), "%comment-thresholds" => l(t("comment management » comment moderation » thresholds"), "admin/comment/moderation/thresholds"), "%slashdot" => "<a href=\"http://slashdot.org/\">Slashdot</a>", "%comment-inital" => l(t("comment management » 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) { |