<?php

function gpp_options(){

// Global Variables
global $themename, $photoshelter, $welcome, $gppslideshow, $featured, $thumbslider, $postslider, $category_columns, $pages_title, $category_title, $default_thumb;

//Default Variables
$instructionsurl = (get_bloginfo('stylesheet_directory') . '/instructions.html');
$manualurl = 'http://graphpaperpress.com/faq/';
$videosurl = 'http://graphpaperpress.com/videos/';
$supporturl = 'http://graphpaperpress.com/support/';
$shortname = "gpp";

// Modularity Theme Defaults
if(!isset($themename)) {$themename = "Modularity";}
if(!isset($photoshelter)) {$photoshelter = "false";}
if(!isset($welcome)) {$welcome = "true";}
if(!isset($gppslideshow)) {$gppslideshow = "true";}
if(!isset($featured)) {$featured = "true";}
if(!isset($thumbslider)) {$thumbslider = "true";}
if(!isset($postslider)) {$postslider = "false";}
if(!isset($category_columns)) {$category_columns = "true";}
if(!isset($pages_title)) {$pages_title = "Pages";}
if(!isset($category_title)) {$category_title = "Categories";}
if(!isset($default_thumb)) {$default_thumb = get_bloginfo('template_url') . "/images/default-thumb.jpg";}

$GLOBALS['template_path'] = get_bloginfo('template_directory');

// Get Wordpress Categories
global $categories;
$cats_array = get_categories();
$categories = array();
foreach ($cats_array as $cats) {
	$categories[0] = "";
	$categories[$cats->cat_ID] = $cats->cat_name;	
}

// Access the WordPress Categories via an Array
$gpp_categories = array();  
$gpp_categories_obj = get_categories('hide_empty=0');
foreach ($gpp_categories_obj as $gpp_cat) {
    $gpp_categories[$gpp_cat->cat_ID] = $gpp_cat->cat_name;}
$categories_tmp = array_unshift($gpp_categories, "Select a category:");    
       
// Access the WordPress Pages via an Array
$gpp_pages = array();
$gpp_pages_obj = get_pages('sort_column=post_parent,menu_order');    
foreach ($gpp_pages_obj as $gpp_page) {
    $gpp_pages[$gpp_page->ID] = $gpp_page->post_name; }
$gpp_pages_tmp = array_unshift($gpp_pages, "Select a page:");       


// More Options
$all_uploads_path = get_bloginfo('home') . '/wp-content/uploads/';
$all_uploads = get_option('gpp_uploads');

$other_entries = array();

for($i=1;$i<=20;$i++) {
	$other_entries[$i] = $i;
}
// Theme Options
$options = array();   

$options[] = array(	"name" => "General Settings",
					"type" => "heading");
					
$options[] = array(	"name" => "Text logo",
					"desc" => "If enabled, you will see a text logo.  If disabled, you will need to upload your own image logo.",
			    	"id" => $shortname."_logo_off",
			    	"std" => "",
			   		"type" => "checkbox");

$options[] = array( "name" => "Custom Logo",
					"desc" => "Upload a logo for your theme, or specify the image address of your online logo. (http://yoursite.com/logo.png).  Logos should be in transparent PNG format and be 60px in max height and 350px in max width.",
					"id" => $shortname."_logo",
					"std" => "",
					"type" => "upload");
					

                                                                                     
$options[] = array( "name" => "Custom Favicon",
					"desc" => "Upload a 16px x 16px Png/Gif image that will represent your website's favicon.",
					"id" => $shortname."_custom_favicon",
					"std" => "",
					"type" => "upload");
					
$options[] = array(	"name" => "Sidebar",
					"desc" => "Check to show a sidebar on all posts and pages. If enabled, the main body well of your site will become 590 pixels wide, with a sidebar on the right measuring 310 pixels wide.  If disabled, the theme will be a two column 950 pixel wide design.",
			    	"id" => $shortname."_sidebar",
			    	"std" => "true",
			   		"type" => "checkbox");
                                               
$options[] = array( "name" => "Tracking Code",
					"desc" => "Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.",
					"id" => $shortname."_tracking_code",
					"std" => "",
					"type" => "textarea");        

$options[] = array( "name" => "RSS URL",
					"desc" => "Enter your preferred RSS URL. (Feedburner or other)",
					"id" => $shortname."_feedburner_url",
					"std" => "",
					"type" => "text");
               
$options[] = array(	"name" => "Color Settings",
					"type" => "heading");
					                 
$options[] = array(	"name" => "Customize colors",
					"desc" => "If enabled the theme will use the layouts and colors you choose below.",
				    "id" => $shortname."_css",
		    		"std" => "false",
		    		"type" => "checkbox");
 if($themename != "Work-a-holic") {	        
$options[] = array(	"name" => "Background color",
				    "id" => $shortname."_background_color",
					"desc" => "Your background color. Use Hex values and leave out the leading #.",
				    "std" => "111111",
				    "type" => "text");
				    
$options[] = array( "name" => "Background image",
					"desc" => "Upload a background image for your site, or specify the image address of your online logo. (http://yoursite.com/background.png).  Backgrounds should be in either JPG, GIF, or transparent PNG format and generally be as small in file size as possible.",
					"id" => $shortname."_background_image",
					"std" => "",
					"type" => "upload");   
				    
$options[] = array(	"name" => "Background repeat",
				    "id" => $shortname."_background_repeat",
					"desc" => "Select appropriate option to repeat background.  Choose no-repeat if you want one big background image.  Choose repeat-x if you want the background image to repeat horizontally.  Select repeat-y to repeat the background image vertically.  Select repeat to tile the background image both horizontally and vertically.",
				    "std" => "",
				    "type" => "select",
				    "options" => array("no-repeat"=>"no-repeat","repeat-x"=>"repeat-x","repeat-y"=>"repeat-y","repeat"=>"repeat"));
			    
$options[] = array(	"name" => "Page color",
				    "id" => $shortname."_page_color",
					"desc" => "Your page color. Use Hex values and leave out the leading #.",
				    "std" => "ffffff",
				    "type" => "text");
				    
$options[] = array(	"name" => "Border color",
				    "id" => $shortname."_border_color",
					"desc" => "Your border and box color. Use Hex values and leave out the leading #.",
				    "std" => "cccccc",
				    "type" => "text");
				    
$options[] = array(	"name" => "Footer color",
				    "id" => $shortname."_footer_color",
					"desc" => "Your footer background color. Use Hex values and leave out the leading #.",
				    "std" => "000000",
				    "type" => "text");
    
$options[] = array(	"name" => "Site logo color",
				    "id" => $shortname."_logo_color",
					"desc" => "Your text logo color. Use Hex values and leave out the leading #.",
				    "std" => "000000",
				    "type" => "text");
    		
$options[] = array(	"name" => "Font color",
				    "id" => $shortname."_font_color",
					"desc" => "Your font color. Use Hex values and leave out the leading #.",
				    "std" => "222222",
				    "type" => "text");
				    
$options[] = array(	"name" => "Link color",
				    "id" => $shortname."_link_color",
					"desc" => "Your link color. Use Hex values and leave out the leading #.",
				    "std" => "428ce7",
				    "type" => "text");
    
$options[] = array(	"name" => "Link hover color",
				    "id" => $shortname."_hover_color",
					"desc" => "Your link hover color. Use Hex values and leave out the leading #.",
				    "std" => "666666",
				    "type" => "text");
				    
$options[] = array(	"name" => "Navigation background color",
				    "id" => $shortname."_nav_bg_color",
					"desc" => "Your navigation background color. Use Hex values and leave out the leading #.",
				    "std" => "000000",
				    "type" => "text");
				    
$options[] = array(	"name" => "Navigation background rollover color",
				    "id" => $shortname."_nav_bg_hover_color",
					"desc" => "Your navigation background on rollover color. Use Hex values and leave out the leading #.",
				    "std" => "333333",
				    "type" => "text");
				    
$options[] = array(	"name" => "Navigation link color",
				    "id" => $shortname."_nav_link_color",
					"desc" => "Your navigation link color. Use Hex values and leave out the leading #.",
				    "std" => "cccccc",
				    "type" => "text");
				    
$options[] = array(	"name" => "Navigation link rollover color",
				    "id" => $shortname."_nav_link_hover_color",
					"desc" => "Your navigation on rollover color. Use Hex values and leave out the leading #.",
				    "std" => "ffffff",
				    "type" => "text");
}

$options[] = array( "name" => "Custom CSS",
                    "desc" => "Quickly add some CSS to your theme by adding it to this block.",
                    "id" => $shortname."_custom_css",
                    "std" => "",
                    "type" => "textarea");
                    
// Navigation Options
$options[] = array(	"name" => "Navigation Settings",
					"type" => "heading");

$options[] = array( "name" => "Categories",
					"desc" => "Rename the Categories title in your navigation (optional)",
					"id" => $shortname."_category_title",
					"std" => "",
					"type" => "text");
					
$options[] = array( "name" => "Multi-level Menu",
					"desc" => "Check this on if want to show multi-level menu for categories.  By default, the navigation drop-down menus will show all items in one list.  Turning this on will create a hierarchy of your parent/child categories.",
					"id" => $shortname."_multilevel_categories",
					"std" => "false",
					"type" => "checkbox");

// category option			
$category_ids = get_all_category_ids();
foreach( $category_ids as $cat_id ) {
	$options[] = array(	"name" => get_cat_name($cat_id),
				"desc" => "Display in main site navigation",
				"id" => $shortname."_Navi_category_".$cat_id,
				"std" => "true",
				"type" => "checkbox");
}

$options[] = array( "name" => "Pages",
					"desc" => "Rename the Pages title in your navigation (optional)",
					"id" => $shortname."_pages_title",
					"std" => "",
					"type" => "text");
					
$options[] = array( "name" => "Multi-level Menu",
					"desc" => "Check this on if want to show multi-level menu for pages.  By default, the navigation drop-down menus will show all items in one list.  Turning this on will create a hierarchy of your parent/child pages.",
					"id" => $shortname."_multilevel_pages",
					"std" => "false",
					"type" => "checkbox");
					
// page option
$page_ids = get_all_page_ids();
foreach( $page_ids as $p_id ) {
	$pageOne = get_page($p_id);
	$options[] = array(	"name" => $pageOne->post_title,
				"desc" => "Display in main site navigation",
				"id" => $shortname."_Navi_Pages_".$p_id,
				"std" => "true",
				"type" => "checkbox");
}

$options[] = array(	"name" => "Contact Info",
					"desc" => "To show your contact information in the menu, check this option. If not, uncheck this option.",
			    	"id" => $shortname."_contact_info",
			    	"std" => "true",
			   		"type" => "checkbox");
			    		
$options[] = array(	"name" => "Email Address",
				    "id" => $shortname."_email",
					"desc" => "Your email address. Leave blank if you do not want to show your email.",
				    "std" => "you@email.com",
				    "type" => "text");
        
$options[] = array(	"name" => "Phone Number",
				    "id" => $shortname."_phone",
					"desc" => "Your phone number. Leave blank if you do not want to show your phone number.",
				    "std" => "1-800-867-5309",
				    "type" => "text");
				    
$options[] = array(	"name" => "PhotoShelter Navigation",
					"desc" => "Check this if you want to <em>automatically</em> integrate your <a href=\"http://pa.photoshelter.com/mkt/gpp/\">PhotoShelter</a> navigation links.<br /><br /><strong>Note:</strong> Enabling this option will add six non-customizable navigational links to your site navigation pointing to your PhotoShelter pages.  If you want to customize the links and link titles, simply disable this option and create custom navigation links below.",
					"id" => $shortname."_photoshelter",
					"std" => $photoshelter,
					"type" => "checkbox");

$options[] = array(	"name" => "PhotoShelter Name",
					"desc" => "Enter your PhotoShelter name here.  Example:  http://pa.photoshelter.com/c/thadallender.  thadallender is my name.",
					"id" => $shortname."_photoshelter_name",
					"std" => "",
					"type" => "text");

$options[] = array(	"name" => "Custom Links",
					"desc" => "Check this option to replace the Search form in the main navigation with a series of links of your choosing.  You can provide the title of the link and where it links to below.  If you want both, you will need to add a Search widget to either the Sidebar or Bottombar widgetized areas of your theme.  You can do this by visiting Appearance - Widgets in your Wordpress admin panel.",
		    		"id" => $shortname."_link_addition",
		    		"std" => "false",
		    		"type" => "checkbox");

$options[] = array(	"name" => "Top link title",
				    "id" => $shortname."_link_title",
					"desc" => "",
				    "std" => "Hosting",
				    "type" => "text");

$options[] = array(	"name" => "Top link URL",
				    "id" => $shortname."_link_URL",
					"desc" => "",
				    "std" => "http://visualsociety.com",
				    "type" => "text");
				    
$options[] = array(	"name" => "Drop-down link title 2",
				    "id" => $shortname."_link_title_2",
					"desc" => "",
				    "std" => "Themes",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 2",
				    "id" => $shortname."_link_URL_2",
					"desc" => "",
				    "std" => "http://graphpaperpress.com",
				    "type" => "text");
				    
$options[] = array(	"name" => "Drop-down link title 3",
				    "id" => $shortname."_link_title_3",
					"desc" => "",
				    "std" => "Wordpress",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 3",
				    "id" => $shortname."_link_URL_3",
					"desc" => "",
				    "std" => "http://wordpress.org",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link title 4",
				    "id" => $shortname."_link_title_4",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 4",
				    "id" => $shortname."_link_URL_4",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link title 5",
				    "id" => $shortname."_link_title_5",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 5",
				    "id" => $shortname."_link_URL_5",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link title 6",
				    "id" => $shortname."_link_title_6",
					"desc" => " ",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 6",
				    "id" => $shortname."_link_URL_6",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link title 7",
				    "id" => $shortname."_link_title_7",
					"desc" => "",
				    "std" => "",
				    "type" => "text");

$options[] = array(	"name" => "Drop-down link URL 7",
				    "id" => $shortname."_link_URL_7",
					"desc" => "",
				    "std" => "",
				    "type" => "text");


$options[] = array(	"name" => "Welcome Message",
					"type" => "heading");	
					
$options[] = array(	"name" => "Enable welcome message",
					"desc" => "Check this to show a welcome message to your site visitors.  If enabled, the welcome message will appear just below your logo and navigation on the front page only.",
					"id" => $shortname."_welcome",
					"std" => $welcome,
					"type" => "checkbox");
					
$options[] = array(	"name" => "Welcome message title",
					"desc" => "Enter the title of your welcome message.",
					"id" => $shortname."_welcome_title",
					"std" => "Howdy folks!",
					"type" => "text");
					
$options[] = array(	"name" => "Welcome message",
					"desc" => "Enter your welcome message.  Some HTML is okay, including <code>&#60;b&#62;</code>, and <code>&#60;i&#62;</code> tags.",
					"id" => $shortname."_welcome_content",
					"std" => "You are seeing this message because you have not configured your <a href=\"/wp-admin/admin.php?page=gppthemes\">theme options</a> yet.  You can add or remove this message, and a variety of other design options for your homepage, by visiting the admin section of your new site and clicking <a href=\"/wp-admin/admin.php?page=gppthemes\">theme options</a> in the left sidebar.  You can control virtually every aspect of the homepage design on the <a href=\"/wp-admin/admin.php?page=gppthemes\">theme options</a> page.",
					"type" => "textarea");
					
$options[] = array(	"name" => "Slideshow",
					"type" => "heading");
					
$options[] = array(	"name" => "Slideshow On/Off",
					"desc" => "Check this to show the slideshow on the homepage.",
					"id" => $shortname."_slideshow",
					"std" => $gppslideshow,
					"type" => "checkbox");
					
$options[] = array( "name" => "Slideshow image 1",
					"desc" => "Upload your first slideshow.  Images should be sized at 950 pixels wide max, jpg only, compressed to 6, in sRGB mode.",
					"id" => $shortname."_slideshow_image_1",
					"std" => "",
					"type" => "upload");

$options[] = array( "name" => "Slideshow image 2",
					"desc" => "Upload your second slideshow.  Images should be sized at 950 pixels wide max, jpg only, compressed to 6, in sRGB mode.",
					"id" => $shortname."_slideshow_image_2",
					"std" => "",
					"type" => "upload");

$options[] = array( "name" => "Slideshow image 3",
					"desc" => "Upload your third slideshow.  Images should be sized at 950 pixels wide max, jpg only, compressed to 6, in sRGB mode.",
					"id" => $shortname."_slideshow_image_3",
					"std" => "",
					"type" => "upload");
					
$options[] = array( "name" => "Slideshow image 4",
					"desc" => "Upload your fourth slideshow.  Images should be sized at 950 pixels wide max, jpg only, compressed to 6, in sRGB mode.",
					"id" => $shortname."_slideshow_image_4",
					"std" => "",
					"type" => "upload");
					
$options[] = array( "name" => "Slideshow image 5",
					"desc" => "Upload your fifth slideshow.  Images should be sized at 950 pixels wide max, jpg only, compressed to 6, in sRGB mode.",
					"id" => $shortname."_slideshow_image_5",
					"std" => "",
					"type" => "upload");

$options[] = array(	"name" => "Slideshow height",
					"desc" => "Enter the height, in pixels, that you want your slideshow to be.",
					"id" => $shortname."_slideshow_height",
					"std" => "425",
					"type" => "text");
					
$options[] = array(	"name" => "Slideshow time",
					"desc" => "The length of time the image stays on the page. Numbers in milliseconds. e.g. 1000 = 1 second.",
					"id" => $shortname."_slideshow_time",
					"std" => "3500",
					"type" => "text");
					
$options[] = array(	"name" => "Slideshow speed",
					"desc" => "How fast / slow the slides changes from image to image. Numbers in milliseconds. e.g. 1000 = 1 second.",
					"id" => $shortname."_slideshow_speed",
					"std" => "1000",
					"type" => "text");
					
$options[] = array(	"name" => "Video",
					"type" => "heading");
					
$options[] = array(	"name" => "iPhone video",
					"desc" => "Check this to enable the capability to display iPhone ready videos to your homepage and individual posts.  You can add iPhone ready versions of your videos to posts by creating a custom field called <em>iphone</em> and pasting the full path to your MP4 video file.  For information on creating mobile versions of your videos for the iPhone, please <a href\"http://homepage.mac.com/qt4web/compressforiphone.html\">read this post</a>.",
					"id" => $shortname."_iphone",
					"std" => "false",
					"type" => "checkbox");
					
$options[] = array(	"name" => "Video On/Off",
					"desc" => "Check this to show a full page video on the homepage.",
					"id" => $shortname."_video",
					"std" => "false",
					"type" => "checkbox");
					
$options[] = array( "name" => "Video file",
					"desc" => "Paste the URL to your FLV video file here after uploading it via the Wordpress Add New Media feature.  For best resolution, please export your videos at a minimum width of 950 pixels wide.",
					"id" => $shortname."_video_file",
					"std" => "",
					"type" => "text");
					
$options[] = array( "name" => "iPhone video file",
					"desc" => "Paste the URL to your mobile MP4 video file here after uploading it via the Wordpress Add New Media feature.  This video file will be loaded for your iPhone visitors if you have homepage video enabled.  For information on creating mobile versions of your videos for the iPhone, please <a href\"http://homepage.mac.com/qt4web/compressforiphone.html\">read this post</a>.",
					"id" => $shortname."_iphone_file",
					"std" => "",
					"type" => "text");
					
$options[] = array( "name" => "Video thumbnail",
					"desc" => "Upload your video thumbnail.  Please upload jpgs only, sized at 950 pixels wide, compressed to 6, in sRGB mode.",
					"id" => $shortname."_video_thumbnail",
					"std" => "",
					"type" => "upload");
					
$options[] = array( "name" => "Video width",
					"desc" => "The width of your video in pixels.  For a full-page video, insert 950.",
					"id" => $shortname."_video_width",
					"std" => "950",
					"type" => "text");
					
$options[] = array( "name" => "Video height",
					"desc" => "The height of your video in pixels. For 16x9 format, insert 534.",
					"id" => $shortname."_video_height",
					"std" => "534",
					"type" => "text");
					
$options[] = array(	"name" => "Thumbnail Slider",
					"type" => "heading");
					
$options[] = array(	"name" => "Turn on",
					"desc" => "Check this to show a thumbnail slider on the homepage.",
					"id" => $shortname."_slider",
					"std" => $thumbslider,
					"type" => "checkbox");
					
$options[] = array( "name" => "Slider Category" ,
					"desc" => "",
					"id" => $shortname."_slider_cat",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array(	"name" => "Post Slider",
					"type" => "heading");
					
$options[] = array(	"name" => "Turn on",
					"desc" => "Check this to show a featured post slider on the homepage.",
					"id" => $shortname."_slider_posts",
					"std" => $postslider,
					"type" => "checkbox");
					
$options[] = array( "name" => "Post slider Category" ,
					"desc" => "",
					"id" => $shortname."_slider_posts_cat",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array(	"name" => "Featured Posts",
					"type" => "heading");
					
$options[] = array(	"name" => "Turn on",
					"desc" => "Check this to show featured posts on the homepage.",
					"id" => $shortname."_featured",
					"std" => $featured,
					"type" => "checkbox");
					
$options[] = array( "name" => "Feature Posts Category" ,
					"desc" => "",
					"id" => $shortname."_featured_cat",
					"std" => "uncategorized",
					"type" => "select",
					"options" => $categories);
					
if($themename == "Modfolio" || $themename == "F8-Remixed" || $themename == "F8") {
//for child theme options
$childoptions = apply_filters('childtheme_options', $childoptions);
$options = wp_parse_args( $childoptions, $options); 
}
					
$options[] = array(	"name" => "Blog",
					"type" => "heading");
					
$options[] = array(	"name" => "Turn on",
					"desc" => "Check this to show a basic tabular blog on the homepage.",
					"id" => $shortname."_blog",
					"std" => "false",
					"type" => "checkbox");
					
$options[] = array( "name" => "Blog Category" ,
					"desc" => "",
					"id" => $shortname."_blog_cat",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array(	"name" => "Number of posts",
					"desc" => "Select the number of blog posts you want to show on the homepage.",
					"id" => $shortname."_blog_number",
					"std" => "10",
					"type" => "select",
					"options" => $other_entries);
					
$options[] = array(	"name" => "Category Columns",
					"type" => "heading");
					
$options[] = array(	"name" => "Turn on",
					"desc" => "Check this to show a column of category posts on the homepage.",
					"id" => $shortname."_category_columns",
					"std" => $category_columns,
					"type" => "checkbox");
					
$options[] = array( "name" => "First Category" ,
					"desc" => "",
					"id" => $shortname."_category_column_1",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array( "name" => "Second Category" ,
					"desc" => "",
					"id" => $shortname."_category_column_2",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array( "name" => "Third Category" ,
					"desc" => "",
					"id" => $shortname."_category_column_3",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array( "name" => "Fourth Category" ,
					"desc" => "",
					"id" => $shortname."_category_column_4",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
$options[] = array( "name" => "Fifth Category" ,
					"desc" => "",
					"id" => $shortname."_category_column_5",
					"std" => "",
					"type" => "select",
					"options" => $categories);
					
if($themename == "Work-a-holic") {
	//for child theme options
	$childoptions = apply_filters('wpro2_options', $childoptions);
	$options = wp_parse_args( $childoptions, $options);
}
					
if($themename == "Work-a-holic") {
	//for child theme options
	$childoptions = apply_filters('wpro_options', $childoptions);
	$options = wp_parse_args( $childoptions, $options);
} else {
$options[] = array(	"name" => "About You",
					"type" => "heading");	

$options[] = array(	"name" => "About You Snippet",
					"desc" => "Include a little snippet about yourself that is displayed in the header.",
					"id" => $shortname."_about",
					"std" => "Add a little information about yourself here.  It will appear in the footer of your site.",
					"type" => "textarea");	

$options[] = array(	"name" => "About You Read More Link",
					"desc" => "URL of the read more link e.g. http://www.yoursite.com/about",
					"id" => $shortname."_aboutlink",
					"std" => "http://visualsociety.com",
					"type" => "text");
}					
$options[] = array(	"name" => "Advertising",
					"type" => "heading");	

$options[] = array(	"name" => "Main ad code",
					"desc" => "Insert an advertisement beneath the first post on the homepage and archive pages.",
					"id" => $shortname."_main_ad_code",
					"std" => "",
					"type" => "textarea");
					
$options[] = array(	"name" => "Sidebar ad code",
					"desc" => "Insert advertisements in the sidebar of your site.  The sidebar measures 310 pixels wide.",
					"id" => $shortname."_sidebar_ad_code",
					"std" => "",
					"type" => "textarea");	
                                  



update_option('gpp_template',$options);      
update_option('gpp_themename',$themename);   
update_option('gpp_shortname',$shortname);
update_option('gpp_instructions',$instructionsurl);
update_option('gpp_manual',$manualurl);
update_option('gpp_videos',$videosurl);
update_option('gpp_support',$supporturl);
   

/*
function gpp_update_options(){
        $options = get_option('gpp_template',$options);  
        foreach ($options as $option){
            update_option($option['id'],$option['std']);
        }   
}

function gpp_add_options(){
        $options = get_option('gpp_template',$options);  
        foreach ($options as $option){
            update_option($option['id'],$option['std']);
        }   
}


//add_action('switch_theme', 'gpp_update_options'); 
if(get_option('template') == 'gppframework'){       
    gpp_add_options();
} // end function 
*/


}

add_action('init','gpp_options');  

?>