'Sidebar Top',));
register_sidebar(array('name'=>'Sidebar Bottom Left',));
register_sidebar(array('name'=>'Sidebar Bottom Right',));
$themename = "Semrawang";
$shortname = "byme";
$options = array (
array( "name" => "General Settings",
"type" => "heading"),
array( "name" => "Feedburner ID",
"desc" => "Learn how to find your Feedburner ID by reading this tutorial.
",
"id" => $shortname."_feedburner_id",
"std" => "Enter Feedburner Email Subscribe ID Here",
"type" => "text"),
array( "name" => "Ad format no 1",
"desc" => "This is for the Ad format no 1.
",
"id" => $shortname."_ad_01",
"std" => "Enter Ad format no 1 here",
"type" => "textarea"),
array( "name" => "Ad format no 2",
"desc" => "This is for the Ad format no 2.
",
"id" => $shortname."_ad_02",
"std" => "Enter Ad format no 2 here",
"type" => "textarea"),
array( "name" => "Ad format no 3",
"desc" => "This is for the Ad format no 3.
",
"id" => $shortname."_ad_03",
"std" => "Enter Ad format no 3 here",
"type" => "textarea"),
array( "name" => "Ad format no 4",
"desc" => "This is for the Ad format no 4.
",
"id" => $shortname."_ad_04",
"std" => "Enter Ad format no 4 here",
"type" => "textarea"),
array( "name" => "Featured Video",
"desc" => "This is for the featured video.
Recommended size for the video is 300x250, so don't forget to change that from the embedded video code.
",
"id" => $shortname."_video",
"std" => "Enter Featured Video Code here",
"type" => "textarea"),
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
update_option( $value['id'], $_REQUEST[ $value['id'] ] );
}else{
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $value['id'].'_'.$mc_key;
update_option($up_opt, $_REQUEST[$up_opt] );
}
}
}
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }
}else{
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $value['id'].'_'.$mc_key;
if( isset( $_REQUEST[ $up_opt ] ) ) { update_option( $up_opt, $_REQUEST[ $up_opt ] ); } else { delete_option( $up_opt ); }
}
}
}
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
delete_option( $value['id'] );
}else{
foreach($value['options'] as $mc_key => $mc_value){
$del_opt = $value['id'].'_'.$mc_key;
delete_option($del_opt);
}
}
}
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo '
'.$themename.' settings saved.
'.$themename.' settings reset.
"; echo $content; echo " "."Read More →"; echo "
"; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo ""; echo $content; echo "..."; echo " ".$more_link_text.""; echo "
"; } else { echo ""; echo $content; echo " "."Read More →"; echo "
"; } } ?>