cat_ID] = $category_list->cat_name;
}
array_unshift($wp_cats, __('Choose a category', 'bricenergy'));
$options = array (
array( "name" => $themename. __('Options', 'bricenergy'),
"type" => "title"),
array( "name" => __('General', 'bricenergy'),
"type" => "section"),
array( "type" => "open"),
array( "name" => __('Color Scheme', 'bricenergy'),
"desc" => __('Select the color scheme for Bric Energy.', 'bricenergy'),
"id" => $shortname."_color_scheme",
"type" => "select",
"options" => array("red", "blue", "green", "yellow"),
"std" => "red"),
array( "name" => __('Custom CSS', 'bricenergy'),
"desc" => __('Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:green}', 'bricenergy'),
"id" => $shortname."_custom_css",
"type" => "textarea",
"std" => ""),
array( "type" => "close"),
array( "name" => __('Header', 'bricenergy'),
"type" => "section"),
array( "type" => "open"),
array( "name" => __('Logo URL', 'bricenergy'),
"desc" => __('Enter the link to your logo image. Best results with: 200×90 pixel.', 'bricenergy'),
"id" => $shortname."_logo",
"type" => "text",
"std" => $themedir."/images/logo.png"),
array( "name" => __('Custom Favicon', 'bricenergy'),
"desc" => __('A favicon is a 16x16 pixel icon that represents your site; paste the URL to a .ico image that you want to use as the image', 'bricenergy'),
"id" => $shortname."_favicon",
"type" => "text",
"std" => home_url() ."/favicon.ico"),
array( "name" => __('Header Leaderboard', 'bricenergy'),
"desc" => __('Want to add a 728×90px banner in the header? Then put your code in here.
You can insert Adsense code or HTML, for example:
<a href=\"[Website-URL]\" target=\"_blank\"><img src=\"[Banner-URL]\" height=\"60px\" width=\"468px\" title=\"[Title]\"></a>', 'bricenergy'),
"id" => $shortname."_header_ad",
"type" => "textarea",
"std" => ""),
array( "name" => __('Facebook Button', 'bricenergy'),
"desc" => __('Do you have a page or group on Facebook? Then insert the full URL here. This will create a small Facebook button in the main navigation.', 'bricenergy'),
"id" => $shortname."_fb_button",
"type" => "text",
"std" => ""),
array( "name" => __('Twitter Button', 'bricenergy'),
"desc" => __('Are you tweeting? Then insert your nickname here. This will create a small Twitter button in the main navigation.', 'bricenergy'),
"id" => $shortname."_tw_button",
"type" => "text",
"std" => ""),
array( "type" => "close"),
array( "name" => __('Homepage', 'bricenergy'),
"type" => "section"),
array( "type" => "open"),
array( "name" => __('Homepage featured category', 'bricenergy'),
"desc" => __('Choose a category from which featured posts are drawn', 'bricenergy'),
"id" => $shortname."_feat_cat",
"type" => "select",
"options" => $wp_cats,
"std" => __('Choose a category', 'bricenergy')),
array( "name" => __('Featured Button Text', 'bricenergy'),
"desc" => __('Text in the featured button. Leave this blank if you don\'t wanna display it.', 'bricenergy'),
"id" => $shortname."_featured_text",
"type" => "text",
"std" => "Featured"),
array( "type" => "close"),
array( "name" => __('Footer', 'bricenergy'),
"type" => "section"),
array( "type" => "open"),
array( "name" => __('Footer Logo URL', 'bricenergy'),
"desc" => __('Enter the link to your footer logo image. It will be centered. Leave it blank if you don\'t wanna use a footer logo. Best results with: 300×100 pixel and transparency.', 'bricenergy'),
"id" => $shortname."_ft_logo",
"type" => "text",
"std" => $themedir."/images/logo-footer.png"),
array( "name" => __('Google Analytics Code', 'bricenergy'),
"desc" => __('You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.', 'bricenergy'),
"id" => $shortname."_ga_code",
"type" => "textarea",
"std" => ""),
array( "type" => "close")
);
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: admin.php?page=functions.php&saved=true");
die;
}
else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: admin.php?page=functions.php&reset=true");
die;
}
}
add_theme_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');
}
function mytheme_add_init() {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
wp_enqueue_script("rm_script", $file_dir."/functions/rm_script.js", false, "1.0");
}
function mytheme_admin() {
global $themename, $shortname, $options;
$i=0;
if ( $_REQUEST['saved'] ) echo '
'.$themename.' ' . __('settings saved', 'bricenergy') . '.
'.$themename.' ' . __('settings reset', 'bricenergy') . '.
?>/functions/images/trans.png)