| 1 | <?php |
| 2 | |
| 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 | * |
| 10 | * Copyright (c) 2000-2002 The SquirrelMail Project Team |
| 11 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
| 12 | * |
| 13 | * $Id$ |
| 14 | */ |
| 15 | |
| 16 | sq_mt_randomize(); |
| 17 | |
| 18 | global $theme, $random_theme_good_themes; |
| 19 | |
| 20 | if (!session_is_registered('random_theme_good_theme')) { |
| 21 | $good_themes = array(); |
| 22 | foreach ($theme as $data) { |
| 23 | if (substr($data['PATH'], -18) != '/themes/random.php') { |
| 24 | $good_themes[] = $data['PATH']; |
| 25 | } |
| 26 | } |
| 27 | if (count($good_themes) == 0) |
| 28 | $good_themes[] = '../themes/default.php'; |
| 29 | $which = mt_rand(0, count($good_themes)); |
| 30 | $random_theme_good_theme = $good_themes[$which]; |
| 31 | session_register('random_theme_good_theme'); |
| 32 | } |
| 33 | |
| 34 | @include_once ($random_theme_good_theme); |
| 35 | |
| 36 | ?> |