diff options
-rw-r--r-- | account.php | 6 | ||||
-rw-r--r-- | admin.inc | 1 | ||||
-rw-r--r-- | admin.php | 6 | ||||
-rw-r--r-- | diary.php | 4 | ||||
-rw-r--r-- | discussion.php | 2 | ||||
-rw-r--r-- | faq.php | 1 | ||||
-rw-r--r-- | function.inc | 14 | ||||
-rw-r--r-- | index.php | 1 | ||||
-rw-r--r-- | search.php | 1 | ||||
-rw-r--r-- | submission.php | 1 | ||||
-rw-r--r-- | submit.php | 1 | ||||
-rw-r--r-- | theme.inc | 10 |
12 files changed, 26 insertions, 22 deletions
diff --git a/account.php b/account.php index 2de4c412a..c6fbd0f27 100644 --- a/account.php +++ b/account.php @@ -1,7 +1,5 @@ <? -include "function.inc"; -include "config.inc"; include "theme.inc"; function account_getUser($uname) { @@ -87,7 +85,7 @@ function showUser($uname) { } } -function newUser($user = "", $error="") { +function newUser($user = "", $error = "") { global $theme; $output .= "<FORM ACTION=\"account.php\" METHOD=post>\n"; @@ -328,6 +326,8 @@ switch ($op) { $data[signature] = $edit[signature]; dbsave("users", $data, $user->id); user_rehash(); + + header("account.php"); } showUser($user->userid); break; @@ -24,6 +24,7 @@ function admin_header() { <LI><A HREF="admin.php?section=bans">bans</A></LI> <LI><A HREF="admin.php?section=logs">logs</A></LI> <LI><A HREF="admin.php?section=stories">stories</A></LI> + <LI><A HREF="admin.php?section=info">info</A></LI> <P> <LI><A HREF="">home</A></LI> </TD> @@ -375,6 +375,10 @@ function story_display($order = "date") { print $output; } +function info_display() { + phpinfo(); +} + include "function.inc"; include "admin.inc"; @@ -440,6 +444,8 @@ switch ($section) { story_display(); } break; + case "info": + info_display(); default: print "Welcome to the adminstration page!"; } @@ -1,8 +1,6 @@ <? -include "function.inc"; -include "config.inc"; -include "theme.inc"; +include "theme.inc"; function diary_overview($num = 20) { global $theme, $user; diff --git a/discussion.php b/discussion.php index 8a2cbd5ce..f94a7ac2c 100644 --- a/discussion.php +++ b/discussion.php @@ -302,8 +302,6 @@ function comment_post($pid, $sid, $subject, $comment) { } } -include "function.inc"; -include "config.inc"; include "theme.inc"; switch($op) { @@ -1,5 +1,4 @@ <? -include "function.inc"; include "theme.inc"; $output = " diff --git a/function.inc b/function.inc index 2c69e4fb9..a3fb0111a 100644 --- a/function.inc +++ b/function.inc @@ -1,6 +1,5 @@ <? -include "config.inc"; include "database.inc"; include "log.inc"; @@ -21,6 +20,19 @@ function dbsave($dbase, $data, $id=0) { else { db_query("INSERT INTO $dbase SET $query") or die(mysql_error()); return mysql_insert_id(); } } +function load_theme() { + global $user, $themes; + + if ($user->theme && file_exists($themes[$user->theme][0])) { + include $themes[$user->theme][0]; + } + else { + include $themes[key($themes)][0]; + } + + return new Theme(); +} + function check_input($message) { return str_replace("\"", """, stripslashes($message)); } @@ -1,6 +1,5 @@ <? -include "function.inc"; include "theme.inc"; ### Initialize/pre-process variables: diff --git a/search.php b/search.php index fb616cab0..004848beb 100644 --- a/search.php +++ b/search.php @@ -1,6 +1,5 @@ <? - include "function.inc"; include "theme.inc"; $theme->header(); diff --git a/submission.php b/submission.php index ad61af422..35db5290d 100644 --- a/submission.php +++ b/submission.php @@ -1,6 +1,5 @@ <? include "submission.inc"; -include "function.inc"; include "theme.inc"; function submission_displayMain() { diff --git a/submit.php b/submit.php index b921c6a3f..052dd90f5 100644 --- a/submit.php +++ b/submit.php @@ -146,7 +146,6 @@ function submit_submit($subject, $abstract, $article, $category) { watchdog(1, "added new submission with subject `$subject'."); } -include "function.inc"; include "theme.inc"; switch($op) { @@ -1,17 +1,11 @@ <? include "config.inc"; +include "function.inc"; include "template.inc"; global $user; -if ($user->theme && file_exists($themes[$user->theme][0])) { - include $themes[$user->theme][0]; -} -else { - include $themes[key($themes)][0]; -} - -$theme = new Theme(); +$theme = load_theme(); ?>
\ No newline at end of file |