Wordpress options in admin panel
<?php
function RicklieStone_add_theme_page()
{
// if variables are empty we call the function RicklieStone_init to set the default values
if ($_GET['page'] == basename(__FILE__)) {
//if the form was submited we saved the changes
if ( 'save' == $_REQUEST['action'] )
{
//------Logo
if(!empty($_FILES['file_logo']['name']))
{
$target_path = TEMPLATEPATH.UploadFolder;
$info = pathinfo($_FILES['file_logo']['name']);
$target_path = $target_path . basename('logo.'.$info['extension']);
if(move_uploaded_file($_FILES['file_logo']['tmp_name'], $target_path)){
update_option('file_logo', 'logo.'.$info['extension']);
}
}
if(!empty($_FILES['file_body']['name']))
{
//------Body
$target_path = TEMPLATEPATH.UploadFolder;
$info = pathinfo($_FILES['file_body']['name']);
$target_path = $target_path . basename('body-backround.'.$info['extension']);
if(move_uploaded_file($_FILES['file_body']['tmp_name'], $target_path)){
update_option('file_body', 'body-backround.'.$info['extension']);
}
}
if(!empty($_FILES['file_main']['name']))
{
//------Main
$target_path = TEMPLATEPATH.UploadFolder;
$info = pathinfo($_FILES['file_main']['name']);
$target_path = $target_path . basename('main-backround.'.$info['extension']);
if(move_uploaded_file($_FILES['file_main']['tmp_name'], $target_path)){
update_option('file_main', 'main-backround.'.$info['extension']);
}
}
if(!empty($_FILES['file_slideshow']['name']))
{
//------Slideshow
$target_path = TEMPLATEPATH.UploadFolder;
$info = pathinfo($_FILES['file_slideshow']['name']);
$target_path = $target_path . basename('slideshow-backround.'.$info['extension']);
if(move_uploaded_file($_FILES['file_slideshow']['tmp_name'], $target_path)){
update_option('file_slideshow', 'slideshow-backround.'.$info['extension']);
}
}
if(!empty($_FILES['file_footer']['name']))
{
//------Footer
$target_path = TEMPLATEPATH.UploadFolder;
$info = pathinfo($_FILES['file_footer']['name']);
$target_path = $target_path . basename('footer-backround.'.$info['extension']);
if(move_uploaded_file($_FILES['file_footer']['tmp_name'], $target_path)){
update_option('file_footer', 'footer-backround.'.$info['extension']);
}
}
//------Slideshow Autoplay
if(isset($_REQUEST['check_autoplay']))
{update_option('check_autoplay', stripcslashes($_REQUEST['check_autoplay']));}
else
{update_option('check_autoplay', 'on');}
//-------Slideshow switchtime
if(isset($_REQUEST['switchtime']))
{update_option('switchtime', stripcslashes($_REQUEST['switchtime']));}
else
{update_option('switchtime', '5000');}
//-------Body Fonts
if(isset($_REQUEST['body_font']))
{update_option('body_font', stripcslashes($_REQUEST['body_font']));}
else
{update_option('body_font', 'Arial, Georgia, Trebuchet MS, Tahoma, Verdana');}
//-------Nav Fonts
if(isset($_REQUEST['nav_font']))
{update_option('nav_font', stripcslashes($_REQUEST['nav_font']));}
else
{update_option('nav_font', 'Arial, Georgia, Trebuchet MS, Tahoma, Verdana');}
//-------Heading Fonts
if(isset($_REQUEST['headings_font_h1']))
{update_option('headings_font_h1', stripcslashes($_REQUEST['headings_font_h1']));}
else
{update_option('headings_font_h1', '');}
if(isset($_REQUEST['headings_font_h2']))
{update_option('headings_font_h2', stripcslashes($_REQUEST['headings_font_h2']));}
else
{update_option('headings_font_h2', '');}
if(isset($_REQUEST['headings_font_h3']))
{update_option('headings_font_h3', stripcslashes($_REQUEST['headings_font_h3']));}
else
{update_option('headings_font_h3', '');}
if(isset($_REQUEST['headings_font_h4']))
{update_option('headings_font_h4', stripcslashes($_REQUEST['headings_font_h4']));}
else
{update_option('headings_font_h4', '');}
if(isset($_REQUEST['headings_font_h5']))
{update_option('headings_font_h5', stripcslashes($_REQUEST['headings_font_h5']));}
else
{update_option('headings_font_h5', '');}
//-------Colors
if(isset($_REQUEST['body_color']))
{update_option('body_color', stripcslashes($_REQUEST['body_color']));}
else
{update_option('body_color', '#737373');}
if(isset($_REQUEST['links_color'])){ update_option('links_color', stripcslashes($_REQUEST['links_color'])); }
if(isset($_REQUEST['hover_color'])){update_option('hover_color', stripcslashes($_REQUEST['hover_color']));}
if(isset($_REQUEST['title_color_h1'])){update_option('title_color_h1', stripcslashes($_REQUEST['title_color_h1']));}
if(isset($_REQUEST['title_color_h2'])){update_option('title_color_h2', stripcslashes($_REQUEST['title_color_h2']));}
if(isset($_REQUEST['title_color_heading_h3'])){update_option('title_color_heading_h3', stripcslashes($_REQUEST['title_color_heading_h3']));}
if(isset($_REQUEST['title_color_home_h3'])){update_option('title_color_home_h3', stripcslashes($_REQUEST['title_color_home_h3']));}
if(isset($_REQUEST['title_color_whatwe_h3'])){update_option('title_color_whatwe_h3', stripcslashes($_REQUEST['title_color_whatwe_h3']));}
if(isset($_REQUEST['title_color_underwhatwe_h3'])){update_option('title_color_underwhatwe_h3', stripcslashes($_REQUEST['title_color_underwhatwe_h3']));}
if(isset($_REQUEST['title_color_bottom_h3'])){update_option('title_color_bottom_h3', stripcslashes($_REQUEST['title_color_bottom_h3']));}
if(isset($_REQUEST['title_color_sctitle_h3'])){update_option('title_color_sctitle_h3', stripcslashes($_REQUEST['title_color_sctitle_h3']));}
if(isset($_REQUEST['title_color_scptitle_h3'])){update_option('title_color_scptitle_h3', stripcslashes($_REQUEST['title_color_scptitle_h3']));}
if(isset($_REQUEST['title_color_sidebar_h3'])){update_option('title_color_sidebar_h3', stripcslashes($_REQUEST['title_color_sidebar_h3']));}
if(isset($_REQUEST['title_color_comments_h3'])){update_option('title_color_comments_h3', stripcslashes($_REQUEST['title_color_comments_h3']));}
if(isset($_REQUEST['title_color_underpost_h3'])){update_option('title_color_underpost_h3', stripcslashes($_REQUEST['title_color_underpost_h3']));}
if(isset($_REQUEST['title_color_tabs_h3'])){update_option('title_color_tabs_h3', stripcslashes($_REQUEST['title_color_tabs_h3']));}
if(isset($_REQUEST['title_color_subtitles_h4'])){update_option('title_color_subtitles_h4', stripcslashes($_REQUEST['title_color_subtitles_h4']));}
if(isset($_REQUEST['title_color_services_h4'])){update_option('title_color_services_h4', stripcslashes($_REQUEST['title_color_services_h4']));}
if(isset($_REQUEST['title_color_footer_h4'])){update_option('title_color_footer_h4', stripcslashes($_REQUEST['title_color_footer_h4']));}
if(isset($_REQUEST['title_color_h5'])){update_option('title_color_h5', stripcslashes($_REQUEST['title_color_h5']));}
if(isset($_REQUEST['slideshow_color'])){update_option('slideshow_color', stripcslashes($_REQUEST['slideshow_color']));}
if(isset($_REQUEST['main_color'])){update_option('main_color', stripcslashes($_REQUEST['main_color']));}
if(isset($_REQUEST['bottom_color'])){update_option('bottom_color', stripcslashes($_REQUEST['bottom_color']));}
if(isset($_REQUEST['bottom_titles_color'])){update_option('bottom_titles_color', stripcslashes($_REQUEST['bottom_titles_color']));}
if(isset($_REQUEST['bottom_text_color'])){update_option('bottom_text_color', stripcslashes($_REQUEST['bottom_text_color']));}
if(isset($_REQUEST['bottom_link_color'])){update_option('bottom_link_color', stripcslashes($_REQUEST['bottom_link_color']));}
if(isset($_REQUEST['bottom_hover_color'])){update_option('bottom_hover_color', stripcslashes($_REQUEST['bottom_hover_color']));}
//-------Body Size
if(isset($_REQUEST['body_size']))
{update_option('body_size', stripcslashes($_REQUEST['body_size']));}
else
{update_option('body_size', '12px');}
//-------Nav Size
if(isset($_REQUEST['nav_size']))
{update_option('nav_size', stripcslashes($_REQUEST['nav_size']));}
else
{update_option('nav_size', '14px');}
//-------Title Headings
if(isset($_REQUEST['title_size_h1']))
{update_option('title_size_h1', stripcslashes($_REQUEST['title_size_h1']));}
if(isset($_REQUEST['title_size_h2']))
{update_option('title_size_h2', stripcslashes($_REQUEST['title_size_h2']));}
if(isset($_REQUEST['title_size_heading_h3']))
{update_option('title_size_heading_h3', stripcslashes($_REQUEST['title_size_heading_h3']));}
if(isset($_REQUEST['title_size_home_h3']))
{update_option('title_size_home_h3', stripcslashes($_REQUEST['title_size_home_h3']));}
if(isset($_REQUEST['title_size_whatwe_h3']))
{update_option('title_size_whatwe_h3', stripcslashes($_REQUEST['title_size_whatwe_h3']));}
if(isset($_REQUEST['title_size_bottom_h3']))
{update_option('title_size_bottom_h3', stripcslashes($_REQUEST['title_size_bottom_h3']));}
if(isset($_REQUEST['title_size_underwhatwe_h3']))
{update_option('title_size_underwhatwe_h3', stripcslashes($_REQUEST['title_size_underwhatwe_h3']));}
if(isset($_REQUEST['title_size_sctitle_h3']))
{update_option('title_size_sctitle_h3', stripcslashes($_REQUEST['title_size_sctitle_h3']));}
if(isset($_REQUEST['title_size_scptitle_h3']))
{update_option('title_size_scptitle_h3', stripcslashes($_REQUEST['title_size_scptitle_h3']));}
if(isset($_REQUEST['title_size_sidebar_h3']))
{update_option('title_size_sidebar_h3', stripcslashes($_REQUEST['title_size_sidebar_h3']));}
if(isset($_REQUEST['title_size_sidebar_h3']))
{update_option('title_size_comments_h3', stripcslashes($_REQUEST['title_size_comments_h3']));}
if(isset($_REQUEST['title_size_tabs_h3']))
{update_option('title_size_tabs_h3', stripcslashes($_REQUEST['title_size_tabs_h3']));}
if(isset($_REQUEST['title_size_underpost_h3']))
{update_option('title_size_underpost_h3', stripcslashes($_REQUEST['title_size_underpost_h3']));}
if(isset($_REQUEST['title_size_subtitles_h4']))
{update_option('title_size_subtitles_h4', stripcslashes($_REQUEST['title_size_subtitles_h4']));}
if(isset($_REQUEST['title_size_services_h4']))
{update_option('title_size_services_h4', stripcslashes($_REQUEST['title_size_services_h4']));}
if(isset($_REQUEST['title_size_footer_h4']))
{update_option('title_size_footer_h4', stripcslashes($_REQUEST['title_size_footer_h4']));}
if(isset($_REQUEST['title_size_h5']))
{update_option('title_size_h5', stripcslashes($_REQUEST['title_size_h5']));}
//------Blog check
if(isset($_REQUEST['check_postdate']))
{update_option('check_postdate', stripcslashes($_REQUEST['check_postdate']));}
else
{update_option('check_postdate', 'on');}
if(isset($_REQUEST['check_postauthor']))
{update_option('check_postauthor', stripcslashes($_REQUEST['check_postauthor']));}
else
{update_option('check_postauthor', 'on');}
if(isset($_REQUEST['check_posttags']))
{update_option('check_posttags', stripcslashes($_REQUEST['check_posttags']));}
else
{update_option('check_posttags', 'on');}
if(isset($_REQUEST['check_postcategory']))
{update_option('check_postcategory', stripcslashes($_REQUEST['check_postcategory']));}
else
{update_option('check_postcategory', 'on');}
if(isset($_REQUEST['check_postcomments']))
{update_option('check_postcomments', stripcslashes($_REQUEST['check_postcomments']));}
else
{update_option('check_postcomments', 'on');}
if(isset($_REQUEST['check_gallerycat']))
{update_option('check_gallerycat', stripcslashes($_REQUEST['check_gallerycat']));}
else
{update_option('check_gallerycat', 'on');}
if(isset($_REQUEST['copyright_t']))
{update_option('copyright_t', stripcslashes($_REQUEST['copyright_t']));}
else
{update_option('copyright_t', '');}
if(isset($_REQUEST['google_analitics']))
{update_option('google_analitics', stripcslashes($_REQUEST['google_analitics']));}
else
{update_option('google_analitics', '');}
header("Location: themes.php?page=functions.php&saved=true");die;
}
// Addd the header (css + script) to the control panel
add_action('admin_head', 'RicklieStone_theme_page_head');}
//add_menu_page(page_title, menu_title, access_level/capability,file,[function]);
add_theme_page('RicklieStone Theme Options', 'Theme Options', 'edit_themes', basename(__FILE__), 'RicklieStone_theme_page');
}
function RicklieStone_theme_page()
{
if ( $_REQUEST['saved'] )
{
echo '<div id="message" class="updated fade"><p><strong>Options Saved</strong></p></div>';
} ?>
<style type="text/css">
.optiontable .option-row{
margin:15px 0 25px 0;
}
.optiontable .option-row label{
display:block;
font-weight:bold;
margin:0 0 5px 0;
}
.option-row-fonts,
.option-row-colors,
.option-row-sizes,
.option-row-images,
.option-row-pages,
.option-row-gallery
{
float:left;
width:32%;
}
.option-row-clear{
clear:both;
width: 100%;
}
.optiontable {overflow:hidden;}
</style>
<div class="wrap">
<div id="RicklieStone">
<h2> Theme Options</h2>
<form method="post" action="<?php $_SERVER['REQUEST_URI']; ?>" enctype="multipart/form-data">
<input type="hidden" name="action" value="save" />
<p class="submit">
<input type="submit" name="Save" value="Save" />
</p>
<div class="optiontable">
<div class="option-row-images">
<h3>General: </h3>
<div class="option-row">
<label>Upload Logo:</label>
<div class="option-holder">
<?php
$current_option1 = get_option('file_logo');
?>
<input type="file" name="file_logo" />
<?php
if(!empty($current_option1) && file_exists(TEMPLATEPATH.UploadFolder.$current_option1)){ ?>
<img src="<?php echo get_bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_bloginfo('template_url').UploadFolder.$current_option1; ?>&w=200&h=50&zc=2" alt="image description"/>
<?php } ?>
</div>
</div>
<div class="option-row">
<label>Upload Body Background:</label>
<div class="option-holder">
<?php $current_option2 = get_option('file_body'); ?>
<input type="file" name="file_body" />
<?php
if(!empty($current_option2) && file_exists(TEMPLATEPATH.UploadFolder.$current_option2)){ ?>
<img src="<?php echo get_bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_bloginfo('template_url').UploadFolder.$current_option2; ?>&w=200&h=50&zc=2" alt="file_body" />
<?php } ?>
</div>
</div>
<div class="option-row">
<label>Upload Main Background:</label>
<div class="option-holder">
<?php $current_option3 = get_option('file_main'); ?>
<input type="file" name="file_main" />
<?php
if(!empty($current_option3) && file_exists(TEMPLATEPATH.UploadFolder.$current_option3)){ ?>
<img src="<?php echo get_bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_bloginfo('template_url').UploadFolder.$current_option3; ?>&w=200&h=50&zc=2" alt="file_main" />
<?php } ?>
</div>
</div>
<div class="option-row">
<label>Upload Slideshow Background:</label>
<div class="option-holder">
<?php $current_option4 = get_option('file_slideshow'); ?>
<input type="file" name="file_slideshow" onClick="browse.click();file.value=browse.value;" value="Select a File..." />
<?php
if(!empty($current_option4) && file_exists(TEMPLATEPATH.UploadFolder.$current_option4)){ ?>
<img src="<?php echo get_bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_bloginfo('template_url').UploadFolder.$current_option4; ?>&w=200&h=50&zc=2" alt="file_slideshow" />
<?php } ?>
</div>
</div>
<div class="option-row">
<label>Upload Footer Background:</label>
<div class="option-holder">
<?php $current_option5 = get_option('file_footer'); ?>
<input type="file" name="file_footer" />
<?php
if(!empty($current_option5) && file_exists(TEMPLATEPATH.UploadFolder.$current_option5)){ ?>
<img src="<?php echo get_bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_bloginfo('template_url').UploadFolder.$current_option5; ?>&w=200&h=50&zc=2" alt="file_footer" />
<?php } ?>
</div>
</div>
<div class="option-row">
<label>Slideshow Autoplay (on/off):</label>
<div class="option-holder">
<?php
$current_option6 = get_option('check_autoplay');
if(isset($current_option6)):
if($current_option6 == 'on') :
?>
<input type="radio" checked="checked" name="check_autoplay" value="on">ON
<input type="radio" name="check_autoplay" value="off">OFF
<?php else: ?>
<input type="radio" name="check_autoplay" value="on">ON
<input type="radio" checked="checked" name="check_autoplay" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" name="check_autoplay" value="on">ON
<input type="radio" name="check_autoplay" value="off">OFF
<?php endif; ?>
</div>
</div>
<div class="option-row">
<label> Slideshow Switch Time:</label>
<div class="option-holder">
<?php $current_option7 = get_option('switchtime'); ?>
<input type="text" name="switchtime" value="<?php echo $current_option7; ?>" />
</div>
</div>
</div>
<div class="option-row-pages">
<h3>Blog: </h3>
<div class="option-row">
<label>Show Post Date (on/off):</label>
<div class="option-holder">
<?php
$current_option60 = get_option('check_postdate');
if(isset($current_option60)):
if($current_option60 == 'on') :
?>
<input type="radio" checked="checked" name="check_postdate" value="on">ON
<input type="radio" name="check_postdate" value="off">OFF
<?php else: ?>
<input type="radio" name="check_postdate" value="on">ON
<input type="radio" checked="checked" name="check_postdate" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" name="check_postdate" value="on">ON
<input type="radio" name="check_postdate" value="off">OFF
<?php endif; ?>
</div>
<div class="option-row">
<label>Show Post Author (on/off):</label>
<div class="option-holder">
<?php
$current_option61 = get_option('check_postauthor');
if(isset($current_option61)):
if($current_option61 == 'on') :
?>
<input type="radio" checked="checked" name="check_postauthor" value="on">ON
<input type="radio" name="check_postauthor" value="off">OFF
<?php else: ?>
<input type="radio" name="check_postauthor" value="on">ON
<input type="radio" checked="checked" name="check_postauthor" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" name="check_postauthor" value="on">ON
<input type="radio" name="check_postauthor" value="off">OFF
<?php endif; ?>
</div>
</div>
<div class="option-row">
<label>Show Post tags (on/off):</label>
<div class="option-holder">
<?php
$current_option62 = get_option('check_posttags');
if(isset($current_option62)):
if($current_option62 == 'on') :
?>
<input type="radio" checked="checked" name="check_posttags" value="on">ON
<input type="radio" name="check_posttags" value="off">OFF
<?php else: ?>
<input type="radio" name="check_posttags" value="on">ON
<input type="radio" checked="checked" name="check_posttags" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" checked="checked" name="check_posttags" value="on">ON
<input type="radio" name="check_posttags" value="off">OFF
<?php endif; ?>
</div>
</div>
<div class="option-row">
<label>Show Category (on/off):</label>
<div class="option-holder">
<?php
$current_option63 = get_option('check_postcategory');
if(isset($current_option63)):
if($current_option63 == 'on') :
?>
<input type="radio" checked="checked" name="check_postcategory" value="on">ON
<input type="radio" name="check_postcategory" value="off">OFF
<?php else: ?>
<input type="radio" name="check_postcategory" value="on">ON
<input type="radio" checked="checked" name="check_postcategory" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" checked="checked" name="check_postcategory" value="on">ON
<input type="radio" name="check_postcategory" value="off">OFF
<?php endif; ?>
</div>
</div>
<div class="option-row">
<label>Show Comments (on/off):</label>
<div class="option-holder">
<?php
$current_option64 = get_option('check_postcomments');
if(isset($current_option64)):
if($current_option64 == 'on') :
?>
<input type="radio" checked="checked" name="check_postcomments" value="on">ON
<input type="radio" name="check_postcomments" value="off">OFF
<?php else: ?>
<input type="radio" name="check_postcomments" value="on">ON
<input type="radio" checked="checked" name="check_postcomments" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" checked="checked" name="check_postcomments" value="on">ON
<input type="radio" name="check_postcomments" value="off">OFF
<?php endif; ?>
</div>
</div>
</div>
<div class="option-row-other">
<h3>Gallery: </h3>
<label>Show Category (on/off):</label>
<div class="option-holder">
<?php
$current_option65 = get_option('check_gallerycat');
if(isset($current_option65)):
if($current_option65 == 'on') :
?>
<input type="radio" checked="checked" name="check_gallerycat" value="on">ON
<input type="radio" name="check_gallerycat" value="off">OFF
<?php else: ?>
<input type="radio" name="check_gallerycat" value="on">ON
<input type="radio" checked="checked" name="check_gallerycat" value="off">OFF
<?php endif; ?>
<?php else: ?>
<input type="radio" checked="checked" name="check_gallerycat" value="on">ON
<input type="radio" name="check_gallerycat" value="off">OFF
<?php endif; ?>
</div>
</div>
</div>
<div class="option-row-gallery">
<h3>Footer: </h3>
<label>Copyright Message:</label>
<div class="option-holder">
<?php
$current_option66 = get_option('copyright_t');
?>
<textarea rows="10" cols="45" name="copyright_t"><?php echo $current_option66; ?></textarea>
</div>
<h3>Statistics: </h3>
<label>A text area for pasting the Google Analytics:</label>
<div class="option-holder">
<?php
$current_option67 = get_option('google_analitics');
?>
<textarea rows="10" cols="45" name="google_analitics"><?php echo $current_option67; ?></textarea>
</div>
</div>
<div class="option-row-clear"> </div>
<div class="option-row-fonts">
<h3>Fonts:</h3>
<div class="option-row">
<label> Body Font:</label>
<div class="option-holder">
<?php $current_option8 = get_option('body_font'); ?>
<select name="body_font">
<option <?php if($current_option8 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option8 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option8 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option8 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option8 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Top Navigation Font:</label>
<div class="option-holder">
<?php $current_option28 = get_option('nav_font'); ?>
<select name="nav_font">
<option <?php if($current_option28 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option28 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option28 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option28 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option28 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Title Headings (h1) Font:</label>
<div class="option-holder">
<?php $current_option29 = get_option('headings_font_h1'); ?>
<select name="headings_font_h1">
<option <?php if($current_option29 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option29 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option29 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option29 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option29 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Title Headings (h2) Font:</label>
<div class="option-holder">
<?php $current_option29 = get_option('headings_font_h2'); ?>
<select name="headings_font_h2">
<option <?php if($current_option29 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option29 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option29 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option29 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option29 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Title Headings (h3) Font:</label>
<div class="option-holder">
<?php $current_option29 = get_option('headings_font_h3'); ?>
<select name="headings_font_h3">
<option <?php if($current_option29 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option29 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option29 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option29 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option29 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Title Headings (h4) Font:</label>
<div class="option-holder">
<?php $current_option29 = get_option('headings_font_h4'); ?>
<select name="headings_font_h4">
<option <?php if($current_option29 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option29 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option29 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option29 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option29 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
<div class="option-row">
<label> Title Headings (h5) Font:</label>
<div class="option-holder">
<?php $current_option29 = get_option('headings_font_h5'); ?>
<select name="headings_font_h5">
<option <?php if($current_option29 == ''){echo 'selected="selected" ';} ?> value=""></option>
<option <?php if($current_option29 == 'Arial'){echo 'selected="selected" ';} ?> value="Arial">Arial</option>
<option <?php if($current_option29 == 'Georgia'){echo 'selected="selected" ';} ?> value="Georgia">Georgia</option>
<option <?php if($current_option29 == 'Trebuchet MS'){echo 'selected="selected" ';} ?> value="Trebuchet MS">Trebuchet MS</option>
<option <?php if($current_option29 == 'Verdana'){echo 'selected="selected" ';} ?> value="Verdana">Verdana</option>
</select>
</div>
</div>
</div>
<div class="option-row-colors">
<h3>Colors:</h3>
<div class="option-row">
<label> Body Text Color:</label>
<div class="option-holder">
<?php $current_option9 = get_option('body_color'); ?>
<div class="option-holder">
<input type="text" name="body_color" value="<?php echo $current_option9; ?>" />
</div>
</div>
<label>Body Links Color:</label>
<div class="option-holder">
<?php $current_option30 = get_option('links_color'); ?>
<div class="option-holder">
<input type="text" name="links_color" value="<?php echo $current_option30; ?>" />
</div>
</div>
<label>Body Links Hover Color:</label>
<div class="option-holder">
<?php $current_option31 = get_option('hover_color'); ?>
<div class="option-holder">
<input type="text" name="hover_color" value="<?php echo $current_option31; ?>" />
</div>
</div>
<label> Headings Colors:</label>
<div class="option-holder">
<?php $current_option40 = get_option('title_color_h1'); ?>
<label>h1:</label>
<input type="text" name="title_color_h1" value="<?php echo $current_option40; ?>" />
</div>
<div class="option-holder">
<?php $current_option41 = get_option('title_color_h2'); ?>
<label>h2 (class .heading):</label>
<input type="text" name="title_color_h2" value="<?php echo $current_option41; ?>" />
</div>
<?php $current_option42 = get_option('title_color_heading_h3'); ?>
<?php $current_option43 = get_option('title_color_home_h3'); ?>
<?php $current_option44 = get_option('title_color_whatwe_h3'); ?>
<?php $current_option45 = get_option('title_color_underwhatwe_h3'); ?>
<?php $current_option46 = get_option('title_color_bottom_h3'); ?>
<?php $current_option47 = get_option('title_color_sctitle_h3'); ?>
<?php $current_option48 = get_option('title_color_scptitle_h3'); ?>
<?php $current_option49 = get_option('title_color_sidebar_h3'); ?>
<?php $current_option50 = get_option('title_color_comments_h3'); ?>
<?php $current_option53 = get_option('title_color_underpost_h3'); ?>
<?php $current_option51 = get_option('title_color_tabs_h3'); ?>
<?php $current_option54 = get_option('title_color_subtitles_h4'); ?>
<?php $current_option55 = get_option('title_color_services_h4'); ?>
<?php $current_option56 = get_option('title_color_footer_h4'); ?>
<?php $current_option57 = get_option('title_color_h5'); ?>
<div class="option-holder">
<label>Sudtitle h3 (class .heading):</label>
<input type="text" name="title_color_heading_h3" value="<?php echo $current_option42; ?>" />
</div>
<div class="option-holder">
<label>Home posts h3 (class .case):</label>
<input type="text" name="title_color_home_h3" value="<?php echo $current_option43; ?>" />
</div>
<div class="option-holder">
<label>What we do? home page h3 (class .text-box):</label>
<input type="text" name="title_color_whatwe_h3" value="<?php echo $current_option44; ?>" />
</div>
<div class="option-holder">
<label>Under What we do? pages h3 (class .boxes-holder):</label>
<input type="text" name="title_color_underwhatwe_h3" value="<?php echo $current_option45; ?>" />
</div>
<div class="option-holder">
<label>Bottom block h3 (class .bottom-block):</label>
<input type="text" name="title_color_bottom_h3" value="<?php echo $current_option46; ?>" />
</div>
<div class="option-holder">
<label>Our Services title h3 (class .services-block):</label>
<input type="text" name="title_color_sctitle_h3" value="<?php echo $current_option47; ?>" />
</div>
<div class="option-holder">
<label>Services posts title h3 (class .services):</label>
<input type="text" name="title_color_scptitle_h3" value="<?php echo $current_option48; ?>" />
</div>
<div class="option-holder">
<label>Sidebar title h3 (class .sidebar-box):</label>
<input type="text" name="title_color_sidebar_h3" value="<?php echo $current_option49; ?>" />
</div>
<div class="option-holder">
<label>Undertitle title h3 (class .post):</label>
<input type="text" name="title_color_underpost_h3" value="<?php echo $current_option53; ?>" />
</div>
<div class="option-holder">
<label>Comments title h3 (class .comments):</label>
<input type="text" name="title_color_comments_h3" value="<?php echo $current_option50; ?>" />
</div>
<div class="option-holder">
<label>Tabs Area title h3 (class .tabs-area):</label>
<input type="text" name="title_color_tabs_h3" value="<?php echo $current_option51; ?>" />
</div>
<div class="option-holder">
<label>Subtitles h4 (class .case, .text-box, .bottom-block, .boxes-holder):</label>
<input type="text" name="title_color_subtitles_h4" value="<?php echo $current_option54; ?>" />
</div>
<div class="option-holder">
<label>Subtitles posts h4 (class .services):</label>
<input type="text" name="title_color_services_h4" value="<?php echo $current_option55; ?>" />
</div>
<div class="option-holder">
<label>Footer titles h4:</label>
<input type="text" name="title_color_footer_h4" value="<?php echo $current_option56; ?>" />
</div>
<div class="option-holder">
<label>h5:</label>
<input type="text" name="title_color_h5" value="<?php echo $current_option57; ?>" />
</div>
<label> Slideshow Background Color:</label>
<div class="option-holder">
<?php $current_option33 = get_option('slideshow_color'); ?>
<div class="option-holder">
<input type="text" name="slideshow_color" value="<?php echo $current_option33; ?>" />
</div>
</div>
<label> Main Content Background Color:</label>
<div class="option-holder">
<?php $current_option34 = get_option('main_color'); ?>
<div class="option-holder">
<input type="text" name="main_color" value="<?php echo $current_option34; ?>" />
</div>
</div>
<label> Footer Background Color:</label>
<div class="option-holder">
<?php $current_option35 = get_option('bottom_color'); ?>
<div class="option-holder">
<input type="text" name="bottom_color" value="<?php echo $current_option35; ?>" />
</div>
</div>
<label> Footer Text Color:</label>
<div class="option-holder">
<?php $current_option37 = get_option('bottom_text_color'); ?>
<div class="option-holder">
<input type="text" name="bottom_text_color" value="<?php echo $current_option37; ?>" />
</div>
</div>
<label> Footer Link Color:</label>
<div class="option-holder">
<?php $current_option38 = get_option('bottom_link_color'); ?>
<div class="option-holder">
<input type="text" name="bottom_link_color" value="<?php echo $current_option38; ?>" />
</div>
</div>
<label> Footer Link Hover Color:</label>
<div class="option-holder">
<?php $current_option39 = get_option('bottom_hover_color'); ?>
<div class="option-holder">
<input type="text" name="bottom_hover_color" value="<?php echo $current_option39; ?>" />
</div>
</div>
</div>
</div>
<div class="option-row-sizes">
<h3>Font Sizes:</h3>
<div class="option-row">
<label> Body Font Size:</label>
<div class="option-holder">
<?php $current_option10 = get_option('body_size'); ?>
<div class="option-holder">
<input type="text" name="body_size" value="<?php echo $current_option10; ?>" />
</div>
</div>
</div>
<div class="option-row">
<label> Navigation Menu Font Size:</label>
<div class="option-holder">
<?php $current_option11 = get_option('nav_size'); ?>
<div class="option-holder">
<input type="text" name="nav_size" value="<?php echo $current_option11; ?>" />
</div>
</div>
</div>
<div class="option-row">
<label> Title Headings Font Size:</label>
<?php $current_option12 = get_option('title_size_h1'); ?>
<?php $current_option13 = get_option('title_size_h2'); ?>
<?php $current_option14 = get_option('title_size_heading_h3'); ?>
<?php $current_option17 = get_option('title_size_home_h3'); ?>
<?php $current_option18 = get_option('title_size_whatwe_h3'); ?>
<?php $current_option19 = get_option('title_size_bottom_h3'); ?>
<?php $current_option20 = get_option('title_size_underwhatwe_h3'); ?>
<?php $current_option21 = get_option('title_size_sctitle_h3'); ?>
<?php $current_option22 = get_option('title_size_scptitle_h3'); ?>
<?php $current_option23 = get_option('title_size_sidebar_h3'); ?>
<?php $current_option24 = get_option('title_size_comments_h3'); ?>
<?php $current_option25 = get_option('title_size_tabs_h3'); ?>
<?php $current_option52 = get_option('title_size_underpost_h3'); ?>
<?php $current_option15 = get_option('title_size_subtitles_h4'); ?>
<?php $current_option26 = get_option('title_size_services_h4'); ?>
<?php $current_option27 = get_option('title_size_footer_h4'); ?>
<?php $current_option16 = get_option('title_size_h5'); ?>
<div class="option-holder">
<label>h1:</label>
<input type="text" name="title_size_h1" value="<?php echo $current_option12; ?>" />
</div>
<div class="option-holder">
<label>h2 (class .heading):</label>
<input type="text" name="title_size_h2" value="<?php echo $current_option13; ?>" />
</div>
<div class="option-holder">
<label>Sudtitle h3 (class .heading):</label>
<input type="text" name="title_size_heading_h3" value="<?php echo $current_option14; ?>" />
</div>
<div class="option-holder">
<label>Home posts h3 (class .case):</label>
<input type="text" name="title_size_home_h3" value="<?php echo $current_option17; ?>" />
</div>
<div class="option-holder">
<label>What we do? home page h3 (class .text-box):</label>
<input type="text" name="title_size_whatwe_h3" value="<?php echo $current_option18; ?>" />
</div>
<div class="option-holder">
<label>Under What we do? pages h3 (class .boxes-holder):</label>
<input type="text" name="title_size_underwhatwe_h3" value="<?php echo $current_option20; ?>" />
</div>
<div class="option-holder">
<label>Bottom block h3 (class .bottom-block):</label>
<input type="text" name="title_size_bottom_h3" value="<?php echo $current_option19; ?>" />
</div>
<div class="option-holder">
<label>Our Services title h3 (class .services-block):</label>
<input type="text" name="title_size_sctitle_h3" value="<?php echo $current_option21; ?>" />
</div>
<div class="option-holder">
<label>Services posts title h3 (class .services):</label>
<input type="text" name="title_size_scptitle_h3" value="<?php echo $current_option22; ?>" />
</div>
<div class="option-holder">
<label>Sidebar title h3 (class .sidebar-box):</label>
<input type="text" name="title_size_sidebar_h3" value="<?php echo $current_option23; ?>" />
</div>
<div class="option-holder">
<label>Undertitle title h3 (class .post):</label>
<input type="text" name="title_size_underpost_h3" value="<?php echo $current_option52; ?>" />
</div>
<div class="option-holder">
<label>Comments title h3 (class .comments):</label>
<input type="text" name="title_size_comments_h3" value="<?php echo $current_option24; ?>" />
</div>
<div class="option-holder">
<label>Tabs Area title h3 (class .tabs-area):</label>
<input type="text" name="title_size_tabs_h3" value="<?php echo $current_option25; ?>" />
</div>
<div class="option-holder">
<label>Subtitles h4 (class .case, .text-box, .bottom-block, .boxes-holder):</label>
<input type="text" name="title_size_subtitles_h4" value="<?php echo $current_option15; ?>" />
</div>
<div class="option-holder">
<label>Subtitles posts h4 (class .services):</label>
<input type="text" name="title_size_services_h4" value="<?php echo $current_option26; ?>" />
</div>
<div class="option-holder">
<label>Footer titles h4:</label>
<input type="text" name="title_size_footer_h4" value="<?php echo $current_option27; ?>" />
</div>
<div class="option-holder">
<label>h5:</label>
<input type="text" name="title_size_h5" value="<?php echo $current_option16; ?>" />
</div>
</div>
</div>
</div>
<p class="submit">
<input type="submit" name="Save" value="Save" />
</p>
<p class="submit">
<label>Clears all options except the images: </label>
<input onclick="clear_form_elements(this.form)" type="button" name="clear_all" value="Clear Options" />
</p>
<?php
echo '
<script type="text/javascript">
function clear_form_elements(ele)
{
var form = jQuery(ele);
var check = form.find(\'input.clear_all\');
jQuery.ajax({
url:form.attr(\'action\'),
data: check.attr(\'clear_all\') + \'=\' + check.val(\'clear_all\') ,
type: \'POST\',
success: function(){
},
error: function(){
alert(\'ERROR!\')
}
});
jQuery(ele).find(\':input\').each(function() {
switch(this.type) {
case \'password\':
case \'select-multiple\':
case \'select-one\':
case \'text\':
case \'textarea\':
case \'file\':
jQuery(this).val(\'\');
break;
case \'checkbox\':
case \'radio\':
this.checked = false;
}
});
}
</script>'
?>
</form>
</div>
</div>
<?php }
function RicklieStone_theme_page_head()
{ // header Css+Script ...?>
<style type="text/css">
p {margin-left:4px;}
#RicklieStone {margin:5px;padding:10px;}
</style>
<?php }
add_action('admin_menu', 'RicklieStone_add_theme_page');
function theme_options_init($init) {
$init['mode'] = 'textareas';
$init['editor_selector'] = '';
$init['elements'] = 'category_description,description';
$init['plugins'] = 'safari,inlinepopups,autosave,spellchecker,paste,wordpress,media,fullscreen';
$init['theme_advanced_buttons1'] .= ',image,code';
$init['onpageload'] = '';
$init['save_callback'] = '';
$init['width'] = '100px';
return $init;
}
?>