summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-16 18:21:22 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-16 18:21:22 +0000
commitb1c66cb5de4b37a5292c6901628b5b0697e8a459 (patch)
treea579df0abc46247f5261453a3e9c642c72137dda /modules/node.module
parent2f898ebcff1d5a1125fa46aa85f0e2def1c650f4 (diff)
downloadbrdo-b1c66cb5de4b37a5292c6901628b5b0697e8a459.tar.gz
brdo-b1c66cb5de4b37a5292c6901628b5b0697e8a459.tar.bz2
Another big update so please read this carefully because there is important information hidden in it.
Made it so that we can disable/enable comments on a category by category basis. In order to accomplish this I had to make a few (*temporary*) changes. I moved all comment code from the "module level" (eg. story.module) to the "node level". It was nothing but the logical next step in nodifying drupal. This enables us to add comments to all existing content types including book entries. But also for book entries, this to can be toggled on and off. :-) Moreover module writers don't have to worry about the complex comment logic: it is "abstracted" away. This implies that story.module got smaller, faster and easier to comprehend. :-) In order to accomplish this, I had to update ALL THEMES, which I did - and on my way I updated Goofy, Oranzh and UnConeD - with the previous changes. All themes are up-to-date now! I also had to remove the [ reply to this story ] links, and temporally re-introcuded the "Add comment" button in the "Comment control". Tempora lly that is, UnConeD. ;) I plan to upgrade drop.org either tommorow or wednesday so test away if you have some time to kill. ;) Oh, I also fixed a few bugs and made various small improvements.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node.module b/modules/node.module
index 4c12ba5a7..7d0a5b3a5 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -5,13 +5,13 @@ $module = array("admin" => "node_admin");
function node_overview($query = array()) {
global $user, $rstatus;
- $result = db_query("SELECT n.*, u.userid FROM node n LEFT JOIN users u ON n.author = u.id $query[1] LIMIT 50");
+ $result = db_query("SELECT n.*, u.userid, c.name AS category FROM node n LEFT JOIN users u ON n.author = u.id LEFT JOIN category c ON n.cid = c.cid $query[1] LIMIT 50");
$output .= status($query[0]);
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
- $output .= " <TR><TH>title</TH><TH>type</TH><TH>status</TH><TH>author</TH><TH>date</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
+ $output .= " <TR><TH>title</TH><TH>category</TH><TH>status</TH><TH>author</TH><TH>date</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
while ($node = db_fetch_object($result)) {
- $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">$node->type</TD><TD>". $rstatus[$node->status] ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD><TD>". (user_access($user, "node") ? "<A HREF=\"admin.php?mod=node&op=view&id=$node->nid\">view node</A></TD>" : "view node") ."</TD><TD>". (user_access($user, "node") ? "<A HREF=\"admin.php?mod=node&op=edit&id=$node->nid\">edit node</A></TD>" : "edit node") ."</TD><TD>". (user_access($user, $node->type) ? "<A HREF=\"admin.php?mod=$node->type&op=edit&id=$node->nid\">edit $node->type</A></TD>" : "edit $node->type") ."</TD></TR>\n";
+ $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">". check_output($node->category ? $node->category : $node->type) ."</TD><TD>". $rstatus[$node->status] ."</TD><TD>". format_username($node->userid) ."</TD><TD>". format_date($node->timestamp, "small") ."</TD><TD>". (user_access($user, "node") ? "<A HREF=\"admin.php?mod=node&op=view&id=$node->nid\">view node</A></TD>" : "view node") ."</TD><TD>". (user_access($user, "node") ? "<A HREF=\"admin.php?mod=node&op=edit&id=$node->nid\">edit node</A></TD>" : "edit node") ."</TD><TD>". (user_access($user, $node->type) ? "<A HREF=\"admin.php?mod=$node->type&op=edit&id=$node->nid\">edit $node->type</A></TD>" : "edit $node->type") ."</TD></TR>\n";
}
$output .= "</TABLE>\n";