diff --git a/modules/comment.module b/modules/comment.module index 7d2dde4b9c17..b5b2dbe59f83 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -812,15 +812,14 @@ function comment_admin_overview($status = 0) { } function comment_mod_matrix($edit) { - global $rid; $output .= "
Note: you must assign the moderate comments permission to at least one role in order to use this page.
"; $output .= "In order to use comment moderation, every textbox on this page should be populated with an integer. On this page, you also might wish to value the votes from some users more than others. For example, administrator votes might count twice as much as authenticated users.
"; - if ($rid) { + if ($edit) { db_query("DELETE FROM moderation_roles"); - foreach ($rid as $role_id => $votes) { + foreach ($edit as $role_id => $votes) { foreach ($votes as $mid => $value) { $sql[] = "('$mid', '$role_id', '$value')"; } @@ -839,18 +838,17 @@ function comment_mod_matrix($edit) { $mod_roles[$role->rid][$role->mid] = $role->value; } - $output .= "" . t("votes") . " | ". implode(" | ", array_values($role_names)) ." |
---|---|---|
$vote->vote | "; + $row = array($vote->vote); foreach (array_keys($role_names) as $rid) { - $output .= "mid]\" size=\"4\" value=\"". $mod_roles[$rid][$vote->mid] ."\" /> | "; + $row[] = array("data" => form_textfield(NULL, "$rid][$vote->mid", $mod_roles[$rid][$vote->mid], 4, 3), "align" => "center"); } - $output .= "
Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integr into the initial score column.
"; + $output .= "Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integer into the initial score column.
"; if ($edit) { variable_set("comment_roles", $edit); @@ -869,15 +867,13 @@ function comment_mod_roles($edit) { $result = db_query("SELECT r.rid, r.name FROM role r, permission p WHERE r.rid = p.rid AND p.perm LIKE '%post comments%'"); - $output .= "" . t("user role") . " | " . t("initial score") . " |
---|---|
$role->name | "; - $output .= "rid]\" size=\"4\" value=\"". $start_values[$role->rid] ."\" /> |
" . t("votes") . " | " . t("weight") . " | " . t("operations") . " |
---|---|---|
$vote->vote | $vote->weight | ". l(t("edit"), "admin/comment/votes/$vote->mid") ." |
Optional. If your site gets lots of comments, you may offer your users thresholds, which are used to hide all comments whose moderation score is lower than the threshold. This cuts down on clutter while your readers view the site. These thresholds appear in the Comment Control Panel.
"; - $output .= "" . t("name") . " | " . t("minimum score") . " | " . t("operations") . " |
---|---|---|
$filter->filter | $filter->minimum | ". l(t("edit"), "admin/comment/filters/$filter->fid") ." |
Note: you must assign the moderate comments permission to at least one role in order to use this page.
"; $output .= "In order to use comment moderation, every textbox on this page should be populated with an integer. On this page, you also might wish to value the votes from some users more than others. For example, administrator votes might count twice as much as authenticated users.
"; - if ($rid) { + if ($edit) { db_query("DELETE FROM moderation_roles"); - foreach ($rid as $role_id => $votes) { + foreach ($edit as $role_id => $votes) { foreach ($votes as $mid => $value) { $sql[] = "('$mid', '$role_id', '$value')"; } @@ -839,18 +838,17 @@ function comment_mod_matrix($edit) { $mod_roles[$role->rid][$role->mid] = $role->value; } - $output .= "" . t("votes") . " | ". implode(" | ", array_values($role_names)) ." |
---|---|---|
$vote->vote | "; + $row = array($vote->vote); foreach (array_keys($role_names) as $rid) { - $output .= "mid]\" size=\"4\" value=\"". $mod_roles[$rid][$vote->mid] ."\" /> | "; + $row[] = array("data" => form_textfield(NULL, "$rid][$vote->mid", $mod_roles[$rid][$vote->mid], 4, 3), "align" => "center"); } - $output .= "
Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integr into the initial score column.
"; + $output .= "Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integer into the initial score column.
"; if ($edit) { variable_set("comment_roles", $edit); @@ -869,15 +867,13 @@ function comment_mod_roles($edit) { $result = db_query("SELECT r.rid, r.name FROM role r, permission p WHERE r.rid = p.rid AND p.perm LIKE '%post comments%'"); - $output .= "" . t("user role") . " | " . t("initial score") . " |
---|---|
$role->name | "; - $output .= "rid]\" size=\"4\" value=\"". $start_values[$role->rid] ."\" /> |
" . t("votes") . " | " . t("weight") . " | " . t("operations") . " |
---|---|---|
$vote->vote | $vote->weight | ". l(t("edit"), "admin/comment/votes/$vote->mid") ." |
Optional. If your site gets lots of comments, you may offer your users thresholds, which are used to hide all comments whose moderation score is lower than the threshold. This cuts down on clutter while your readers view the site. These thresholds appear in the Comment Control Panel.
"; - $output .= "" . t("name") . " | " . t("minimum score") . " | " . t("operations") . " |
---|---|---|
$filter->filter | $filter->minimum | ". l(t("edit"), "admin/comment/filters/$filter->fid") ." |