Added the random theme
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Dec 2001 15:47:20 +0000 (15:47 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Dec 2001 15:47:20 +0000 (15:47 +0000)
Could someone go through and reformat random.php and darkness.php?  I don't
have time before the Christmas release.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1916 7612ce4b-ef26-0410-bec9-ea0150e637f0

themes/random.php [new file with mode: 0755]

diff --git a/themes/random.php b/themes/random.php
new file mode 100755 (executable)
index 0000000..6a85200
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+   /** Author:       Tyler Akins
+       Theme Name:   Random Theme Every Login
+
+       Guess what this does!
+       
+   **/
+
+   sq_mt_randomize();
+   
+   global $theme, $random_theme_good_themes;
+   
+   if (! session_is_registered('random_theme_good_theme')) {
+      $good_themes = array();
+      foreach ($theme as $data) {
+         if (substr($data['PATH'], -18) != '/themes/random.php')
+            $good_themes[] = $data['PATH'];
+      }
+      if (count($good_themes) == 0)
+         $good_themes[] = "../themes/default.php";
+      $which = mt_rand(0, count($good_themes));
+      $random_theme_good_theme = $good_themes[$which];
+      session_register('random_theme_good_theme');
+   }
+   
+   @include_once ($random_theme_good_theme);
+
+?>