Procházet zdrojové kódy

Added the random theme

Could someone go through and reformat random.php and darkness.php?  I don't
have time before the Christmas release.
Tyler Akins před 23 roky
rodič
revize
962de36f30
1 změnil soubory, kde provedl 28 přidání a 0 odebrání
  1. 28 0
      themes/random.php

+ 28 - 0
themes/random.php

@@ -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);
+
+?>