random.php 898 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * random.php
  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-2002 The SquirrelMail Project Team
  10. * Licensed under the GNU GPL. For full terms see the file COPYING.
  11. *
  12. * $Id$
  13. */
  14. sq_mt_randomize();
  15. global $theme, $random_theme_good_themes;
  16. if (!session_is_registered('random_theme_good_theme')) {
  17. $good_themes = array();
  18. foreach ($theme as $data) {
  19. if (substr($data['PATH'], -18) != '/themes/random.php') {
  20. $good_themes[] = $data['PATH'];
  21. }
  22. }
  23. if (count($good_themes) == 0)
  24. $good_themes[] = '../themes/default.php';
  25. $which = mt_rand(0, count($good_themes));
  26. $random_theme_good_theme = $good_themes[$which];
  27. session_register('random_theme_good_theme');
  28. }
  29. @include_once ($random_theme_good_theme);
  30. ?>