"General Settings",
"type" => "heading"),
array( "name" => "Feedburner ID",
"desc" => "Learn how to find your Feedburner ID by reading this tutorial.
",
"id" => $shortname."_feedburner_id",
"std" => "Enter Feedburner Email Subscribe ID Here",
"type" => "text"),
array( "name" => "468x60 Banner Ad",
"desc" => "This is for the the 468x60 ad banner in the header.
",
"id" => $shortname."_ad_468",
"std" => "Enter 468x60 Banner Code Here",
"type" => "textarea"),
array( "name" => "120x600 Banner Ad",
"desc" => "This is for the the 120x600 ad banner in the sidebar.
",
"id" => $shortname."_ad_120",
"std" => "Enter 120x600 Banner Code Here",
"type" => "textarea"),
array( "name" => "468x60 AdSense Code",
"desc" => "This is for the 468x60 Google AdSense banner in between the single post and comments section.
",
"id" => $shortname."_adsense_468",
"std" => "Enter Google AdSense Code Here",
"type" => "textarea"),
array( "name" => "300x250 AdSense Code",
"desc" => "This is for the 300x250 Google AdSense banner in the sidebar.
",
"id" => $shortname."_adsense_300",
"std" => "Enter Google AdSense Code Here",
"type" => "textarea"),
array( "name" => "Video Code",
"desc" => "This is for the featured video in the sidebar.
Recommended size for the video is 275x230, so don't forget to change that from the embedded video code.
For example, you'd want to change the bolded items in this: <object width='275' height='230'><param name='movie' value='http://www.youtube.com/v/npP73QIApFE&hl=en&fs=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/npP73QIApFE&hl=en&fs=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='275' height='230'></embed></object>", "id" => $shortname."_you_tube",
"id" => $shortname."_video",
"std" => "Enter Embedded Video Code Here",
"type" => "textarea"),
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
update_option( $value['id'], $_REQUEST[ $value['id'] ] );
}else{
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $value['id'].'_'.$mc_key;
update_option($up_opt, $_REQUEST[$up_opt] );
}
}
}
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); }
}else{
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $value['id'].'_'.$mc_key;
if( isset( $_REQUEST[ $up_opt ] ) ) { update_option( $up_opt, $_REQUEST[ $up_opt ] ); } else { delete_option( $up_opt ); }
}
}
}
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
delete_option( $value['id'] );
}else{
foreach($value['options'] as $mc_key => $mc_value){
$del_opt = $value['id'].'_'.$mc_key;
delete_option($del_opt);
}
}
}
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.
"; echo $content; echo " "."Read More →"; echo "
"; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo ""; echo $content; echo "..."; echo " ".$more_link_text.""; echo "
"; } else { echo ""; echo $content; echo " "."Read More →"; echo "
"; } } ?>