Fix: Messages shown with bad times in message list due to misinterpreted UW IMAP...
[squirrelmail.git] / themes / random.php
... / ...
CommitLineData
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-2004 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 */
18sq_mt_randomize();
19
20require_once(SM_PATH . 'functions/global.php');
21
22global $theme;
23
24if (!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} else {
38 // get random theme stored in session
39 sqgetGlobalVar('random_theme_good_theme',$random_theme_good_theme);
40}
41
42@include_once ($random_theme_good_theme);
43
44?>