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