cat_ID] = $ang_cat->category_nicename; } $categories_tmp = array_unshift($ang_categories, "Select a category:"); $number_entries = array("Select a Number:","1","2","3","4","5","6","7","8","9","10" ); $options = array( array ( "type" => "open", "id" => $shortname."_temp", "std" => "" ), array( "name" => "General", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Styles", "desc" => "Switch Style", "id" => $shortname."_style", "type" => "select", "options" => array("Style1","Style2","Style3","Style4","Style5","Style6","Style7","Style8","Style9","Style10"), "std" => "Style1", ), array( "name" => "Hide BreadCrumbs", "desc" => "Hide Breadcrumbs?", "id" => $shortname."_breadcrumbs", "type" => "checkbox", "std" => "false" ), array( "name" => "Homepage", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Slider Category", "desc" => "Select the category for slider", "id" => $shortname."_slider_cat", "type" => "select", "std" => "Select a category", "options" => $ang_categories), array( "name" => "Slider Posts Count", "desc" => "How many posts you want to show in slider?", "id" => $shortname."_slider_count", "type" => "select", "std" => "3", "options" => $number_entries), array( "name" => "Featured Posts Category", "desc" => "Select the category of featured posts", "id" =>$shortname."_featured_cat", "type" => "select", "std" => "Select a category", "options" => $ang_categories), array( "name" => "Featured Posts count", "desc" => "How many Featured posts you want to show on homepage?", "id" => $shortname."_featured_count", "type" => "select", "std" => "3", "options" => $number_entries), array( "name" => "Social Icons", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Hide all the Social Icons", "id" => $shortname."_hide_social", "type" => "checkbox", "std" => ""), array( "name" => "Twitter Icon", "desc" => "Check to hide Twitter icon. If not type your twitter url below:", "id" => $shortname."_hide_tw", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_tw_url", "type" => "text2", "desc" => "Type Your Twitter URL", "std" => "" ), array( "name" => "Facebook Icon", "desc" => "Check to hide Facebook icon. If not type your Facebook url below:", "id" => $shortname."_hide_fb", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_fb_url", "type" => "text2", "desc" => "Type Your Facebook URL", "std" => "" ), array( "name" => "Myspace Icon", "desc" => "Check to hide Myspace icon. If not type your Myspace url below:", "id" => $shortname."_hide_ms", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_ms_url", "type" => "text2", "desc" => "Type Your Myspace URL", "std" => "" ), array( "name" => "RSS Feed Icon", "desc" => "Check to hide Feedburner icon. If not type your Feedburner url below:", "id" => $shortname."_hide_rss", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_rss_url", "type" => "text2", "desc" => "Type Your Feedburner URL", "std" => "" ), array( "name" => "Footer", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Footer Text", "desc" => "Type your own footer text", "id" => $shortname."_text", "type" => "textarea", "std" => "©Angelia 2010") ); array( "type" => "close" ); function mytheme_add_admin() { global $themename, $shortname, $options; $optionvar = array(); if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) { if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { if (isset($_REQUEST[ $value['id'] ])) { 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'] ); } } update_option( $shortname."_options", $optionvar ); header("Location: themes.php?page=functions.php&saved=true"); die; } else if( isset($_REQUEST['action']) && '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, $option_values; if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '
'.$themename.' settings saved.
'.$themename.' settings reset.