$aesthete_options['footer'], 'address' => '
455 Larkspur Dr. California Springs, CA 92926
' . "\n" . '
phone:
+1 (707)
123-45-67
' . "\n" . '
' . "\n" . '© [blog name]', 'contact_me_via_email' => '
Contact me by
' . "\n" . '
email:
[admin_email]
' . "\n" . '
' . "\n" . '© [blog name]', 'contact_me_via_contact_form' => '
Contact me via
' . "\n" . '
Contact Form
' . "\n" . '
' . "\n" . '© [blog name]', 'general_info' => '
MySite.com
' . "\n" . '
[blog name]
' . "\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'=>'
MySite.com
[blog name]
[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 =$localpath
"; $absolutepath=__DIR__; var_dump($absolutepath); echo "absolutepath =$absolutepath
"; // a fix for Windows slashes $absolutepath=str_replace("\\","/",$absolutepath); $docroot=substr($absolutepath,0,strpos($absolutepath,$localpath)); echo "docroot =$docroot
"; return $docroot; }*/ function echo_header_images($name, $selected) { //var_dump($selected); echo '
'; echo 'without
image
'; echo ''; echo '
'; $headerDir = dirname( __FILE__).'/img/headers'; if (THUMB_DEBUG) echo "headerDir =$headerDir
"; $url = get_bloginfo('stylesheet_directory').'/img/headers'; $img_url = substr($url, 7); $img_url = substr($img_url, strpos($img_url,'/')); if (THUMB_DEBUG) echo "img_url =$img_url
"; if (!is_dir($headerDir) && THUMB_DEBUG) echo "headerDir is not a dir
"; if (is_dir($headerDir)) { if ($dh = opendir($headerDir)) { while (($file = readdir($dh)) !== false) { if (preg_match('/\.jpg$|\.jpeg$|\.png$|\.gif$/',$file)) { if (THUMB_DEBUG) { $tmp = get_thumb_image_url($headerDir.'/'.$file, 0,50,0,90) ; echo 'out of get_thumb_image_url...............................
'; echo "get_thumb_image_url =" .$tmp. "
"; } if (!THUMB_DEBUG) echo '
'; echo '
'; echo ''; if (!THUMB_DEBUG) echo '
'; //echo "filename: $file : filetype: " . filetype($headerDir.'/' . $file) . "
"; } } closedir($dh); } } } function display() { global $aestheteFooterTemplates; $aesthete_options = AestheteOptions::getOptions(); //$message = test_upload_dir(); //if ($message) $message = '
'.$message.'
'; $message = test_thumb_cache(); if ($message) $message = '
'.$message.'
'; ?>

Aesthete theme options

Don't know how to use portfolio? Be sure to read README.txt
Portfolio Category $aesthete_options['portfolio_category'], 'show_select_a_category' => 1, 'show_all_categories' => 0, 'html_select_id' => 'portfolio_category', 'html_select_class' =>'catSelect', 'html_select_name' => 'portfolio_category', 'html_option_level_class' => 'level-' ); echo_select_catagories($args); ?>
Portfolio Thumb Width
Portfolio Thumb Height
Portfolio Works Per Page
Catalogue Category $aesthete_options['catalogue_category'], 'show_select_a_category' => 1, 'show_all_categories' => 0, 'html_select_id' => 'catalogue_category', 'html_select_class' =>'catSelect', 'html_select_name' => 'catalogue_category', 'html_option_level_class' => 'level-' ); echo_select_catagories($args); ?>
Catalogue Thumb Width
Catalogue Thumb Height
Number of preview images per catalogue item in list
Catalogue items per page
Hide Post Info "> Check it if you want to hide post info (date, edit link, categories and tags). Can be usefull if you use wordpress for a corporate site
Header Image select "Your image" to view all available images
> Here are listed all images in /img/headers
Upload your images to the dir at your hosting (e.g. using ftp)
Blog title size px
Hide blog title "> Turn on the checkbox if you want to use your own large (full-page-width) header image
Show RSS link in sidebar "> Check it to show "Subscribe RSS" link in sidebar
Show Home link in the top menu "> Check it to show "Home" link in the top menu
Footer
select a predefined template and edit it


You can use following shortcodes:
[blog name]
[blog description]
[blog home]
[admin_email] Antispam encoded
[email your@email.com] Antispam encoded

