diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-05-27 10:45:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-05-27 10:45:14 +0000 |
commit | 377849c8c43c3aa8c06596e4396b9bf1a65a6a08 (patch) | |
tree | 05327d7fd1d02012e7e66ece45f933d10fab2dec | |
parent | 9286bfc10e9438b2513097601b7dbdaca3d4e8cd (diff) | |
download | brdo-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.inc | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |