Source for file random.php

Documentation is available at random.php

  1. <?php
  2.  
  3. /**
  4.  * Name:    Random Theme Every Login
  5.  * Date:    December 24, 2001
  6.  * Comment: Guess what this does!
  7.  *
  8.  * @author Tyler Akins
  9.  * @copyright 2000-2020 The SquirrelMail Project Team
  10.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  11.  * @version $Id: random.php 14840 2020-01-07 07:42:38Z pdontthink $
  12.  * @package squirrelmail
  13.  * @subpackage themes
  14.  */
  15.  
  16. /** Initialize the random number generator */
  17.  
  18. require_once(SM_PATH 'functions/global.php');
  19.  
  20. global $theme;
  21.  
  22. if (!sqsession_is_registered('random_theme_good_theme')) {
  23.     $good_themes array();
  24.     foreach ($theme as $data{
  25.         if (substr($data['PATH']-18!= '/themes/random.php'{
  26.             $good_themes[$data['PATH'];
  27.         }
  28.     }
  29.     if (count($good_themes== 0{
  30.         $good_themes['../themes/default.php';
  31.     }
  32.     $which mt_rand(0count($good_themes));
  33.     $random_theme_good_theme $good_themes[$which];
  34.     // remove current sm_path from theme name
  35.     $path=preg_quote(SM_PATH,'/');
  36.     $random_theme_good_theme=preg_replace("/^$path/",'',$random_theme_good_theme);
  37.     // store it in session
  38.     sqsession_register($random_theme_good_theme'random_theme_good_theme');
  39. else {
  40.     // get random theme stored in session
  41.     sqgetGlobalVar('random_theme_good_theme',$random_theme_good_theme);
  42. }
  43.  
  44. @include_once (SM_PATH $random_theme_good_theme);

Documentation generated on Mon, 13 Jan 2020 04:25:11 +0100 by phpDocumentor 1.4.3