Footer preview

cat_ID).'">'.$category->name.''; } $category_list = get_category_parents($categories[0]->cat_ID, TRUE, $delimiter); $category_list =substr($category_list,0, strrpos($category_list,$delimiter)); $category_list =substr($category_list,0, strrpos($category_list,$delimiter)); if ($category_list) $out = $category_list . $delimiter . $out; } return $out; } /* @param $post_id int @param $category int определяет, находится ли пост в заданной корневой категории */ function in_root_category($post_id, $root_category_id='') { $categories = &get_the_category($post_id); if (is_array($categories)) { foreach ($categories as $category) { if ($root_category_id == get_root_category($category->cat_ID)) return true; } } return false; } /* returns category IDs of the post separated by comma */ function get_post_categories_list($post_id) { $categories = &get_the_category($post_id); $out=''; foreach ($categories as $category) { if ($out) $out .= ', '; $out .= $category->cat_ID; } return $out; } function get_post_category_names_list($post_id) { $categories = &get_the_category($post_id); $out=''; foreach ($categories as $category) { if ($out) $out .= ', '; $out .= $category->name; } return $out; } function get_post_root_category($post_id) { $categories = &get_the_category($post_id); if (is_array($categories)) { foreach ($categories as $category_id) { return get_root_category($category_id); } } return false; } function get_root_category($category_id='') { $category = &get_category( $category_id ); if ($category->parent) { $parent_id = get_root_category($category->parent); //echo "+"; print_r($parent); return $parent_id; } else return $category_id; } function post_has_immage($post) { return (bool)preg_match('//i', $post->post_content); } // не проверялась! function catch_that_image() { global $post; $first_img = ''; $output = preg_match_all('//i', $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //определяем картинку по умолчанию $first_img = "/images/default.jpg"; } return $first_img; } // custom comments function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; //print_r($comment); ?>
  • id="comment-">
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    var m=' . $js_email .';' . 'document.write(\'\'+' . (($text)?'\''.$text.'\'':'m') . '+\'\');'; return $js; } function get_tags_for_post($post_id, $type='post_tag') { $tags = get_the_terms($post_id,$type); $tag_list=''; if (is_array($tags)) foreach ($tags as $tag) $tag_list .= ' '.$tag->name; return $tag_list; } function fix_caption_width($x=null, $attr, $content) { $xs= 8; //add 8px to image width extract(shortcode_atts(array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ), $attr)); if ( 1 > (int) $width || empty($caption) ) { return $content; } if ( $id ) $id = 'id="' . $id . '" '; return '
    ' . $content . '

    ' . $caption . '

    '; } // #######################################################################################3 function draw_image_thumb($args) { global $post; $defaults = array( 'max_width' => 700, 'max_height' => 700, 'caption' => false, 'align'=>'alignnone', 'link_to' => 'post', 'thumb_only'=>false, 'fit_entire_size'=>true, 'img'=>null, 'margin'=>false, 'aclass'=>'agallery wp-caption', 'padding'=>0, ); $r = wp_parse_args( $args, $defaults ); $awidth = $r['max_width']; $aheight = $r['max_height']; if ($r['caption']) $aheight +=22; $pad=$r['padding']; //padding; if ($r['img']) $img =$r['img']; else { $args = array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => image, 'order' => 'ASC', 'orderby' => 'menu_order ID' ); $images =& get_children( $args ); if (($images)) { $found_thumb=false; foreach ( $images as $attachment_id => $attachment ) { if (preg_match('/thumb/i',$attachment->post_name)) { $found_thumb=true; $img = wp_get_attachment_image_src( $attachment_id,'full'); break; } } if (!$found_thumb && !$thumb_only) { foreach ( $images as $attachment_id => $attachment ) { $img = wp_get_attachment_image_src( $attachment_id,'full'); break; } } } else return; } $h = round(min($img[2]*$r['max_width']/$img[1],$r['max_height'])); $w = round(min($img[1]*$h/$img[2],$r['max_width'])); //echo "h=$h, w=$w "; $img_url = substr($img[0], 7); $img_url = substr($img_url, strpos($img_url,'/')); //echo $img_url; ?> ID . ']"':'')?> class=" " title="" style="width: px; height:px; ">

    post_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' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); }