diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/aparatus/functions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/aparatus/functions.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,364 @@ + "General Settings", + "type" => "sub-title"), +array( "type" => "open"), +array( "name" => "Style Sheet", + "desc" => "Enter the Style Sheet you like", + "id" => $shortname."_style_sheet", + "type" => "select", + "options" => array("maroon", "black", "blue", "green"), + "std" => "maroon"), +array( "name" => "Twitter Account", + "desc" => "Enter the your Twitter Account", + "id" => $shortname."_Twitter", + "type" => "text", + "std" => ""), +array( "type" => "close"), + +array( "name" => "Home Page Settings", + "type" => "sub-title"), +array( "type" => "open"), + +array( "name" => "No Slideshow?", + "desc" => "Click this box if you DONT want to use the Mootools Slideshow", + "id" => $shortname."_use_slide_show", + "type" => "checkbox", + "std" => ""), +array( "name" => "Dont automatic Slide?", + "desc" => "Click this box if you DONT want the Slideshow to slide on load", + "id" => $shortname."_auto_slide_show", + "type" => "checkbox", + "std" => ""), +array( "name" => "Category Name for the Content Slider", + "desc" => "Enter the category name of the posts you would like to show up in the content slider. If you don't enter a value, The latest 5 Posts will be used", + "id" => $shortname."_feature_cat_name", + "type" => "text", + "std" => ""), +array( "type" => "close"), + +array( "name" => "Advertising Blocks", + "type" => "sub-title"), +array( "type" => "open"), + +array( "name" => "300 x 250 Big Ad Block Image Source", + "desc" => "Enter the Full Image URL of the 300 x 250 Ad block in the Sidebar here", + "id" => $shortname."_ad300x250image", + "type" => "text", + "std" => ""), +array( "name" => "300 x 250 Big Ad Block Click Destination", + "desc" => "Enter the Click Destination URL of the 300 x 250 Ad block in the Sidebar here", + "id" => $shortname."_ad300x250destination", + "type" => "text", + "std" => ""), + +array( "name" => "1st Small Ad Block Image Source", + "desc" => "Enter the Full Image URL of the first 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_1_ad_image", + "type" => "text", + "std" => ""), +array( "name" => "1st Small Ad Block Click Destination", + "desc" => "Enter the Click Destination URL of the first 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_1_ad_destination", + "type" => "text", + "std" => ""), + +array( "name" => "2nd Small Ad Block Image Source", + "desc" => "Enter the Full Image URL of the second 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_2_ad_image", + "type" => "text", + "std" => ""), +array( "name" => "2nd Small Ad Block Click Destination", + "desc" => "Enter the Click Destination URL of the second 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_2_ad_destination", + "type" => "text", + "std" => ""), + +array( "name" => "3rd Small Ad Block Image Source", + "desc" => "Enter the Full Image URL of the third 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_3_ad_image", + "type" => "text", + "std" => ""), +array( "name" => "3rd Small Ad Block Click Destination", + "desc" => "Enter the Click Destination URL of the third 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_1_ad_destination", + "type" => "text", + "std" => ""), + +array( "name" => "4th Small Ad Block Image Source", + "desc" => "Enter the Full Image URL of the fourth 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_4_ad_image", + "type" => "text", + "std" => ""), +array( "name" => "4th Small Ad Block Click Destination", + "desc" => "Enter the Click Destination URL fourth 125 x 125 Small Ad block in the Sidebar here", + "id" => $shortname."_4_ad_destination", + "type" => "text", + "std" => ""), + + + +array( "type" => "close") +); + +//presentation// + +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.