@ 2013-11-27T12:28:23Z <?php
//Theme Name
$themename = "Dance Floor";
//prefix
$shortname = "theme_";
//Array
$options = array (
array(
"name" => "Videos urls",
"id" => $shortname."_videosArray",
"std" => "a:5:{s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}s:10:\"url_video1\";a:3:{s:4:\"link\";s:1:\"#\";s:6:\"height\";i:250;s:5:\"width\";i:300;}}"),
array(
"name" => "Banners",
"id" => $shortname."_bannersArray",
"std" => "a:6:{s:13:\"theme_banner1\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner2\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner3\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner4\";a:5:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:125;s:5:\"width\";i:125;s:6:\"status\";i:0;}s:13:\"theme_banner5\";a:6:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:250;s:5:\"width\";i:300;s:6:\"status\";i:0;s:7:\"adsense\";s:0:\"\";}s:13:\"theme_banner6\";a:6:{s:4:\"link\";s:1:\"#\";s:9:\"image_url\";s:0:\"\";s:6:\"height\";i:60;s:5:\"width\";i:468;s:6:\"status\";i:0;s:7:\"adsense\";s:0:\"\";}}"
),
array(
"name" => "Styles",
"id" => $shortname."_css",
"std" => "style.css"
),
array(
"name" => "flickr",
"id" => $shortname."_flickr",
"std" => "a:4:{s:4:\"nsid\";s:0:\"\";s:7:\"display\";s:0:\"\";s:11:\"displayType\";s:0:\"\";s:4:\"tags\";s:0:\"\";}"
),
array(
"name" => "musicplayer",
"id" => $shortname."_musicplayer",
"std" => "a:2:{s:2:\"id\";s:0:\"\";s:3:\"num\";s:1:\"5\";}"
),
array(
"name" => "FeedbSumition",
"id" => $shortname."_musicplayerSumition",
"std" => ""
),
array(
"name" => "html5",
"id" => $shortname."_html5",
"std" => ""
),
array(
"name" => "BannersStatus",
"id" => $shortname."_bannerStatus",
"std" => "1"
),
);
//Flickr display types
$flickrDisplayType = Array("square", "thumbnail", "small");
//Existing CSS Files
$cssFiles = get_availableCss();
function get_bannersSettings($bannerId, $index = FALSE){
global $themename, $shortname, $options;
$theBanners = get_option($shortname."_bannersArray");
if(!is_array($theBanners)){
$theBanners = unserialize($options[1]["std"]);
}
$theActualBanner = $theBanners[$bannerId];
if($index != FALSE){
return $theActualBanner[$index];
}else{
return $theActualBanner;
}
}
function get_videoSettings($videoId, $index){
global $themename, $shortname, $options;
$theVideos = get_option($shortname."_videosArray");
if(!is_array($theVideos)){
$theVideos = unserialize($options[0]["std"]);
}
$theActualVideo = $theVideos[$videoId];
return $theActualVideo[$index];
}
function get_flickrSettings($index){
global $themename, $shortname, $options;
$theflickrSettings = get_option($shortname."_flickr");
if(!is_array($theflickrSettings)){
$theflickrSettings = unserialize($options[3]["std"]);
}
return $theflickrSettings[$index];
}
function get_musicplayer($index){
global $themename, $shortname, $options;
$themusicplayerSettings = get_option($shortname."_musicplayer");
if(!is_array($themusicplayerSettings)){
$themusicplayerSettings = unserialize($options[4]["std"]);
}
return $themusicplayerSettings[$index];
}
/*
Get Available CSS
*/
function get_availableCss(){
$result = array();
$dir = dir(TEMPLATEPATH."/");
while (false !== ($file = $dir->read())) {
if(ereg("\.css", $file, $r)){
$result[] = $file;
}
}
$dir->close();
return $result;
}
/*
Reset or Update Theme Options
*/
function newThemeOptions_add_admin() {
global $themename, $shortname, $options, $cssFiles;
if ( $_GET['page'] == basename("__FILE__ not allowed" not allowed" not allowed" not allowed" not allowed") ) {
if($_REQUEST['saveButton']){
while(list($videoId, $bannerInfo) = each($_REQUEST[$shortname."_video"])){
$videoInfo["width"] = get_videoSettings($videoId, "width");
$videoInfo["height"] = get_videoSettings($videoId, "height");
$videoInfo["link"] = $_REQUEST[$shortname."_video"][$videoId]["link"];
$allVideos[$videoId] = $bannerInfo;
}
update_option( $shortname."_videosArray", $allVideos);
update_option( $shortname."_css", $_REQUEST[ $shortname."_css" ] );
while(list($bannerId, $bannerInfo) = each($_REQUEST[$shortname."_banner"])){
$bannerInfo["width"] = get_bannersSettings($bannerId, "width");
$bannerInfo["height"] = get_bannersSettings($bannerId, "height");
$bannerInfo["status"] = $_REQUEST[$shortname."_banner"][$bannerId]["status"];
if($_REQUEST[$shortname."_banner"][$bannerId]["adsense"])
$bannerInfo["adsense"] = ($_REQUEST[$shortname."_banner"][$bannerId]["adsense"]);
$allBanners[$bannerId] = $bannerInfo;
}
update_option( $shortname."_bannersArray", $allBanners);
update_option( $shortname."_flickr", $_REQUEST[$shortname."_flickr"]);
update_option( $shortname."_musicplayer", $_REQUEST[$shortname."_musicplayer"]);
update_option( $shortname."_musicplayerSumition", $_REQUEST[$shortname."_musicplayerSumition"]);
update_option( $shortname."_html5", $_REQUEST[$shortname."_html5"]);
update_option( $shortname."_bannerStatus", $_REQUEST[$shortname."_bannerStatus"]);
header("Location: themes.php?page=functions.php&saved=true");
die;
}else if($_REQUEST['resetButton']){
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename("""""__FILE__ not allowed" not allowed" not allowed" not allowed" not allowed"), 'newThemeOptions_admin');
}
function newThemeOptions_admin() {
global $themename, $shortname, $options, $cssFiles, $flickrDisplayType;
if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
echo "\n<style type='text/css'>";
echo "\ndiv.wrap dl{margin: 0; padding: 0;}";
echo "\ndiv.wrap dt{position: relative; left: 0; top: 1.1em; width: 8em; font-weight: bold;}";
echo "\ndiv.wrap dd{ margin: 0 0 0 10em; padding: 0 0 .5em .5em;}";
echo "\table#outer dl h3, table#outer td.right dl h4 { font-size: 10pt; font-weight: bold; margin:0; padding: 4px 10px 4px 10px; }";
echo "\n</style>";
echo "\n<script>";
echo "\n\tfunction markAll(selectStatus){";
echo "\n\t\tif(selectStatus){";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner1][status]').checked = true;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner2][status]').checked = true;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner3][status]').checked = true;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner4][status]').checked = true;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner5][status]').checked = true;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner6][status]').checked = true;";
echo "\n\t\t}else{";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner1][status]').checked = false;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner2][status]').checked = false;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner3][status]').checked = false;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner4][status]').checked = false;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner5][status]').checked = false;";
echo "\n\t\t\tdocument.getElementById('theme__banner[theme_banner6][status]').checked = false;";
echo "\n\t\t}";
echo "\n\t}";
echo "\n</script>";
echo "\n<div class=\"wrap\">";
echo "\n<p id=\"icon-options-general\" class=\"icon32\"><h2>".$themename." _e("theme settings","language"); "</h2></p><br/>";
echo "\n<form method=\"post\">";
echo "\n<p class=\"submit\" style=\"border:0px;padding:0px;\">";
echo "\n\t<input class=\"button-primary\" type=\"submit\" name=\"saveButton\" value=\"" _e("Save settings","language"); echo "\" />";
echo "\n\t<input class=\"button\" name=\"resetButton\" type=\"submit\" value=\"" _e("Reset settings","language"); echo "\" /><br/>";
echo "\n</p>";
echo "\n<br><table class=\"widefat\"><thead><tr><th style='font-size:14px;font-weight:normal;font-style:normal;padding-left:10px;'>" _e("Theme Style","language"); "</th></tr></thead>";
echo "\n\t\t<tbody><tr><th >" _e("Select your Style","language"); "";
echo "\n\t\t\t<select name=\"".$shortname."_css\" id=\"".$shortname."_css\">";while(list(, $f) = each($cssFiles)){
echo "\n\t\t\t\t<option value=\"".$f."\" ".((get_option( $shortname."_css" )==$f)?"selected":"").">".$f."</option>";}
echo "\n\t\t\t</select>";
echo "\n</td></th></tr></tbody></table>";
echo "\n<table class=\"form-table\">";
echo "\n\t<tr valign=\"top\">";
echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Flickr Widget Setup","language"); "</th></tr></thead>";
echo "\n\t\t<tbody><tr><th>";
echo "\n<table class=\"form-table\">";
echo "\n\t<tr valign=\"top\">";
echo "\n\t\t<th scope=\"row\">User ID: </th>";
echo "\n\t\t<td>";
echo "\n\t\t\t<input name=\"".$shortname."_flickr[nsid]\" type=\"text\" id=\"".$shortname."_flickr[nsid]\" value=\"".get_flickrSettings('nsid')."\" size=\"20\" />";
echo "\n\t\t</td>";
echo "\n\t</tr>";
echo "\n\t\t<th>Display: </th>";
echo "\n\t\t<td>";
echo "\n\t\t\t<select name=\"".$shortname."_flickr[display]\" id=\"".$shortname."_flickr[display]\">";
for($x = 1; $x<= 10; $x++){
echo "\n\t\t\t\t<option value=\"".$x."\" ".((get_flickrSettings( "display" )==$x)?"selected":"").">".$x."</option>";
}
echo "\n\t\t\t</select>";
echo "\n\t\t\t<select name=\"".$shortname."_flickr[displayType]\" id=\"".$shortname."_flickr[displayType]\">";
while(list(, $f) = each($flickrDisplayType)){
echo "\n\t\t\t\t<option value=\"".$f."\" ".((get_flickrSettings( "displayType" )==$f)?"selected":"").">".$f."</option>";
}
echo "\n\t\t\t</select> Images ";
echo "\n\t\t</td>";
echo "\n\t</tr>";
echo "\n</td></th></tr></tbody></table></table>";
echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Music Player","language"); "</th></tr></thead>";
echo "\n\t\t<tbody><tr><th>";
echo "\n<table class=\"form-table\">";
echo "\n\t<tr valign=\"top\">";
echo "\n\t\t<th scope=\"row\">" _e("Enter your the URl of your song.","language"); "</th>";
echo "\n\t\t<td>";
echo "\n\t\t\t<input name=\"".$shortname."_musicplayerSumition\" type=\"text\" id=\"".$shortname."_musicplayerSumition\" value=\"".get_option($shortname.'_musicplayerSumition')."\" size=\"100\" />";
echo "\n\t\t</td>";
echo "\n\t</tr>";
echo "\n</td></th></tr></tbody></table></table>";
echo "\n\t\t<br><table class=\"widefat\"><thead><tr><th>" _e("Audio/Video Player Module","language"); "</th></tr></thead>";
echo "\n\t\t<tbody><tr><th>";
echo "\n<table class=\"form-table\">";
$videosArray = unserialize($options[0]["std"]);
$x = 1;
$bg = 'style="background: #f1f1f1;"';
while(list($videoIndex, $aVideo) = each($videosArray)){
$bg = ($bg == 'style="background: #f1f1f1;"') ? '' : 'style="background: #f1f1f1;"';
echo "\n\t<tr valign=\"top\" ".$bg.">";
echo "\n\t\t<td ".$bg.">";
echo "\n\t\t<dl>";
echo "\n\t\t\t<dt>" _e("Player Code","language"); "</dt>";
echo "\n\t\t\t<dd><textarea name=\"".$shortname."_video[".$videoIndex."][link]\" id=\"".$shortname."_video[".$videoIndex."][link]\" style=\"width: 550px; height: 120px;\">".stripslashes((get_videoSettings($videoIndex, "link")!="")?get_videoSettings($videoIndex, "link"):$aVideo[$videoIndex]["link"])."
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.36 0.023 0.040 18.62 5.4.35 0.007 0.037 13.82 5.4.34 0.007 0.037 14.05 5.4.32 0.013 0.034 13.49 5.4.31 0.011 0.033 13.46 5.4.30 0.010 0.036 13.49 5.4.29 0.014 0.034 13.46 5.4.28 0.002 0.043 13.33 5.4.27 0.005 0.041 13.29 5.4.26 0.011 0.036 13.31 5.4.25 0.008 0.042 13.32 5.4.24 0.006 0.040 13.35 5.4.23 0.010 0.038 13.28 5.4.22 0.013 0.040 13.00 5.4.21 0.008 0.041 13.00 5.4.20 0.009 0.041 13.09 5.4.19 0.010 0.040 13.02 5.4.18 0.011 0.041 13.01 5.4.17 0.021 0.060 13.04 5.4.16 0.009 0.041 13.02 5.4.15 0.015 0.036 12.99 5.4.14 0.012 0.038 12.78 5.4.13 0.009 0.041 12.71 5.4.12 0.010 0.042 12.64 5.4.11 0.012 0.039 12.61 5.4.10 0.009 0.047 12.63 5.4.9 0.012 0.044 12.67 5.4.8 0.011 0.040 12.64 5.4.7 0.013 0.036 12.62 5.4.6 0.013 0.035 12.63 5.4.5 0.011 0.038 12.64 5.4.4 0.019 0.052 12.63 5.4.3 0.013 0.039 12.62 5.4.2 0.014 0.039 12.64 5.4.1 0.014 0.037 12.64 5.4.0 0.020 0.058 12.13 5.3.29 0.009 0.044 13.78 5.3.28 0.008 0.051 13.67 5.3.27 0.009 0.050 13.38 5.3.26 0.012 0.049 13.36 5.3.25 0.013 0.046 13.36 5.3.24 0.021 0.054 13.41 5.3.23 0.013 0.044 13.34 5.3.22 0.020 0.056 13.33 5.3.21 0.013 0.043 13.38 5.3.20 0.009 0.045 13.32 5.3.19 0.014 0.039 13.31 5.3.18 0.014 0.038 13.29 5.3.17 0.018 0.057 13.31 5.3.16 0.012 0.045 13.30 5.3.15 0.009 0.047 13.33 5.3.14 0.016 0.041 13.34 5.3.13 0.014 0.044 13.36 5.3.12 0.010 0.043 13.36 5.3.11 0.020 0.064 13.35 5.3.10 0.011 0.040 12.79 5.3.9 0.014 0.036 12.77 5.3.8 0.010 0.041 12.77 5.3.7 0.008 0.042 12.80 5.3.6 0.010 0.040 12.76 5.3.5 0.016 0.035 12.67 5.3.4 0.015 0.056 12.67 5.3.3 0.014 0.040 12.70 5.3.2 0.014 0.035 12.45 5.3.1 0.015 0.034 12.40 5.3.0 0.012 0.038 12.41
preferences:dark mode live preview
144.99 ms | 1394 KiB | 7 Q