diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-08-11 14:54:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-08-11 14:54:39 +0000 |
commit | 808b6b6cae71afd741023a0c08a6c925f2198752 (patch) | |
tree | d17e890898959601d841227fecd538f135371bfc /modules/moderate.module | |
parent | 876536a955b783c4f82185dc45557ef3b1bd949f (diff) | |
download | brdo-808b6b6cae71afd741023a0c08a6c925f2198752.tar.gz brdo-808b6b6cae71afd741023a0c08a6c925f2198752.tar.bz2 |
- Changed the authentication and login scheme as discussed on the mailing
list.
- Fixed the export function in book.module (patch my Julian).
- Fixed the comment alignment (comments got truncated).
Diffstat (limited to 'modules/moderate.module')
-rw-r--r-- | modules/moderate.module | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/modules/moderate.module b/modules/moderate.module deleted file mode 100644 index bbb3f9489..000000000 --- a/modules/moderate.module +++ /dev/null @@ -1,121 +0,0 @@ -<?php - -function moderate_perm() { - return array("access moderation pages"); -} - -function moderate_link($type) { - if ($type == "admin") { - $links[] = "<a href=\"admin.php?mod=moderate\">moderate content</a>"; - } - - return $links ? $links : array(); -} - -function moderate_comment_access($cid) { - global $user; - return db_fetch_object(db_query("SELECT n.moderate FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.cid = '". check_input($cid) ."' AND n.moderate LIKE '%$user->userid%'")); -} - -function moderate_overview($query = array()) { - global $user; - - $result = db_query("SELECT n.*, u.userid FROM node n LEFT JOIN users u ON n.author = u.id WHERE n.moderate LIKE '%$user->userid%' ORDER BY n.timestamp DESC LIMIT 15"); - - $output .= status($query[0]); - $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; - $output .= " <TR><TH>node</TH><TH>type</TH><TH>status</TH><TH>author</TH><TH>date</TH><TH>operations</TH></TR>\n"; - - $r1 = db_query("SELECT n.*, u.userid FROM node n LEFT JOIN users u ON n.author = u.id WHERE n.moderate LIKE '%$user->userid%' ORDER BY n.timestamp DESC LIMIT 30"); - while ($node = db_fetch_object($r1)) { - $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD>$node->type</TD><TD>". node_status($node->status) ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD><TD><A HREF=\"admin.php?mod=moderate&type=node&op=edit&id=$node->nid\">edit $node->type</A></TD></TR>\n"; - - $r2 = db_query("SELECT c.*, u.userid FROM comments c LEFT JOIN users u ON c.author = u.id WHERE c.lid = '$node->nid' ORDER BY c.timestamp DESC"); - while ($comment = db_fetch_object($r2)) { - $output .= "<TR><TD COLSPAN=\"3\"> - <A HREF=\"node.php?id=$comment->lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."</A></TD><TD>". format_username($user->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD><TD><A HREF=\"admin.php?mod=moderate&type=comment&op=edit&id=$comment->cid\">edit comment</A></TD></TR>\n"; - } - } - $output .= "</TABLE>\n"; - - return $output; -} - -function moderate_node($edit, $name) { - global $user; - - $node = node_get_array(array("nid" => $edit[nid])); - if ($node && strstr($node[moderate], $user->userid)) { - $edit[type] = $node[type]; - return node_invoke($edit, $name); - } - else { - return status(message_access()); - } -} - -function moderate_node_edit($edit) { - return moderate_node($edit, "form"); -} - -function moderate_node_save($edit) { - return moderate_node($edit, "save"); -} - -function moderate_comment_edit($id) { - if (moderate_comment_access($id)) { - return comment_edit($id); - } - else { - return status(message_access()); - } -} - -function moderate_comment_save($id, $edit) { - if (moderate_comment_access($id)) { - return comment_save($id, $edit); - } - else { - return status(message_access()); - } -} - -function moderate_admin() { - global $op, $id, $edit, $type; - - if (user_access("access moderation pages")) { - - switch ($type) { - case "comment": - switch ($op) { - case "edit": - print moderate_comment_edit($id); - break; - case t("Submit"): - print status(moderate_comment_save($id, $edit)); - // fall through: - default: - print moderate_overview(); - } - break; - default: - switch ($op) { - case "edit": - print moderate_node_edit(node_get_array(array("nid" => $id))); - break; - case t("Preview"): - print moderate_node_edit($edit); - break; - case t("Submit"): - print status(moderate_node_save($edit)); - // fall through: - default: - print moderate_overview(); - } - } - } - else { - print message_access(); - } -} - -?> |