$aesthete_options['footer'], 'address' => '
' . "\n" . ' ' . "\n" . '' . "\n" . '© [blog name]', 'contact_me_via_email' => ' ' . "\n" . ' ' . "\n" . '' . "\n" . '© [blog name]', 'contact_me_via_contact_form' => ' ' . "\n" . ' ' . "\n" . '' . "\n" . '© [blog name]', 'general_info' => ' ' . "\n" . ' ' . "\n" . '' . "\n" . '[blog description]', ); class AestheteOptions { function getOptions() { //global $aesthete_options; //if (!$aesthete_options) { $options = get_option('aesthete_options'); if (!is_array($options)) { $options = array ( 'portfolio_category'=> '', 'portfolio_works_per_page'=> 10, 'portfolio_thumb_width'=> 190, 'portfolio_thumb_height'=> 143, 'catalogue_category'=>'', 'catalogue_thumb_width'=> 100, 'catalogue_thumb_height'=> 100, 'catalogue_items_per_page'=> 10, 'hide_post_info'=> false, 'catalogue_image_number'=>1, 'use_graph_header'=>false, 'header_image' =>1, //standard / small / custom 'header_image_url'=>'', // 'header_font_size'=>54, // 'footer'=>' [blog description]', 'header_image_width' => 479, 'header_image_height' => 131, 'blog_title_size' => 54, 'hide_blog_title' =>false, 'show_rss_link'=>true, 'show_home_link'=>true, 'top_menu' =>'' ); update_option('aesthete_options', $options); } } return $options; } function add() { $aesthete_options = AestheteOptions::getOptions(); if(isset($_POST['aesthete_save_options'])) { // meta $aesthete_options['portfolio_category'] = stripslashes($_POST['portfolio_category']); $aesthete_options['top_menu'] = stripslashes($_POST['top_menu']); $aesthete_options['portfolio_works_per_page'] = (int)($_POST['portfolio_works_per_page']); $aesthete_options['portfolio_thumb_width'] = (int)($_POST['portfolio_thumb_width']); $aesthete_options['portfolio_thumb_height'] = (int)($_POST['portfolio_thumb_height']); $aesthete_options['catalogue_category'] = stripslashes($_POST['catalogue_category']); $aesthete_options['catalogue_thumb_width'] = (int)($_POST['catalogue_thumb_width']); $aesthete_options['catalogue_thumb_height'] = (int)($_POST['catalogue_thumb_height']); $aesthete_options['catalogue_image_number'] = (int)($_POST['catalogue_image_number']); $aesthete_options['catalogue_items_per_page'] = (int)($_POST['catalogue_items_per_page']); $aesthete_options['hide_post_info'] = ($_POST['hide_post_info'])?true:false; $aesthete_options['use_graph_header'] = ($_POST['use_graph_header'])?true:false; $aesthete_options['header_image'] = (int)($_POST['header_image']); $aesthete_options['image_url'] = stripslashes($_POST['image_url']); $aesthete_options['hide_blog_title'] = ($_POST['hide_blog_title'])?true:false; $aesthete_options['blog_title_size'] = (int)($_POST['blog_title_size']); $aesthete_options['footer'] = stripslashes($_POST['aestheteFooter']); $aesthete_options['show_rss_link'] = ($_POST['show_rss_link'])?true:false; $aesthete_options['show_home_link'] = ($_POST['show_home_link'])?true:false; switch ($aesthete_options['header_image']) { case 1: $aesthete_options['header_image_width'] = 479; $aesthete_options['header_image_height'] = 131; break; case 2: $aesthete_options['header_image_width'] = 350; $aesthete_options['header_image_height'] = 94; break; case 3: if ($aesthete_options['image_url']) { $image = open_image( mime_type($aesthete_options['image_url']), $aesthete_options['image_url']); $aesthete_options['header_image_width'] = imagesx($image); $aesthete_options['header_image_height'] = imagesy($image); imagedestroy ($image); } else { $aesthete_options['header_image_width'] = 0; $aesthete_options['header_image_height'] = 97; } break; } update_option('aesthete_options', $aesthete_options); } add_theme_page("Aesthete Theme Options", "Aesthete Theme Options", 'edit_themes', basename(__FILE__), array('AestheteOptions', 'display')); } function option_footer_templates() { global $aestheteFooterTemplates; $aesthete_options = get_option('aesthete_options'); foreach ($aestheteFooterTemplates as $k=>$v) { echo ''; } } /*function get_document_root() { // from http://www.helicron.net/php/ $localpath=dirname(getenv("SCRIPT_NAME")); echo "localpath =$localpathpost_excerpt?>
get_bloginfo('name'), '[blog description]' => get_bloginfo('description'), '[blog home]' => get_option('home'), '[admin_email]' => hide_email(get_bloginfo('admin_email')), ); $footer = $aesthete_options['footer']; foreach ($shortcodes as $k => $v) { $footer = str_replace($k, $v, $footer); } preg_match_all('/\[email (.*)\]/',$footer, $matches); if (is_array($matches)) foreach ($matches[0] as $k=>$v) { $footer = str_replace($v,hide_email($matches[1][$k]), $footer); } return $footer; } /**************************************************** START *****************************************************/ if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { //echo "message"; } add_filter('img_caption_shortcode', 'fix_caption_width', 10, 3); add_filter( 'comments_template', 'legacy_comments' ); add_action ('init', 'theme_init'); add_action('admin_menu', array('AestheteOptions', 'add')); if( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'index_sidebar', 'before_widget' => ' ', 'before_title' => '