drupal/node.php

74 lines
1.8 KiB
PHP
Raw Normal View History

<?php
// $Id$
include_once "includes/common.inc";
page_header();
function node_render($node) {
global $id, $cid, $op, $moderate, $pid, $edit, $theme, $mode, $order, $threshold, $PHP_SELF;
if (user_access("access content")) {
- import.module: + Improved input filtering; this should make the news items look more consistent in terms of mark-up. + Quoted all array indices: converted all instances of $foo[bar] to $foo["bar"]. Made various other changes to make the import module compliant with the coding style. - theme.inc: + Fixed small XHTML glitch - comment system: + Made it possible for users to edit their comments (when certain criteria are matched). + Renamed the SQL table field "lid" to "nid" and updated the code to reflect this change: this is a rather /annoying/ change that has been asked for a few times. It will impact the contributed BBS/forum modules and requires a tiny SQL update: sql> ALTER TABLE comments CHANGE lid nid int(10) NOT NULL; + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". + Added a delete button to the comment admin form and made it so that Drupal prompts for confirmation prior to deleting a comment from the database. This behavior is similar to that of deleting nodes. + Disabled comment moderation for now. + Some of the above changes will make it easier to integrate the upcomcing mail-to-web and web-to-mail gateways. They are part of a bigger plan. ;) - node system: + Made it so that updating nodes (like for instance updating blog entries) won't trigger the submission rate throttle. + Fixed a small glitch where a node's title wasn't always passed to the $theme->header() function. + Made "node_array()" and "node_object()" more generic and named them "object2array()" and "array2object()". + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". - misc: + Applied three patches by Foxen. One to improve performance of the book module, and two other patches to fix small glitches in common.inc. Thanks Foxen!
2001-12-30 16:16:38 +00:00
$theme->header(check_output($node->title));
node_view($node);
if ($node->comment) {
- import.module: + Improved input filtering; this should make the news items look more consistent in terms of mark-up. + Quoted all array indices: converted all instances of $foo[bar] to $foo["bar"]. Made various other changes to make the import module compliant with the coding style. - theme.inc: + Fixed small XHTML glitch - comment system: + Made it possible for users to edit their comments (when certain criteria are matched). + Renamed the SQL table field "lid" to "nid" and updated the code to reflect this change: this is a rather /annoying/ change that has been asked for a few times. It will impact the contributed BBS/forum modules and requires a tiny SQL update: sql> ALTER TABLE comments CHANGE lid nid int(10) NOT NULL; + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". + Added a delete button to the comment admin form and made it so that Drupal prompts for confirmation prior to deleting a comment from the database. This behavior is similar to that of deleting nodes. + Disabled comment moderation for now. + Some of the above changes will make it easier to integrate the upcomcing mail-to-web and web-to-mail gateways. They are part of a bigger plan. ;) - node system: + Made it so that updating nodes (like for instance updating blog entries) won't trigger the submission rate throttle. + Fixed a small glitch where a node's title wasn't always passed to the $theme->header() function. + Made "node_array()" and "node_object()" more generic and named them "object2array()" and "array2object()". + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". - misc: + Applied three patches by Foxen. One to improve performance of the book module, and two other patches to fix small glitches in common.inc. Thanks Foxen!
2001-12-30 16:16:38 +00:00
comment_render($id, $cid);
}
- import.module: + Improved input filtering; this should make the news items look more consistent in terms of mark-up. + Quoted all array indices: converted all instances of $foo[bar] to $foo["bar"]. Made various other changes to make the import module compliant with the coding style. - theme.inc: + Fixed small XHTML glitch - comment system: + Made it possible for users to edit their comments (when certain criteria are matched). + Renamed the SQL table field "lid" to "nid" and updated the code to reflect this change: this is a rather /annoying/ change that has been asked for a few times. It will impact the contributed BBS/forum modules and requires a tiny SQL update: sql> ALTER TABLE comments CHANGE lid nid int(10) NOT NULL; + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". + Added a delete button to the comment admin form and made it so that Drupal prompts for confirmation prior to deleting a comment from the database. This behavior is similar to that of deleting nodes. + Disabled comment moderation for now. + Some of the above changes will make it easier to integrate the upcomcing mail-to-web and web-to-mail gateways. They are part of a bigger plan. ;) - node system: + Made it so that updating nodes (like for instance updating blog entries) won't trigger the submission rate throttle. + Fixed a small glitch where a node's title wasn't always passed to the $theme->header() function. + Made "node_array()" and "node_object()" more generic and named them "object2array()" and "array2object()". + Moved most (all?) of the comment related logic from node.php to comment.module where it belongs. This also marks a first step towards removing/reducing "node.php". - misc: + Applied three patches by Foxen. One to improve performance of the book module, and two other patches to fix small glitches in common.inc. Thanks Foxen!
2001-12-30 16:16:38 +00:00
$theme->footer();
}
else {
$theme->header();
$theme->box(t("Access denied"), message_access());
$theme->footer();
}
}
function node_failure() {
global $theme;
$theme->header();
$theme->box(t("Not found"), t("The node you are looking for does no longer exist or is not accessible without the proper access rights.") ."\n");
$theme->footer();
}
$number = ($title ? db_num_rows(db_query("SELECT nid FROM node WHERE title = '$title' AND status = 1")) : 1);
if ($number > 1) {
$result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.title = '$title' AND n.status = 1 ORDER BY created DESC");
while ($node = db_fetch_object($result)) {
if (node_access("view", $node)) {
$output .= "<p><b>". l(check_output($node->title), array("id" => $node->nid)) ."</b><br /><small>$node->type - ". format_name($node) ." - ". format_date($node->ccreated, "small") ."</small></p>";
}
}
$theme->header();
$theme->box(t("Result"), $output);
$theme->footer();
}
elseif ($number) {
$node = ($title ? node_load(array("title" => $title, "status" => 1)) : node_load(array("nid" => ($edit["id"] ? $edit["id"] : $id))));
if (node_access("view", $node)) {
if (isset($revision)) {
$node = $node->revisions[$revision]["node"];
}
node_render($node);
}
2001-04-04 21:09:24 +00:00
else {
node_failure();
}
2001-04-04 21:09:24 +00:00
}
else {
node_failure();
}
page_footer();
?>