summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-05-27 10:45:14 +0000
committerDries Buytaert <dries@buytaert.net>2000-05-27 10:45:14 +0000
commit377849c8c43c3aa8c06596e4396b9bf1a65a6a08 (patch)
tree05327d7fd1d02012e7e66ece45f933d10fab2dec
parent9286bfc10e9438b2513097601b7dbdaca3d4e8cd (diff)
downloadbrdo-377849c8c43c3aa8c06596e4396b9bf1a65a6a08.tar.gz
brdo-377849c8c43c3aa8c06596e4396b9bf1a65a6a08.tar.bz2
* Adjusted themes.inc to make it bullet-proof. The theme problem hasn't
been fixed yet though, but at least it won't try to load non-existing themes. That is, you might not be able to select your prefered theme, but you should be able to surf the pages with the default theme no matter what. Hence, it semi-fixes the theme problem reported earlier by UnConeD. Natrak: make sure the new user system won't suffer the same problem. Use file_exists(string filename) to check whether the theme does actually exist. If not, load the default theme.
-rw-r--r--theme.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/theme.inc b/theme.inc
index bd809146d..a20e4d4bb 100644
--- a/theme.inc
+++ b/theme.inc
@@ -1,7 +1,17 @@
<?
global $user;
+
+ ### Decode user cookie:
if (isset($user)) $cookie = explode(":", base64_decode($user));
- if (isset($cookie[9])) include "themes/$cookie[9]/theme.class";
+
+ ### Verify theme:
+ if (isset($cookie[9])) {
+ if (file_exists("themes/$cookie[9]/theme.class")) {
+ include "themes/$cookie[9]/theme.class";
+ }
+ else include "themes/default/theme.class";
+ }
else include "themes/default/theme.class";
+
$theme = new Theme();
?> \ No newline at end of file