Commit cc4d9fbe authored by Dries's avatar Dries
Browse files

Experimental change:
  - Blog entries get queued in the moderation queue for promotion.
parent e596301b
......@@ -40,13 +40,14 @@ function blog_access($op, $node) {
}
function blog_save($op, $node) {
global $user;
if ($op == "approve") {
return array("promote" => 1);
}
if ($op == "create") {
return array("promote" => 0, "moderate" => 0, "status" => 1);
return array("promote" => 0, "moderate" => 1, "status" => 1);
}
if ($op == "decline") {
......@@ -54,7 +55,22 @@ function blog_save($op, $node) {
}
if ($op == "update") {
return array("promote");
if ($user->uid == $node->uid) {
/*
** Updating your own blog entry will demote it (if promoted),
** and will queue it in the moderation queue for promotion.
*/
return array("promote" => 0, "moderate" => 1, "score" => 0, "votes" => 0, "users" => 0);
}
else {
/*
** When an administrator updates someone else' blog entry, it
** will not be changed unless explicitly specified.
*/
return array();
}
}
}
......
......@@ -40,13 +40,14 @@ function blog_access($op, $node) {
}
function blog_save($op, $node) {
global $user;
if ($op == "approve") {
return array("promote" => 1);
}
if ($op == "create") {
return array("promote" => 0, "moderate" => 0, "status" => 1);
return array("promote" => 0, "moderate" => 1, "status" => 1);
}
if ($op == "decline") {
......@@ -54,7 +55,22 @@ function blog_save($op, $node) {
}
if ($op == "update") {
return array("promote");
if ($user->uid == $node->uid) {
/*
** Updating your own blog entry will demote it (if promoted),
** and will queue it in the moderation queue for promotion.
*/
return array("promote" => 0, "moderate" => 1, "score" => 0, "votes" => 0, "users" => 0);
}
else {
/*
** When an administrator updates someone else' blog entry, it
** will not be changed unless explicitly specified.
*/
return array();
}
}
}
......
......@@ -83,10 +83,14 @@ function queue_overview() {
$output .= " <tr><th>". t("Subject") ."</th><th>". t("Author") ."</th><th>". t("Type") ."</TH><TH>". t("Score") ."</th></tr>";
while ($node = db_fetch_object($result)) {
if ($user->uid == $node->uid || field_get($node->users, $user->uid)) {
$output .= " <tr><td><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</a></td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". check_output($node->type) ."</td><td align=\"center\">". queue_score($node->nid) ."</td></tr>";
$output .= " <tr><td><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</a></td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\">". queue_score($node->nid) ."</td></tr>";
}
else {
$output .= " <tr><td><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</a></td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". check_output($node->type) ."</td><td align=\"center\"><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". t("vote") ."</a></td></tr>";
$output .= " <tr><td><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</a></td><td align=\"center\">". format_name($node) ."</td><td align=\"center\">". module_invoke($node->type, "node", "name") ."</td><td align=\"center\"><a href=\"module.php?mod=queue&op=view&id=$node->nid\">". t("vote") ."</a></td></tr>";
}
if ($node->teaser) {
$output .= " <tr><td colspan=\"4\"><div style=\"margin-left: 40px; margin-bottom: 20px; font-size: 10px;\">$node->teaser</div></td></tr>";
}
}
$output .= "</table>";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment