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 .= form_group("Legacy filtering", $group2);
return $output;
}
function node_escape_html($text) {
return htmlspecialchars($text);
}
function node_filter_html($text) {
$text = strip_tags($text, variable_get("allowed_html", ""));
if (variable_get("filter_style", 1)) {
$text = preg_replace("/\Wstyle\s*=[^>]+?>/i", ">", $text);
}
$text = preg_replace("/\Won[a-z]+\s*=[^>]+?>/i", ">", $text);
return $text;
}
function node_filter_link($text) {
$pat = '\[{2}([^\|]+)(\|([^\|]+)?)?\]{2}'; // [link|description]
return ereg_replace($pat, $dst, $text);
}
function node_comment_mode($nid) {
static $comment_mode;
if (!isset($comment_mode[$nid])) {
$comment_mode[$nid] = db_result(db_query("SELECT comment FROM {node} WHERE nid = %d", $nid));
}
return $comment_mode[$nid];
}
function node_filter($text) {
if (variable_get("filter_html", 0) == 1) {
$text = node_filter_html($text);
}
if (variable_get("rewrite_old_urls", 0)) {
$text = rewrite_old_urls($text);
}
if (variable_get("filter_html", 0) == 2) {
$text = node_escape_html($text);
}
return trim($text);
}
function node_link($type, $node = 0, $main = 0) {
$links = array();
if ($type == "node") {
if ($node->links) {
$links = $node->links;
}
if ($main == 1 && $node->teaser && strlen($node->teaser) != strlen($node->body)) {
$links[] = l(t("read more"), "node/view/$node->nid", array("title" => t("Read the rest of this posting."), "class" => "read-more"));
}
if (user_access("administer nodes")) {
$links[] = l(t("administer"), "admin/node/edit/$node->nid", array("title" => t("Administer this node.")));
}
if (user_access("administer nodes") && $node->revisions) {
$links[] = l(t("revisions"), "node/revisions/$node->nid", array("title" => t("Administer revisions.")));
}
}
if ($type == "system") {
menu("node/add", t("create content"), 'node_page', 1, MENU_HIDE_NOCHILD);
if (user_access("administer nodes")) {
menu("admin/node", t("content"), "node_admin");
menu("admin/node/search", t("search"), "node_admin", 8);
menu("admin/node/help", t("help"), "node_help_page", 9);
menu("admin/node/edit", t("edit post"), "node_admin", 0, MENU_HIDE);
menu("admin/node/settings", t("settings"), "node_admin", 8);
}
if (user_access("access content")) {
menu("node", t("content"), "node_page", 0, MENU_HIDE);
}
}
return $links;
}
function node_admin_edit($node) {
if (is_numeric($node)) {
$node = node_load(array("nid" => $node));
}
$output .= node_form($node);
/*
** Display the node form extensions:
*/
$output .= implode("\n", module_invoke_all("node_link", $node));
return $output;
}
function node_admin_nodes() {
$filters = array(
array(t("View posts that are new or updated"), "ORDER BY n.changed DESC"),
array(t("View posts that need approval"), "WHERE n.status = 0 OR n.moderate = 1 ORDER BY n.changed DESC"),
array(t("View posts that are promoted"), "WHERE n.status = 1 AND n.promote = 1 ORDER BY n.changed DESC"),
array(t("View posts that are not promoted"), "WHERE n.status = 1 AND n.promote = 0 ORDER BY n.changed DESC"),
array(t("View posts that are static"), "WHERE n.status = 1 AND n.static = 1 ORDER BY n.changed DESC"),
array(t("View posts that are unpublished"), "WHERE n.status = 0 AND n.moderate = 0 ORDER BY n.changed DESC")
);
$operations = array(
array(t("Approve the selected posts"), "UPDATE {node} SET status = 1, moderate = 0 WHERE nid = %d"),
array(t("Promote the selected posts"), "UPDATE {node} SET status = 1, promote = 1 WHERE nid = %d"),
array(t("Make the selected posts static"), "UPDATE {node} SET status = 1, static = 1 WHERE nid = %d"),
array(t("Demote the selected posts"), "UPDATE {node} SET promote = 0 WHERE nid = %d"),
array(t("Unpublish the selected posts"), "UPDATE {node} SET status = 0 WHERE nid = %d")
);
/*
** Handle operations:
*/
if (empty($_SESSION["node_overview_filter"])) {
$_SESSION["node_overview_filter"] = 0;
}
if (isset($_POST["edit"]["filter"])) {
$_SESSION["node_overview_filter"] = $_POST["edit"]["filter"];
}
if (isset($_POST["edit"]["operation"])) {
$operation = $operations[$_POST["edit"]["operation"]][1];
foreach ($_POST["edit"]["status"] as $nid => $value) {
if ($value) {
db_query($operation, $nid);
}
}
drupal_set_message(t("the update has been performed."));
}
$filter = $_SESSION["node_overview_filter"];
/*
** Render filter form:
*/
$options = array();
foreach ($filters as $key => $value) {
$options[] = $value[0];
}
$form = form_select(NULL, "filter", $filter, $options);
$form .= form_submit(t("Go"));
$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.") ."
"; $output .= "