From b9e3fd0b4f8b35be8457ccd8c4596414eaadd67d Mon Sep 17 00:00:00 2001 From: Moc Date: Mon, 13 May 2013 12:09:55 +0200 Subject: [PATCH] Code cleanup on usertheme_menu. Very outdated. --- e107_plugins/user_menu/usertheme_menu.php | 16 ++--- .../user_menu/usertheme_menu_config.php | 65 +++++++++---------- 2 files changed, 35 insertions(+), 46 deletions(-) diff --git a/e107_plugins/user_menu/usertheme_menu.php b/e107_plugins/user_menu/usertheme_menu.php index e43d9753a..97fc010ea 100644 --- a/e107_plugins/user_menu/usertheme_menu.php +++ b/e107_plugins/user_menu/usertheme_menu.php @@ -2,16 +2,10 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_plugins/user_menu/usertheme_menu.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ if (!defined('e107_INIT')) { exit; } @@ -31,7 +25,7 @@ if ((USER == TRUE) && check_class(varset($pref['allow_theme_select'],FALSE))) { if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS") { - if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css") && ($allThemes || in_Array($file, $themeList))) + if (is_readable(e_THEME.$file."/theme.php") /*&& is_readable(e_THEME.$file."/style.css")*/ && ($allThemes || in_Array($file, $themeList))) { $themelist[] = $file; $themecount[$file] = 0; @@ -45,16 +39,16 @@ if ((USER == TRUE) && check_class(varset($pref['allow_theme_select'],FALSE))) $defaulttheme = $pref['sitetheme']; $count = 0; - $totalct = $sql->db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') "); + $totalct = $sql->select("user", "user_prefs", "user_prefs REGEXP('sitetheme') "); - while ($row = $sql->db_Fetch()) + while ($row = $sql->fetch()) { $up = (substr($row['user_prefs'],0,5) == "array") ? $eArrayStorage->ReadArray($row['user_prefs']) : unserialize($row['user_prefs']); if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; } } - $defaultusers = $sql->db_Count("user") - $totalct; + $defaultusers = $sql->count("user") - $totalct; $themecount[$defaulttheme] += $defaultusers; $text = "
diff --git a/e107_plugins/user_menu/usertheme_menu_config.php b/e107_plugins/user_menu/usertheme_menu_config.php index 5e0f82669..54567a8c4 100644 --- a/e107_plugins/user_menu/usertheme_menu_config.php +++ b/e107_plugins/user_menu/usertheme_menu_config.php @@ -2,16 +2,10 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_plugins/user_menu/usertheme_menu_config.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ $eplug_admin = TRUE; @@ -29,6 +23,8 @@ if (!getperms("2")) // Same permissions as menu configuration } require_once(e_ADMIN."auth.php"); + +$frm = e107::getForm(); // Get the list of available themes $handle = opendir(e_THEME); @@ -36,7 +32,7 @@ while ($file = readdir($handle)) { if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS") { - if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")) + if (is_readable(e_THEME.$file."/theme.php") /*&& is_readable(e_THEME.$file."/style.css")*/) { $themeOptions[] = $file; $themeCount[$file] = 0; @@ -80,41 +76,39 @@ $text = "
".LAN_UMENU_THEME_6." - - - - - +
+ + + - + - "; + "; - foreach ($themeOptions as $th) - { - $ch = (in_array($th, $themeList) ? " checked='checked'" : ''); + foreach ($themeOptions as $th) + { + $ch = (in_array($th, $themeList) ? " checked='checked'" : ''); + $text .= " + + + + "; + } $text .= " - - - - "; - } + + + + "; + $text .= " - - - - "; - - -$text .= " - - - -
".LAN_UMENU_THEME_4."".LAN_UMENU_THEME_4."
{$th}
{$th}
".LAN_UMENU_THEME_7."".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."
".LAN_UMENU_THEME_7."".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."
+ +
+ ".$frm->admin_button('update_theme', LAN_UPDATE, 'update')." +
"; @@ -124,11 +118,12 @@ $ns->tablerender(LAN_UMENU_THEME_6,$mes->render().$text); require_once(e_ADMIN."footer.php"); +/* function headerjs() { return ""; } - +*/ ?> \ No newline at end of file