[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/usertheme_menu/ -> usertheme_menu.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/usertheme_menu/usertheme_menu.php,v $
  14  |     $Revision: 1.8 $
  15  |     $Date: 2005/12/14 19:28:52 $
  16  |     $Author: sweetas $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  if (!defined('e107_INIT')) { exit; }
  21  
  22  if (USER == TRUE) {
  23       
  24      $handle = opendir(e_THEME);
  25      while ($file = readdir($handle)) {
  26          if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS") {
  27              if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")) {
  28                  $themelist[] = $file;
  29                  $themecount[$file] = 0;
  30              }
  31          }
  32      }
  33      closedir($handle);
  34       
  35       
  36      $defaulttheme = $pref['sitetheme'];
  37      $count = 0;
  38       
  39      $totalct = $sql->db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') ");
  40       
  41      while ($row = $sql->db_Fetch()) {
  42          $up = unserialize($row['user_prefs']);
  43          if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; }
  44      }
  45       
  46      $defaultusers = $sql->db_Count("user") - $totalct;
  47      $themecount[$defaulttheme] += $defaultusers;
  48       
  49      $text = "<form method='post' action='".e_SELF."'>
  50          <div style='text-align:center'>
  51          <select name='sitetheme' class='tbox' style='width: 95%;'>";
  52      $counter = 0;
  53       
  54      while (isset($themelist[$counter]) && $themelist[$counter]) {
  55          $text .= "<option value='".$themelist[$counter]."' ";
  56          if (($themelist[$counter] == USERTHEME) || (USERTHEME == FALSE && $themelist[$counter] == $defaulttheme)) {
  57              $text .= "selected='selected'";
  58          }
  59          $text .= ">".($themelist[$counter] == $defaulttheme ? "[ ".$themelist[$counter]." ]" : $themelist[$counter])." (users: ".$themecount[$themelist[$counter]].")</option>\n";
  60          $counter++;
  61      }
  62      $text .= "</select>
  63          <br /><br />
  64          <input class='button' type='submit' name='settheme' value='".LAN_350."' />
  65          </div></form>";
  66       
  67      $ns->tablerender(LAN_351, $text, 'usertheme');
  68  }
  69  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7