"Please configure thecolumns of the theme:", "type" => "title" ), array( "type" => "open"), array( "name" => "Column 1 Title", "desc" => "Enter the title for column 1", "id" => $shortname."_column_1_title", "std" => "", "type" => "text" ), array( "name" => "Column 2 Title", "desc" => "Enter the title for column 2", "id" => $shortname."_column_2_title", "std" => "", "type" => "text" ), array( "name" => "Column 3 Title", "desc" => "Enter the title for column 3", "id" => $shortname."_column_3_title", "std" => "", "type" => "text" ), array( "name" => "Column 4 Title", "desc" => "Enter the title for column 4", "id" => $shortname."_column_4_title", "std" => "", "type" => "text" ), array( "name" => "Column 1 Category ID", "desc" => "Enter the ID of the Category you wish to associate to Column 1", "id" => $shortname."_column_1_cat_ID", "std" => "", "type" => "text" ), array( "name" => "Column 2 Category ID", "desc" => "Enter the ID of the Category you wish to associate to Column 2", "id" => $shortname."_column_2_cat_ID", "std" => "", "type" => "text" ), array( "name" => "Column 3 Category ID", "desc" => "Enter the ID of the Category you wish to associate to Column 3", "id" => $shortname."_column_3_cat_ID", "std" => "", "type" => "text" ), array( "type" => "close" ) ); if ( function_exists('register_sidebar') ) register_sidebar(); 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.
'.$themename.' settings reset.