"Simpleblue_bgcolor", "default" => "BFBFFF", "type" => "Simpleblue_bgcolor"), array( "id" => "Simpleblue_blogtitle", "default" => "yes", "type" => "Simpleblue_blogtitle"), array( "id" => "Simpleblue_hdrimage", "default" => "no", "type" => "Simpleblue_hdrimage"), array( "id" => "Simpleblue_hdrimageheight", "default" => "100", "type" => "Simpleblue_hdrimageheight"), array( "id" => "Simpleblue_hdrimagepath", "default" => "", "type" => "Simpleblue_hdrimagepath"), array( "id" => "Simpleblue_navbar", "default" => "pages", "type" => "Simpleblue_navbar"), array( "id" => "Simpleblue_search", "default" => "yes", "type" => "Simpleblue_search"), array( "id" => "Simpleblue_rssicon", "default" => "yes", "type" => "Simpleblue_rssicon"), array( "id" => "Simpleblue_postauthor", "default" => "yes", "type" => "Simpleblue_postauthor"), array( "id" => "Simpleblue_postdate", "default" => "yes", "type" => "Simpleblue_postdate"), array( "id" => "Simpleblue_postcategory", "default" => "yes", "type" => "Simpleblue_postcategory"), array( "id" => "Simpleblue_posttags", "default" => "yes", "type" => "Simpleblue_posttags"), array( "id" => "Simpleblue_footertext", "default" => get_bloginfo('name'), "type" => "Simpleblue_footertext"), ); $uploadpath = wp_upload_dir(); if ($uploadpath['baseurl']=='') $uploadpath['baseurl'] = get_bloginfo('siteurl').'/wp-content/uploads'; function Simpleblue_options() { global $options, $uploadpath; if ( isset($_REQUEST['action']) && 'Simpleblue_save'== $_REQUEST['action'] ) { foreach ($options as $value) { if( !isset( $_REQUEST[ $value['id'] ] ) ) { } else { update_option( $value['id'], stripslashes($_REQUEST[ $value['id']])); } } if(stristr($_SERVER['REQUEST_URI'],'&saved=true')) { $location = $_SERVER['REQUEST_URI']; } else { $location = $_SERVER['REQUEST_URI'] . "&saved=true"; } if ($_FILES["file-header"]["type"]){ $directory = $uploadpath['basedir'].'/'; move_uploaded_file($_FILES["file-header"]["tmp_name"], $directory . $_FILES["file-header"]["name"]); update_option('Simpleblue_hdrimagepath', $uploadpath['baseurl']. "/". $_FILES["file-header"]["name"]); } header("Location: $location"); die; } // set default options foreach ($options as $default) { if(get_option($default['id'])=="") { update_option($default['id'],$default['default']); } } add_menu_page( __('Simple-Blue Settings','default'), __('Simple-Blue Settings','default'), 10, 'Simple-Blue', 'Simpleblue_admin',get_bloginfo('template_url').'/images/favicon.ico'); } function Simpleblue_admin() { global $options, $uploadpath; ?>