fc632e34 |
1 | <?php |
fc632e34 |
2 | |
d4f79d96 |
3 | /** |
4 | * random.php |
5 | * Name: Random Theme Every Login |
6 | * Author: Tyler Akins |
7 | * Date: December 24, 2001 |
8 | * Comment: Guess what this does! |
9 | * |
76911253 |
10 | * Copyright (c) 2000-2003 The SquirrelMail Project Team |
d4f79d96 |
11 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
12 | * |
13 | * $Id$ |
14 | */ |
fc632e34 |
15 | |
d4f79d96 |
16 | sq_mt_randomize(); |
0b97a708 |
17 | |
18 | require_once(SM_PATH . 'functions/global.php'); |
fc632e34 |
19 | |
d4f79d96 |
20 | global $theme, $random_theme_good_themes; |
fc632e34 |
21 | |
d7c82551 |
22 | if (!sqsession_is_registered('random_theme_good_theme')) { |
d4f79d96 |
23 | $good_themes = array(); |
24 | foreach ($theme as $data) { |
25 | if (substr($data['PATH'], -18) != '/themes/random.php') { |
fc632e34 |
26 | $good_themes[] = $data['PATH']; |
d4f79d96 |
27 | } |
28 | } |
8905fa13 |
29 | if (count($good_themes) == 0) { |
30 | $good_themes[] = '../themes/default.php'; |
31 | } |
d4f79d96 |
32 | $which = mt_rand(0, count($good_themes)); |
33 | $random_theme_good_theme = $good_themes[$which]; |
0b97a708 |
34 | sqsession_register($random_theme_good_theme, 'random_theme_good_theme'); |
d4f79d96 |
35 | } |
fc632e34 |
36 | |
d4f79d96 |
37 | @include_once ($random_theme_good_theme); |
fc632e34 |
38 | |
39 | ?> |