Nodes"; $output .= "
The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes."; $output .= "A base node contains:
Now that you know what is in a node, here are some of the types of nodes available.
"; $output = t($output, array("%teaser" => l(t("click here"), "admin/system/modules/node"))); if ($mod == "admin") { foreach (module_list() as $name) { if (module_hook($name, "node") && $name != "node") { $output .= "mod_rewrite
is available on your system, use the rewrite rules in Drupal's .htaccess
file instead as these will also correct external referrers."));
$output .= "$help
"; } $output .= "". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '<!--break-->' (without the quotes) to fine-tune where your post gets split.") ."
"; print "". theme("links", $links) ."
"; return $output; } function node_delete($edit) { $node = node_load(array("nid" => $edit["nid"])); if (node_access("delete", $node)) { if ($edit["confirm"]) { /* ** Delete the specified node: */ db_query("DELETE FROM {node} WHERE nid = '$node->nid'"); /* ** Call the node specific callback (if any): */ node_invoke($node, "delete"); node_invoke_nodeapi($node, "delete"); /* ** Clear the cache so an anonymous poster can see the node being ** deleted. */ cache_clear_all(); watchdog("special", "$node->type: deleted '$node->title'"); $output = t("The node has been deleted."); } else { $output .= form_item(t("Confirm deletion"), $node->title); $output .= form_hidden("nid", $node->nid); $output .= form_hidden("confirm", 1); $output .= form_submit(t("Delete")); $output = form($output); } } return $output; } function node_page() { global $id, $user, $or, $and; $op = $_POST["op"]; $edit = $_POST["edit"]; if (user_access("access content")) { if (empty($op)) { $op = arg(1); } if ($op == "feed") { node_feed(); return; } if ($op == "view") { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } $name = module_invoke(arg(2), "node", "name"); switch ($op) { case "add": drupal_set_title(t("Submit %name", array("%name" => $name))); print theme("header"); print node_add(arg(2)); print theme("footer"); break; case "edit": drupal_set_title(t("Edit %name", array("%name" => $name))); print theme("header"); print node_edit(arg(2)); print theme("footer"); break; case "view": drupal_set_title($node->title); print theme("header"); print node_show($node, arg(3)); print theme("footer"); break; case "revisions": drupal_set_title(t("Revisions")); print theme("header"); print node_revision_overview(arg(2)); print theme("footer"); break; case "rollback-revision": $output = node_revision_rollback(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); drupal_set_title(t("Revisions")); print theme("header"); print $output; print theme("footer"); break; case "delete-revision": $output = node_revision_delete(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); drupal_set_title(t("Revisions")); print theme("header"); print $output; print theme("footer"); break; case t("Preview"): $edit = node_validate($edit, $error); drupal_set_title(t("Preview %name", array("%name" => $name))); print theme("header"); print node_preview($edit, $error); print theme("footer"); break; case t("Submit"): drupal_set_title(t("Submit %name", array("%name" => $name))); print theme("header"); print node_submit($edit); print theme("footer"); break; case t("Delete"): drupal_set_title(t("Delete %name", array("%name" => $name))); print theme("header"); print node_delete($edit); print theme("footer"); break; default: drupal_set_title(""); print theme("header"); $result = pager_query("SELECT nid, type FROM {node} WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10)); while ($node = db_fetch_object($result)) { node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); print theme("footer"); } } else { drupal_set_title(t("Access denied")); print theme("header"); print message_access(); print theme("footer"); } } function node_update_index() { // Return an array of values to dictate how to update the search index // for this particular type of node. // // "last_update"'s value is used with variable_set to set the // last time this node type had an index update run. // // "node_type"'s value is used to identify the node type in the search // index. // // "select"'s value is used to select the node id and text fields from // the table we are indexing. In this case, we also check against the // last run date for the nodes update. return array("last_update" => "node_cron_last", "node_type" => "node", "select" => "SELECT n.nid as lno, n.title as text1, n.body as text2 FROM {node} n WHERE n.status = 1 AND moderate = 0 and (created > " . variable_get("node_cron_last", 1) . " or changed > " . variable_get("node_cron_last", 1) . ")"); } function node_nodeapi(&$node, $op, $arg = 0) { switch ($op) { case "settings": $output[t("publish")] = form_checkbox("", "node_status_$node->type", 1, variable_get("node_status_$node->type", 1)); $output[t("promote")] = form_checkbox("", "node_promote_$node->type", 1, variable_get("node_promote_$node->type", 1)); $output[t("moderate")] = form_checkbox("", "node_moderate_$node->type", 1, variable_get("node_moderate_$node->type", 0)); $output[t("static")] = form_checkbox("", "node_static_$node->type", 1, variable_get("node_static_$node->type", 0)); $output[t("revision")] = form_checkbox("", "node_revision_$node->type", 1, variable_get("node_revision_$node->type", 0)); return $output; case "fields": return array("nid", "uid", "type", "title", "teaser", "body", "revisions", "status", "promote", "moderate", "static", "created", "changed"); } } ?>