timeZoneArray List of time zones in array format. * @return array $this->monthArray List of months in array format. */ $tz = array(); $tz["GMT"] = "000"; $tz["UTC"] = "000"; $tz["ECT"] = "+100"; $tz["EET"] = "+200"; $tz["ART"] = "+200"; $tz["EAT"] = "+300"; $tz["MET"] = "+330"; $tz["NET"] = "+400"; $tz["PLT"] = "+500"; $tz["IST"] = "+530"; $tz["BST"] = "+600"; $tz["VST"] = "+700"; $tz["CTT"] = "+800"; $tz["JST"] = "+900"; $tz["ACT"] = "+930"; $tz["AET"] = "+1000"; $tz["SST"] = "+1100"; $tz["NST"] = "+1200"; $tz["MIT"] = "-1100"; $tz["HST"] = "-1000"; $tz["AST"] = "-900"; $tz["PST"] = "-800"; $tz["PNT"] = "-700"; $tz["MST"] = "-700"; $tz["CST"] = "-600"; $tz["EST"] = "-500"; $tz["IET"] = "-500"; $tz["PRT"] = "-400"; $tz["CNT"] = "-330"; $tz["AGT"] = "-300"; $tz["BET"] = "-300"; $tz["CAT"] = "-100"; $this->timeZoneArray = $tz; $months = array(); $months["1"] = "Jan"; $months["2"] = "Feb"; $months["3"] = "Mar"; $months["4"] = "Apr"; $months["5"] = "May"; $months["6"] = "Jun"; $months["7"] = "Jul"; $months["8"] = "Aug"; $months["9"] = "Sep"; $months["10"] = "Oct"; $months["11"] = "Nov"; $months["12"] = "Dec"; $this->months = $months; } function themex_admin_page(){ /** * Creates the Admin page * */ global $pluginBase; clearstatcache(); $this->formLists(); $options = get_option('themex_options'); if ($_POST['action'] == "update"){ if ($_POST['type'] == "simple"){ $options["type"] = "simple"; $options["dayTheme"] = $_POST["dayTheme"]; $options["dayStart"] = $_POST["dayStart"]; $options["nightTheme"] = $_POST["nightTheme"]; $options["nightStart"] = $_POST["nightStart"]; $message = 'Options Updated. Simple Rotation Active.'; } else if ($_POST["type"] == "time"){ $options["timeZone"] = $this->timeZoneArray[$_POST["timezone"]]; $options["timeZoneAbbr"] = $_POST["timezone"]; $message = 'Time Zone Updated'; } else if ($_POST["type"] == "date"){ $options["type"] = "date"; for($m=1;$m<13;$m++){ $fieldName = "theme" . $m; $monthName = "theme" . $m . "-month"; $dayName = "theme" . $m . "-day"; $yearName = "theme" . $m . "-year"; $timeName = "theme" . $m . "-time"; if ($_POST[$dayName] != '' && $_POST[$yearName] != ''){ $options[$fieldName] = $_POST[$fieldName]; $options[$monthName] = $_POST[$monthName]; $options[$dayName] = $_POST[$dayName]; $options[$yearName] = $_POST[$yearName]; $options[$timeName] = $_POST[$timeName]; } else { $options[$fieldName] = ''; $options[$monthName] = ''; $options[$dayName] = ''; $options[$yearName] = ''; $options[$timeName] = ''; } } } update_option('themex_options', $options); } $themes = get_themes(); $tArray = array(); foreach($themes as $t){ $tArray[$t["Template"]] = $t["Name"]; } $text .= ""; $text .= "
"; $text .= "

ThemeX

"; $text .= "ThemeX automatically alternates themes based on the time of day or date."; $text .= "
Select your options below and press 'Save Changes'. Simple Rotation and Date "; $text .= "Based are mutually exclusive, meaning they cannot be used at the same time, it is "; $text .= "either one or the other."; if ($message){ $text .= "
$message"; } $text .= "
"; $text .= "
"; $text .= "
"; $text .= "
"; $text .= "

"; $text .= "
"; $text .= "
"; $text .= ""; $text .= ""; $offset = date('O'); $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= "
"; $text .= "
"; $text .= ""; $text .= "    Your server time zone is: $offset " . date('T'); $text .= "
"; $text .= "

"; $text .= "

"; $text .= "
"; $text .= "
"; $text .= "

"; $text .= "
"; $text .= "
"; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= "
starts at "; $text .= " hours"; $text .= "
starts at "; $text .= " hours"; $text .= "
"; $text .= "

"; $text .= "

"; $text .= "
"; $text .= "
"; $text .= "

"; $text .= "
"; $text .= "These fields will be evaluated in the order they are entered here. "; $text .= "The one with the latest date that has passed will be the active theme."; $text .= " Any entries after a blank line or a date that has not yet passed will be ignored."; $text .= "

For Example:
"; $text .= "If Theme 1 starts on Jan 06, Theme 2 on March 15, and Theme 3 on Feburary 26, "; $text .= " and the current date is June 14, Theme 2 will be active. 1 could be active, but 2 is newer, 3 is newer than 1"; $text .= " but not 2, so it is skipped."; $text .= "

Another Example:
"; $text .= "If Theme 1 starts on Jan 06, Theme 2 on July 15, and Theme 3 on Feburary 26, "; $text .= " and the current date is June 14, Theme 1 will be active. 1 is active because 2 has not yet passed."; $text .= " 3 is not active because although the date is in the past, 2 has not yet passed."; //$text .= " This is done in order to attempt to keep the front-end processing as quick as possible."; $text .= "

"; $text .= ""; $text .= "
"; $text .= ""; $text .= ""; $text .= ""; for($m=1;$m<13;$m++){ $fieldName = "theme" . $m; $monthName = "theme" . $m . "-month"; $dayName = "theme" . $m . "-day"; $yearName = "theme" . $m . "-year"; $timeName = "theme" . $m . "-time"; $text .= ""; $text .= ""; $text .= ""; } $text .= "
starts on "; $text .= ""; $text .= ","; $text .= " "; $text .= " at "; if ($m != 1){ $text .= ""; $text .= " "; } if ($m != 12){ $text .= ""; $text .= " "; } $text .= "
"; $text .= "

"; $text .= "

"; $text .= "
"; $text .= "
"; print($text); } } ?>