diff --git a/index.php b/index.php index 46f9b36632d3ecb76d571103b569f5e8d9281ebc..6eb0eb02f05c9c4fcc176adca2d7f01724b2d836 100644 --- a/index.php +++ b/index.php @@ -5,19 +5,12 @@ page_header(); -$theme->header(); - -if (user_access("access content")) { - $result = db_query("SELECT nid, type FROM node WHERE ". ($meta ? "attributes LIKE '%". check_input($meta) ."%' AND " : "") ." promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10))); - while ($node = db_fetch_object($result)) { - node_view(node_get_object(array("nid" => $node->nid, "type" => $node->type)), 1); - } -} -else { - $theme->box(t("Access denied"), message_access()); -} - -$theme->footer(); +//$theme->header(); + +$function = variable_get("site_frontpage", "node") ."_page"; +$function(); + +//$theme->footer(); page_footer(); diff --git a/modules/node.module b/modules/node.module index c00522a8f04b2b0358924aa67befa3d6bf2487f2..55fc07fc6d7a7ea108b33758b26afca1fb547b92 100644 --- a/modules/node.module +++ b/modules/node.module @@ -421,11 +421,24 @@ function node_feed() { } function node_page() { - global $op; + global $op, $theme; if ($op == "feed") { node_feed(); } + else { + $theme->header(); + if (user_access("access content")) { + $result = db_query("SELECT nid, type FROM node WHERE ". ($meta ? "attributes LIKE '%". check_input($meta) ."%' AND " : "") ." promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10))); + while ($node = db_fetch_object($result)) { + node_view(node_get_object(array("nid" => $node->nid, "type" => $node->type)), 1); + } + } + else { + $theme->box(t("Access denied"), message_access()); + } + $theme->footer(); + } } ?> diff --git a/modules/node/node.module b/modules/node/node.module index c00522a8f04b2b0358924aa67befa3d6bf2487f2..55fc07fc6d7a7ea108b33758b26afca1fb547b92 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -421,11 +421,24 @@ function node_feed() { } function node_page() { - global $op; + global $op, $theme; if ($op == "feed") { node_feed(); } + else { + $theme->header(); + if (user_access("access content")) { + $result = db_query("SELECT nid, type FROM node WHERE ". ($meta ? "attributes LIKE '%". check_input($meta) ."%' AND " : "") ." promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10))); + while ($node = db_fetch_object($result)) { + node_view(node_get_object(array("nid" => $node->nid, "type" => $node->type)), 1); + } + } + else { + $theme->box(t("Access denied"), message_access()); + } + $theme->footer(); + } } ?> diff --git a/modules/system.module b/modules/system.module index 31e676416f2eda48342ffdc5c38dc6e30c9b643a..3cd3b7eaf967905488ad84a2e3ff1e0a44d50b73 100644 --- a/modules/system.module +++ b/modules/system.module @@ -35,6 +35,8 @@ function system_view_options() { $output .= form_textarea("Footer message", "site_footer", variable_get("site_footer", ""), 55, 3, "This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages."); $output .= form_textfield("Anonymous user", "anonymous", variable_get("anonymous", "Anonymous"), 30, 55, "The name used to indicate anonymous users."); $output .= form_textfield("Password words", "account_words", variable_get("account_words", "foo,bar,guy,neo,tux,moo,sun,asm,dot,god,axe,geek,nerd,fish,hack,star,mice,warp,moon,hero,cola,girl,fish,java,perl,boss,dark,sith,jedi,drop,mojo"), 55, 256, "Words used in the creation of passwords. Comma seperated list."); + foreach (module_list() as $name) { if (module_hook($name, "page")) $pages[$name] = $name; } + $output .= form_select("Default front page", "site_frontpage", variable_get("site_frontpage", "node"), $pages, "The default front page."); $output .= "<hr />\n"; // caching: diff --git a/modules/system/system.module b/modules/system/system.module index 31e676416f2eda48342ffdc5c38dc6e30c9b643a..3cd3b7eaf967905488ad84a2e3ff1e0a44d50b73 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -35,6 +35,8 @@ function system_view_options() { $output .= form_textarea("Footer message", "site_footer", variable_get("site_footer", ""), 55, 3, "This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages."); $output .= form_textfield("Anonymous user", "anonymous", variable_get("anonymous", "Anonymous"), 30, 55, "The name used to indicate anonymous users."); $output .= form_textfield("Password words", "account_words", variable_get("account_words", "foo,bar,guy,neo,tux,moo,sun,asm,dot,god,axe,geek,nerd,fish,hack,star,mice,warp,moon,hero,cola,girl,fish,java,perl,boss,dark,sith,jedi,drop,mojo"), 55, 256, "Words used in the creation of passwords. Comma seperated list."); + foreach (module_list() as $name) { if (module_hook($name, "page")) $pages[$name] = $name; } + $output .= form_select("Default front page", "site_frontpage", variable_get("site_frontpage", "node"), $pages, "The default front page."); $output .= "<hr />\n"; // caching: