summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--account.php6
-rw-r--r--admin.inc1
-rw-r--r--admin.php6
-rw-r--r--diary.php4
-rw-r--r--discussion.php2
-rw-r--r--faq.php1
-rw-r--r--function.inc14
-rw-r--r--index.php1
-rw-r--r--search.php1
-rw-r--r--submission.php1
-rw-r--r--submit.php1
-rw-r--r--theme.inc10
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;
diff --git a/admin.inc b/admin.inc
index e81bd21e1..2fafaf668 100644
--- a/admin.inc
+++ b/admin.inc
@@ -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>
diff --git a/admin.php b/admin.php
index 8de5a5c84..f69dc2c6e 100644
--- a/admin.php
+++ b/admin.php
@@ -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!";
}
diff --git a/diary.php b/diary.php
index 767a3e1a9..2ca2f320f 100644
--- a/diary.php
+++ b/diary.php
@@ -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) {
diff --git a/faq.php b/faq.php
index 1cf4aa3ec..c53ffb8cc 100644
--- a/faq.php
+++ b/faq.php
@@ -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("\"", "&quot;", stripslashes($message));
}
diff --git a/index.php b/index.php
index ec5dd58c1..9f6167d6a 100644
--- a/index.php
+++ b/index.php
@@ -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) {
diff --git a/theme.inc b/theme.inc
index eedf5e2bb..9d0b5a0a6 100644
--- a/theme.inc
+++ b/theme.inc
@@ -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