'Sidebar380px', 'id'=>'sidebar380px', 'before_title'=>"
",
'after_title'=>"
\n", 'before_widget' => '', ' after_widget' => "" ));
function new_excerpt_length($length) {
return 60;
}
add_filter('excerpt_length', 'new_excerpt_length');
$themename = "MT Dark";
$shortname = "dark";
$options = array (
array( "name" => "About",
"type" => "title"),
array( "type" => "open"),
array( "name" => "Image",
"desc" => "Paste the url to the image(80x90px).",
"id" => $shortname."_img",
"std" => "",
"type" => "text"),
array( "name" => "About",
"desc" => "Text to display as welcome message.",
"id" => $shortname."_message",
"type" => "textarea"),
array( "name" => "Disable \"About\" ",
"desc" => "Check this box if you would like to DISABLE the \"About\".",
"id" => $shortname."_disable",
"type" => "checkbox",
"std" => "false"),
array( "type" => "close"),
array( "name" => "Social media",
"type" => "title"),
array( "type" => "open"),
array( "name" => "Twitter",
"desc" => "\"Twitter\"- username.",
"id" => $shortname."_twett",
"type" => "text"),
array( "name" => "Facebook",
"desc" => "\"Facebook\"- username.",
"id" => $shortname."_facebook",
"type" => "text"),
array( "name" => "Flickr",
"desc" => "\"Flickr\"- username.",
"id" => $shortname."_flickr",
"type" => "text"),
array( "name" => "YouTube",
"desc" => "\"YouTube\"- username.",
"id" => $shortname."_youtube",
"type" => "text"),
array( "name" => "Blogger",
"desc" => "\"Blogger\"- full url (http://name.blogspot.com/).",
"id" => $shortname."_blogger",
"type" => "text"),
array( "name" => "Last FM",
"desc" => "\"Last FM\"- username.",
"id" => $shortname."_last",
"type" => "text"),
array( "name" => "Delicious ",
"desc" => "\"Delicious\"- username.",
"id" => $shortname."_del",
"type" => "text"),
array( "type" => "close"),
array( "name" => "Other",
"type" => "title"),
array( "type" => "open"),
array( "name" => "Header image",
"desc" => "Paste the url to the image.(80x80)",
"id" => $shortname."_headerimg",
"std" => "",
"type" => "text"),
array( "name" => "Disable the footer",
"desc" => "Check this box if you would like to DISABLE the footer.",
"id" => $shortname."_disable_footer",
"type" => "checkbox",
"std" => "false"),
//array( "name" => "Analytics code",
// "desc" => "Paste your Google Analytics code in the box below.",
// "id" => $shortname."_analitics",
// "type" => "code"),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
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.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>