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