array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'javascript animations','boozurk' ), 'info'=>__( 'try disable animations if you encountered problems with javascript','boozurk' ), 'req'=>'' ), 'boozurk_js_thickbox'=> array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'thickbox preview','boozurk' ), 'info'=>__( 'add the thickbox effect to each linked image and galleries in post content','boozurk' ), 'req'=>'boozurk_jsani' ), 'boozurk_js_post_expander'=>array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'post expander','boozurk' ), 'info'=>__( 'expands a post to show the full content when the reader clicks the "Read more..." link','boozurk' ), 'req'=>'boozurk_jsani' ), 'boozurk_js_tooltips'=> array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'cool tooltips','boozurk' ), 'info'=>__( 'replace link titles with cool tooltips','boozurk' ), 'req'=>'boozurk_jsani' ), 'boozurk_js_swfplayer'=>array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'swf audio player','boozurk' ), 'info'=>__( 'create an audio player for linked audio files (mp3,ogg and m4a) in the audio format posts','boozurk' ), 'req'=>'boozurk_jsani' ), 'boozurk_quotethis'=> array( 'group'=>'javascript', 'type'=>'chk', 'default'=>1, 'description'=>__( 'quote link', 'boozurk' ), 'info'=>__( 'show a link for easily add the selected text as a quote inside the comment form', 'boozurk' ), 'req'=>'' ), 'boozurk_infinite_scroll'=> array( 'group'=>'javascript', 'type'=>'chk', 'default'=>0, 'description'=>__( 'infinite pagination','boozurk' ), 'info'=>__( 'automatically append the next page of posts (via AJAX) to your current page','boozurk' ), 'req'=>'boozurk_jsani', 'sub'=>array('boozurk_infinite_scroll_type') ), 'boozurk_infinite_scroll_type'=>array( 'group'=>'javascript', 'type'=>'sel', 'default'=>'manual', 'description'=>__( 'behaviour','boozurk' ), 'info'=>__( 'auto: when a user scrolls to the bottom - manual: by clicking the link at the end of posts','boozurk' ), 'options'=>array('auto','manual'), 'options_l10n'=>array(__('auto','boozurk'),__('manual','boozurk')), 'req'=>'', 'sub'=>false ), 'boozurk_sidebar_head_split'=> array( 'group'=>'widgets', 'type'=>'sel', 'default'=>'3', 'description'=>__( 'split Header widget area','boozurk' ), 'info'=>__( 'number of widget that can stay in the widget area side by side','boozurk' ), 'options'=>array('1','2','3'), 'options_l10n'=>array('1','2','3'), 'req'=>'' ), 'boozurk_sidebar_single_split'=>array( 'group'=>'widgets', 'type'=>'sel', 'default'=>'1', 'description'=>__( 'split Post widget area','boozurk' ), 'info'=>__( 'number of widget that can stay in the widget area side by side','boozurk' ), 'options'=>array('1','2','3'), 'options_l10n'=>array('1','2','3'), 'req'=>'' ), 'boozurk_sidebar_foot_1_width'=>array( 'group'=>'widgets', 'type'=>'sel', 'default'=>'33%', 'description'=>__( 'footer widget area #1','boozurk' ), 'info'=>__( 'width of the widget area','boozurk' ), 'options'=>array('100%','50%','33%'), 'options_l10n'=>array('100%','50%','33%'), 'req'=>'' ), 'boozurk_sidebar_foot_2_width'=>array( 'group'=>'widgets', 'type'=>'sel', 'default'=>'33%', 'description'=>__( 'footer widget area #2','boozurk' ), 'info'=>__( 'width of the widget area','boozurk' ), 'options'=>array('100%','50%','33%'), 'options_l10n'=>array('100%','50%','33%'), 'req'=>'' ), 'boozurk_sidebar_foot_3_width'=>array( 'group'=>'widgets', 'type'=>'sel', 'default'=>'33%', 'description'=>__( 'footer widget area #3','boozurk' ), 'info'=>__( 'width of the widget area','boozurk' ), 'options'=>array('100%','50%','33%'), 'options_l10n'=>array('100%','50%','33%'), 'req'=>'' ), 'boozurk_custom_widgets'=> array( 'group'=>'widgets', 'type'=>'chk', 'default'=>1, 'description'=>__( 'custom widgets','boozurk' ), 'info'=>__( 'add a lot of new usefull widgets','boozurk' ), 'req'=>'' ), 'boozurk_colors_link'=> array( 'group'=>'colors', 'type'=>'col', 'default'=>'#21759b', 'description'=>__( 'links','boozurk' ), 'info'=>'', 'req'=>'' ), 'boozurk_colors_link_hover'=> array( 'group'=>'colors', 'type'=>'col', 'default'=>'#404040', 'description'=>__( 'highlighted links','boozurk' ), 'info'=>'', 'req'=>'' ), 'boozurk_colors_link_sel'=> array( 'group'=>'colors', 'type'=>'col', 'default'=>'#87CEEB', 'description'=>__( 'selected links','boozurk' ), 'info'=>'', 'req'=>'' ), 'boozurk_cat_colors'=> array( 'group'=>'colors', 'type'=>'catcol', 'default'=>array(), 'defaultcolor'=>'#87CEEB', 'description'=>__( 'colors for categories','boozurk' ), 'info'=>'', 'req'=>'' ), 'boozurk_font_family'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'monospace', 'description'=>__( 'font family','boozurk' ), 'info'=>'', 'options'=>array('monospace','Arial, sans-serif','Helvetica, sans-serif','Comic Sans MS, cursive','Courier New, monospace','Georgia, serif','Lucida Console, Monaco, monospace','Lucida Sans Unicode, Lucida Grande, sans-serif','Palatino Linotype, Book Antiqua, Palatino, serif','Tahoma, Geneva, sans-serif','Times New Roman, Times, serif','Trebuchet MS, sans-serif','Verdana, Geneva, sans-serif'), 'options_l10n'=>array('monospace','Arial, sans-serif','Helvetica, sans-serif','Comic Sans MS, cursive','Courier New, monospace','Georgia, serif','Lucida Console, Monaco, monospace','Lucida Sans Unicode, Lucida Grande, sans-serif','Palatino Linotype, Book Antiqua, Palatino, serif','Tahoma, Geneva, sans-serif','Times New Roman, Times, serif','Trebuchet MS, sans-serif','Verdana, Geneva, sans-serif'), 'req'=>'', 'sub'=>array('boozurk_font_size') ), 'boozurk_font_size'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'14px', 'description'=>__( 'font size','boozurk' ), 'info'=>'', 'options'=>array('10px','11px','12px','13px','14px','15px','16px'), 'options_l10n'=>array('10px','11px','12px','13px','14px','15px','16px'), 'req'=>'', 'sub'=>false ), 'boozurk_post_formats'=>array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'post formats support','boozurk' ), 'info'=>'WordPress Codex : Post Formats', 'req'=>'' ), 'boozurk_browse_links'=>array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'quick browsing links', 'boozurk' ), 'info'=>__( 'show navigation links before post content', 'boozurk' ), 'req'=>'' ), 'boozurk_post_date'=> array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'post date', 'boozurk' ), 'info'=>__( 'show date right before post content (only in posts index)', 'boozurk' ), 'req'=>'' ), 'boozurk_featured_title'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'lists', 'description'=>__( 'enhanced post title','boozurk' ), 'info'=>__( 'use the featured image as background for the post title','boozurk' ), 'options'=>array('lists','single','both','none'), 'options_l10n'=>array(__('in lists','boozurk'),__('in single posts/pages','boozurk'),__('both','boozurk'),__('none','boozurk')), 'req'=>'', 'sub'=>array('boozurk_featured_title_height') ), 'boozurk_featured_title_height'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'300px', 'description'=>__( 'max height','boozurk' ), 'info'=>'', 'options'=>array('100px','150px','200px','250px','300px','350px','400px','auto'), 'options_l10n'=>array('100px','150px','200px','250px','300px','350px','400px','auto'), 'req'=>'', 'sub'=>false ), 'boozurk_plusone'=> array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>'Google +1', 'info'=>__( 'integrates the +1 feature for your contents', 'boozurk' ), 'req'=>'' ), 'boozurk_main_menu'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'text', 'description'=>__( 'main menu look','boozurk' ), 'info'=>__( 'select the style of the main menu: text, thumbnails or both','boozurk' ), 'options'=>array( 'text', 'thumbnail', 'thumbnail and text' ), 'options_l10n'=>array( __('text','boozurk'), __('thumbnail','boozurk'), __('thumbnail and text','boozurk') ), 'req'=>'', 'sub'=>array('boozurk_main_menu_icon_size') ), 'boozurk_main_menu_icon_size'=> array( 'group'=>'other', 'type'=>'sel', 'default'=>'48', 'description'=>__( 'main menu icon size','boozurk' ), 'info'=>__( 'the dimension of the thumbnails in main menu (if "thumbnails" style is selected)','boozurk' ), 'options'=>array ('32', '48', '64', '96'), 'options_l10n'=>array ('32', '48', '64', '96'), 'req'=>'', 'sub'=>false ), 'boozurk_logo'=>array( 'group'=>'other', 'type'=>'url', 'default'=>'', 'description'=>__( 'Logo','boozurk' ), 'info'=>__( 'a logo in the upper right corner of the window. paste here the complete path to image location. leave empty to ignore','boozurk' ), 'req'=>'', 'sub'=>array('boozurk_logo_login') ), 'boozurk_logo_login'=> array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'Logo in login page','boozurk' ), 'info'=>__( 'use the logo in the login page','boozurk' ), 'req'=>'boozurk_logo', 'sub'=>false ), 'boozurk_editor_style'=>array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'editor style', 'boozurk' ), 'info'=>__( "add style to the editor in order to write the post exactly how it will appear on the site", 'boozurk' ), 'req'=>'' ), 'boozurk_mobile_css'=> array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'mobile support','boozurk' ), 'info'=>__( 'use a dedicated style in mobile devices','boozurk' ), 'req'=>'' ), 'boozurk_post_formats_standard'=>array( 'group'=>'index', 'type'=>'gro', 'default'=>1, 'description'=>__( 'standard','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'standard','boozurk' ) ), 'sub'=>array('boozurk_post_formats_standard_title','boozurk_post_formats_standard_content'), 'req'=>'' ), 'boozurk_post_formats_standard_title'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'none', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array('post title', 'post date','none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'none','boozurk' )), 'req'=>'', 'sub'=>false ), 'boozurk_post_formats_standard_content'=>array( 'group'=>'index', 'type'=>'sel', 'default'=>'presentation', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'', 'sub'=>false ), 'boozurk_post_formats_gallery'=>array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'gallery','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'gallery','boozurk' ) ), 'req'=>'boozurk_post_formats', 'sub'=>array('boozurk_post_formats_gallery_title','boozurk_post_formats_gallery_content') ), 'boozurk_post_formats_gallery_title'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'none', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array('post title', 'post date','none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_gallery', 'sub'=>false ), 'boozurk_post_formats_gallery_content'=>array( 'group'=>'index', 'type'=>'sel', 'default'=>'presentation', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'presentation', 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'presentation','boozurk' ),__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_gallery', 'sub'=>false ), 'boozurk_post_formats_aside'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'aside','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'aside','boozurk' ) ), 'req'=>'boozurk_post_formats' ), 'boozurk_post_formats_audio'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'audio','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'audio','boozurk' ) ), 'req'=>'boozurk_post_formats', 'sub'=>array('boozurk_post_formats_audio_title','boozurk_post_formats_audio_content') ), 'boozurk_post_formats_audio_title'=>array( 'group'=>'index', 'type'=>'sel', 'default'=>'first link text', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array( 'post title', 'post date', 'first link text', 'none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'first link text','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_audio', 'sub'=>false ), 'boozurk_post_formats_audio_content'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'audio player', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'audio player', 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'audio player','boozurk' ),__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_audio', 'sub'=>false ), 'boozurk_post_formats_image'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'image','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'image','boozurk' ) ), 'req'=>'boozurk_post_formats', 'sub'=>array('boozurk_post_formats_image_title','boozurk_post_formats_image_content') ), 'boozurk_post_formats_image_title'=>array( 'group'=>'index', 'type'=>'sel', 'default'=>'first image title', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array( 'post title', 'post date', 'first image title', 'none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'first image title','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_image', 'sub'=>false ), 'boozurk_post_formats_image_content'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'first image', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'first image', 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'first image','boozurk' ),__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_gallery', 'sub'=>false ), 'boozurk_post_formats_link'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'link','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'link','boozurk' ) ), 'req'=>'boozurk_post_formats', 'sub'=>array('boozurk_post_formats_link_title','boozurk_post_formats_link_content') ), 'boozurk_post_formats_link_title'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'first link text', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array( 'post title', 'post date', 'first link text', 'none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'first link text','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_link', 'sub'=>false ), 'boozurk_post_formats_link_content'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'none', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_gallery', 'sub'=>false ), 'boozurk_post_formats_quote'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'quote','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'quote','boozurk' ) ), 'req'=>'boozurk_post_formats', 'sub'=>array('boozurk_post_formats_quote_title','boozurk_post_formats_quote_content') ), 'boozurk_post_formats_quote_title'=>array( 'group'=>'index', 'type'=>'sel', 'default'=>'short quote excerpt', 'description'=>__( 'title','boozurk' ), 'info'=>'', 'options'=>array( 'post title', 'post date', 'short quote excerpt', 'none'), 'options_l10n'=>array(__( 'post title','boozurk' ),__( 'post date','boozurk' ),__( 'short quote excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_quote', 'sub'=>false ), 'boozurk_post_formats_quote_content'=> array( 'group'=>'index', 'type'=>'sel', 'default'=>'content', 'description'=>__( 'content','boozurk' ), 'info'=>'', 'options'=>array( 'content', 'excerpt', 'none'), 'options_l10n'=>array(__( 'content','boozurk' ),__( 'excerpt','boozurk' ),__( 'none','boozurk' )), 'req'=>'boozurk_post_formats_gallery', 'sub'=>false ), 'boozurk_post_formats_status'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'status','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'status','boozurk' ) ), 'req'=>'boozurk_post_formats' ), 'boozurk_post_formats_video'=> array( 'group'=>'index', 'type'=>'chk', 'default'=>1, 'description'=>__( 'video','boozurk' ), 'info'=>sprintf( __( '%s format posts', 'boozurk' ), __( 'video','boozurk' ) ), 'req'=>'boozurk_post_formats' ), 'boozurk_tbcred'=> array( 'group'=>'other', 'type'=>'chk', 'default'=>1, 'description'=>__( 'theme credits','boozurk' ), 'info'=>__( "please, don't hide theme credits",'boozurk' ), 'req'=>'' ) ); return $boozurk_coa; } // get theme version if ( get_theme( 'Boozurk' ) ) { $boozurk_current_theme = get_theme( 'Boozurk' ); $boozurk_version = $boozurk_current_theme['Version']; } // check and set default options function boozurk_default_options() { global $boozurk_current_theme; $boozurk_coa = boozurk_get_coa(); $boozurk_opt = get_option( 'boozurk_options' ); // if options are empty, sets the default values if ( empty( $boozurk_opt ) || !isset( $boozurk_opt ) ) { foreach ( $boozurk_coa as $key => $val ) { $boozurk_opt[$key] = $boozurk_coa[$key]['default']; } $boozurk_opt['version'] = ''; //null value to keep admin notice alive and invite user to discover theme options update_option( 'boozurk_options' , $boozurk_opt ); } else if ( !isset( $boozurk_opt['version'] ) || $boozurk_opt['version'] < $boozurk_current_theme['Version'] ) { // check for unset values and set them to default value -> when updated to new version foreach ( $boozurk_coa as $key => $val ) { if ( !isset( $boozurk_opt[$key] ) ) $boozurk_opt[$key] = $boozurk_coa[$key]['default']; } $boozurk_opt['version'] = ''; //null value to keep admin notice alive and invite user to discover theme options update_option( 'boozurk_options' , $boozurk_opt ); } } // print a reminder message for set the options after the theme is installed or updated if ( !function_exists( 'boozurk_setopt_admin_notice' ) ) { function boozurk_setopt_admin_notice() { echo '

' . sprintf( __( "boozurk theme says: \"Dont forget to set my options!\"", 'boozurk' ), get_admin_url() . 'themes.php?page=tb_boozurk_functions' ) . '

'; } } if ( current_user_can( 'manage_options' ) && $boozurk_opt['version'] < $boozurk_current_theme['Version'] ) { add_action( 'admin_notices', 'boozurk_setopt_admin_notice' ); } if ( ( $boozurk_opt['boozurk_logo_login'] == 1 ) && ( $boozurk_opt['boozurk_logo'] != '' ) ) { add_action( 'login_footer', 'boozurk_login_footer' ); add_action( 'login_head', 'boozurk_login_head' ); } if ( !function_exists( 'boozurk_widget_area_init' ) ) { function boozurk_widget_area_init() { // Area 0, in the fixed sidebar. register_sidebar( array( 'name' => __( 'Fixed Widget Area', 'boozurk' ), 'id' => 'fixed-widget-area', 'description' => __( 'The fixed widget area', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Sidebar Widget Area', 'boozurk' ), 'id' => 'primary-widget-area', 'description' => __( 'The sidebar widget area', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 2, located under the main menu. register_sidebar( array( 'name' => __( 'Menu Widget Area', 'boozurk' ), 'id' => 'header-widget-area', 'description' => __( 'The widget area under the main menu', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 3, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'First Footer Widget Area', 'boozurk' ), 'id' => 'first-footer-widget-area', 'description' => __( 'The first footer widget area', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 4, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Second Footer Widget Area', 'boozurk' ), 'id' => 'second-footer-widget-area', 'description' => __( 'The second footer widget area', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 5, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Third Footer Widget Area', 'boozurk' ), 'id' => 'third-footer-widget-area', 'description' => __( 'The third footer widget area', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 6, located in page 404. register_sidebar( array( 'name' => __( 'Page 404', 'boozurk' ), 'id' => '404-widgets-area', 'description' => __( 'Enrich the page 404 with some useful widgets', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); // Area 7, located after the post body. register_sidebar( array( 'name' => __( 'Post Widget Area', 'boozurk' ), 'id' => 'single-widgets-area', 'description' => __( 'a widget area located after the post body', 'boozurk' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); } } // Add style element for custom theme options if ( !function_exists( 'boozurk_custom_style' ) ) { function boozurk_custom_style(){ global $boozurk_opt, $bz_is_mobile_browser; if ( $bz_is_mobile_browser ) return; // skip if in mobile view ?> ' . get_the_time( get_option( 'date_format' ) ) . ''; } } // Pages Menu if ( !function_exists( 'boozurk_pages_menu' ) ) { function boozurk_pages_menu() { echo ''; } } // Pages Menu (mobile) if ( !function_exists( 'boozurk_pages_menu_mobile' ) ) { function boozurk_pages_menu_mobile() { echo '
'; } } // page hierarchy if ( !function_exists( 'boozurk_multipages' ) ) { function boozurk_multipages(){ global $post; $args = array( 'post_type' => 'page', 'post_parent' => $post->ID, 'order' => 'ASC', 'orderby' => 'menu_order', 'numberposts' => 0, 'no_found_rows' => true ); $childrens = get_posts( $args ); // retrieve the child pages $has_herarchy = false; if ( $childrens ) { $the_child_list = ''; foreach ($childrens as $children) { $the_child_list[] = '' . get_the_title( $children ) . ''; } $the_child_list = implode(' | ' , $the_child_list); echo '
 ' . $the_child_list . '
'; // echoes the childs $has_herarchy = true; } return $has_herarchy; } } //Display navigation to next/previous post when applicable if ( !function_exists( 'boozurk_single_nav' ) ) { function boozurk_single_nav() { global $post, $boozurk_opt; if ( $boozurk_opt['boozurk_browse_links'] == 0 ) return; $next = get_previous_post(); $prev = get_next_post(); ?> '', 'fallback' => '', 'featured' => true, 'href' => get_permalink(), 'target' => '', 'title' => the_title_attribute( array('echo' => 0 ) ) ); $args = wp_parse_args( $args, $defaults ); $post_title = $args['alternative'] ? $args['alternative'] : get_the_title(); $post_title = $post_title ? $post_title : $args['fallback']; $link_target = $args['target'] ? ' target="'.$args['target'].'"' : ''; if ( $post_title ) $post_title = '

' . $post_title . '

'; switch ( $boozurk_opt['boozurk_featured_title'] ) { case 'none': $args['featured'] = false; break; case 'lists': if ( is_singular() ) $args['featured'] = false; break; case 'single': if ( !is_singular() ) $args['featured'] = false; break; } // Check if this is a post or page, if it has a thumbnail, and if it's a big one if ( $args['featured'] && has_post_thumbnail( $post->ID ) && ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) ) { ?>
> ID, 'post-thumbnail' ); ?>
ID ) ) { echo '
' . get_the_post_thumbnail( $post->ID, 'thumbnail') . '
'; } ?> post_author; $name = get_the_author_meta('nickname', $author); $alt_name = get_the_author_meta('user_nicename', $author); $avatar = get_avatar($author, $av_size, 'Gravatar Logo', $alt_name.'-photo'); $description = get_the_author_meta('description', $author); $author_link = get_author_posts_url($author); ?>
' . __( 'Categories', 'boozurk' ) . ': ' . ''; the_category( ', ' ); echo '
'; } ?> ' . __( 'Tags', 'boozurk' ) . ': ' . ''; if ( !get_the_tags() ) { _e( 'No Tags', 'boozurk' ); } else { the_tags('', ', ', ''); } echo '
'; } ?> ' . __( 'Published on', 'boozurk' ) . ': ' . ''; echo '' . get_the_time( get_option( 'date_format' ) ) . ''; } ?> 24, 'echo' => true ); $args = wp_parse_args( $args, $defaults ); $share = array(); $pName = rawurlencode($post->post_title); $pHref = rawurlencode(get_permalink($post->ID)); $pPict = rawurlencode(wp_get_attachment_url(get_post_thumbnail_id($post->ID))); $share['Twitter'] = array('Twitter', 'http://twitter.com/home?status='.$pName.' - '.$pHref); $share['Facebook'] = array('Facebook', 'http://www.facebook.com/sharer.php?u='.$pHref.'&t='.$pName); $share['Sina'] = array('Weibo', 'http://v.t.sina.com.cn/share/share.php?url='.$pHref); $share['Tencent'] = array('Tencent', 'http://v.t.qq.com/share/share.php?url='.$pHref.'&title='.$pName.'&pic='.$pPict); $share['Qzone'] = array('Qzone', 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='.$pHref); $share['Buzz'] = array('Google Buzz', 'http://www.google.com/reader/link?url='.$pHref.'&title='.$pName); $share['Reddit'] = array('Reddit', 'http://reddit.com/submit?url='.$pHref.'&title='.$pName); $share['StumbleUpon'] = array('StumbleUpon', 'http://www.stumbleupon.com/submit?url='.$pHref.'&title='.$pName); $share['Digg'] = array('Digg', 'http://digg.com/submit?url='.$pHref); $share['Orkut'] = array('Orkut', 'http://promote.orkut.com/preview?nt=orkut.com&tt='.$pName.'&du='.$pHref.'&tn='.$pPict); $outer = '
'; foreach($share as $key => $btn){ $outer .= ''.$btn[0].' Button '; } $outer .= '
'; if ( $args['echo'] ) echo $outer; else return $outer; } } //Image EXIF details if ( !function_exists( 'boozurk_exif_details' ) ) { function boozurk_exif_details(){ global $post; ?>
1) { if ((number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 1)) == 1.3 or number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 1) == 1.5 or number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 1) == 1.6 or number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 1) == 2.5){ $bz_pshutter = "1/" . number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 1, '.', ''); } else { $bz_pshutter = "1/" . number_format((1 / $bz_imgmeta['image_meta']['shutter_speed']), 0, '.', ''); } } else { $bz_pshutter = $bz_imgmeta['image_meta']['shutter_speed']; } // Start to display EXIF and IPTC data of digital photograph echo __("Width", "boozurk" ) . ": " . $bz_imgmeta['width']."px
"; echo __("Height", "boozurk" ) . ": " . $bz_imgmeta['height']."px
"; if ( $bz_imgmeta['image_meta']['created_timestamp'] ) echo __("Date Taken", "boozurk" ) . ": " . date("d-M-Y H:i:s", $bz_imgmeta['image_meta']['created_timestamp'])."
"; if ( $bz_imgmeta['image_meta']['copyright'] ) echo __("Copyright", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['copyright']."
"; if ( $bz_imgmeta['image_meta']['credit'] ) echo __("Credit", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['credit']."
"; if ( $bz_imgmeta['image_meta']['title'] ) echo __("Title", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['title']."
"; if ( $bz_imgmeta['image_meta']['caption'] ) echo __("Caption", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['caption']."
"; if ( $bz_imgmeta['image_meta']['camera'] ) echo __("Camera", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['camera']."
"; if ( $bz_imgmeta['image_meta']['focal_length'] ) echo __("Focal Length", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['focal_length']."mm
"; if ( $bz_imgmeta['image_meta']['aperture'] ) echo __("Aperture", "boozurk" ) . ": f/" . $bz_imgmeta['image_meta']['aperture']."
"; if ( $bz_imgmeta['image_meta']['iso'] ) echo __("ISO", "boozurk" ) . ": " . $bz_imgmeta['image_meta']['iso']."
"; if ( $bz_pshutter ) echo __("Shutter Speed", "boozurk" ) . ": " . sprintf( '%s seconds', $bz_pshutter) . "
" ?>
' . category_description() . ''; } } elseif (is_author()) { echo '
' . __( 'Author','boozurk' ) . ': ' . wp_title( '',false,'right' ) . ''; $bz_author = get_queried_object(); // If a user has filled out their description, show a bio on their entries. if ( $bz_author->description ) { ?>
user_email, 32, $default= get_template_directory_uri() . '/images/user.png','user-avatar' ); ?> twitter ) echo 'twitter'; if ( $bz_author->facebook ) echo 'facebook'; ?>
description; ?>
'; } elseif ( is_page() ) { boozurk_multipages(); } } } // the last commenters of a post if ( !function_exists( 'boozurk_last_comments' ) ) { function boozurk_last_comments( $id , $num = 5 ) { global $boozurk_opt; $comments = get_comments( 'status=approve&number=' . $num . '&type=comment&post_id=' . $id ); // valid type values (not documented) : 'pingback','trackback','comment' if ( $comments ) { ?>
 
comment_author );?>
comment_author; ?>

comment_ID ); ?>
', $suffix = '
') { global $wp_query, $post; $opt = array(); $opt['home'] = "Home"; $opt['sep'] = ' '; $opt['archiveprefix'] = "Archives for"; $opt['searchprefix'] = "Search for"; $nofollow = ' rel="nofollow" '; if (!function_exists('boozurk_get_category_parents')) { // Copied and adapted from WP source function boozurk_get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE){ $chain = ''; $parent = &get_category($id); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->cat_name; if ( $parent->parent && ($parent->parent != $parent->term_id) ) $chain .= get_category_parents($parent->parent, true, $separator, $nicename); $chain .= $name; return $chain; } } $on_front = get_option('show_on_front'); if ($on_front == "page") { $homelink = ' '; $bloglink = $homelink.' '.$opt['sep'].' '.get_the_title(get_option('page_for_posts')).''; } else { $homelink = ' '; $bloglink = $homelink; } if ( ($on_front == "page" && is_front_page()) || ($on_front == "posts" && is_home()) ) { $output = $homelink.' '.$opt['sep'].' '.''.$opt['home'].''; } elseif ( $on_front == "page" && is_home() ) { $output = $homelink.' '.$opt['sep'].' '.''.get_the_title(get_option('page_for_posts')).''; } elseif ( !is_page() ) { $output = $bloglink.' '.$opt['sep'].' '; if ( is_single() && has_category() ) { $cats = get_the_category(); $cat = $cats[0]; if ( is_object($cat) ) { if ($cat->parent != 0) { $output .= get_category_parents($cat->term_id, true, " ".$opt['sep']." "); } else { $output .= ''.$cat->name.' '.$opt['sep'].' '; } } } if ( is_category() ) { $cat = intval( get_query_var('cat') ); $output .= ''.boozurk_get_category_parents($cat, false, " ".$opt['sep']." ").' ('.$wp_query->found_posts.')'.''; } elseif ( is_tag() ) { $output .= ''.$opt['archiveprefix']." ".single_cat_title('',false).' ('.$wp_query->found_posts.')'.''; } elseif ( is_404() ) { $output .= ''.__( 'Page not found','boozurk' ).''; } elseif ( is_date() ) { $output .= ''.$opt['archiveprefix']." ".single_month_title(' ',false).' ('.$wp_query->found_posts.')'.''; } elseif ( is_author() ) { $user = get_userdatabylogin($wp_query->query_vars['author_name']); $output .= ''.$opt['archiveprefix']." ".$user->display_name.' ('.$wp_query->found_posts.')'.''; } elseif ( is_search() ) { $output .= ''.$opt['searchprefix'].' "'.stripslashes(strip_tags(get_search_query())).'" ('.$wp_query->found_posts.')'.''; } elseif ( is_attachment() ) { if ( $post->post_parent ) { $output .= ''.get_the_title( $post->post_parent ).' '.$opt['sep']; } $output .= ''.get_the_title().''; } else if ( is_tax() ) { $taxonomy = get_taxonomy ( get_query_var('taxonomy') ); $term = get_query_var('term'); $output .= ''.$taxonomy->label .': '. $term.' ('.$wp_query->found_posts.')'.''; } else { if ( get_query_var('page') ) { $output .= ''.get_the_title().' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output .= ''.get_the_title().''; } } } else { $post = $wp_query->get_queried_object(); // If this is a top level Page, it's simple to output the breadcrumb if ( 0 == $post->post_parent ) { if ( get_query_var('page') ) { $output = $homelink.' '.$opt['sep'].' '.get_the_title().' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output = $homelink." ".$opt['sep']." ".''.get_the_title().''; } } else { if (isset($post->ancestors)) { if (is_array($post->ancestors)) $ancestors = array_values($post->ancestors); else $ancestors = array($post->ancestors); } else { $ancestors = array($post->post_parent); } // Reverse the order so it's oldest to newest $ancestors = array_reverse($ancestors); // Add the current Page to the ancestors list (as we need it's title too) $ancestors[] = $post->ID; $links = array(); foreach ( $ancestors as $ancestor ) { $tmp = array(); $tmp['title'] = strip_tags( get_the_title( $ancestor ) ); $tmp['url'] = get_permalink($ancestor); $tmp['cur'] = false; if ($ancestor == $post->ID) { $tmp['cur'] = true; } $links[] = $tmp; } $output = $homelink; foreach ( $links as $link ) { $output .= ' '.$opt['sep'].' '; if (!$link['cur']) { $output .= ''.$link['title'].''; } else { if ( get_query_var('page') ) { $output .= ''.$link['title'].' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output .= ''.$link['title'].''; } } } } } if ( get_query_var('paged') ) { $output .= ' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('paged').''; } echo $prefix; echo $output; boozurk_search_reminder(); echo $suffix; } if (!function_exists('boozurk_navbuttons')) { function boozurk_navbuttons( $print = 1, $comment = 1, $feed = 1, $trackback = 1, $home = 1, $next_prev = 1, $up_down = 1, $fixed = 1 ) { global $post, $boozurk_opt, $bz_is_allcat_page; $is_post = is_single() && !is_attachment() && !$bz_is_allcat_page; $is_image = is_attachment() && !$bz_is_allcat_page; $is_page = is_singular() && !is_single() && !is_attachment() && !$bz_is_allcat_page; $is_singular = is_singular() && !$bz_is_allcat_page; ?> $class ) ); } else { if ( function_exists( 'get_post_format' ) && get_post_format( $id ) ) { $format = get_post_format( $id ); } else { $format = 'standard'; } return 'thumb'; } } } // Get first image of a post if ( !function_exists( 'boozurk_get_first_image' ) ) { function boozurk_get_first_image() { global $post, $posts; $first_info = array( 'img' => '', 'title' => '', 'src' => '' ); //search the images in post content preg_match_all( '/]+>/i',$post->post_content, $result ); //grab the first one if ( isset( $result[0][0] ) ){ $first_info['img'] = $result[0][0]; $first_img = $result [0][0]; //get the title (if any) preg_match_all( '/(title)=("[^"]*")/i',$first_img, $img_title ); if ( isset( $img_title[2][0] ) ){ $first_info['title'] = str_replace( '"','',$img_title[2][0] ); } //get the path preg_match_all( '/(src)=("[^"]*")/i',$first_img, $img_src ); if ( isset( $img_src[2][0] ) ){ $first_info['src'] = str_replace( '"','',$img_src[2][0] ); } return $first_info; } else { return false; } } } // Get first link of a post if ( !function_exists( 'boozurk_get_first_link' ) ) { function boozurk_get_first_link() { global $post, $posts; $first_info = array( 'anchor' => '', 'title' => '', 'href' => '', 'text' => '' ); //search the link in post content preg_match_all( "/]*>(.*?)<\/a>/i",$post->post_content, $result ); //grab the first one if ( isset( $result[0][0] ) ){ $first_info['anchor'] = $result[0][0]; $first_info['text'] = isset( $result[1][0] ) ? $result[1][0] : ''; //get the title (if any) preg_match_all( '/(title)=(["\'][^"]*["\'])/i',$first_info['anchor'], $link_title ); $first_info['title'] = isset( $link_title[2][0] ) ? str_replace( array('"','\''),'',$link_title[2][0] ) : ''; //get the path preg_match_all( '/(href)=(["\'][^"]*["\'])/i',$first_info['anchor'], $link_href ); $first_info['href'] = isset( $link_href[2][0] ) ? str_replace( array('"','\''),'',$link_href[2][0] ) : ''; return $first_info; } else { return false; } } } // Get first blockquote words if ( !function_exists( 'boozurk_get_blockquote' ) ) { function boozurk_get_blockquote() { global $post, $posts; $first_quote = array( 'quote' => '', 'cite' => '' ); //search the blockquote in post content preg_match_all( '/]*>([\w\W]*?)<\/blockquote>/',$post->post_content, $blockquote ); //grab the first one if ( isset( $blockquote[0][0] ) ){ $first_quote['quote'] = strip_tags( $blockquote[0][0] ); $words = explode( " ", $first_quote['quote'], 6 ); if ( count( $words ) == 6 ) $words[5] = '...'; $first_quote['quote'] = implode( ' ', $words ); preg_match_all( '/([\w\W]*?)<\/cite>/',$blockquote[0][0], $cite ); $first_quote['cite'] = ( isset( $cite[1][0] ) ) ? $cite[1][0] : ''; return $first_quote; } else { return false; } } } // search for linked mp3's and add an audio player if ( !function_exists( 'boozurk_add_audio_player' ) ) { function boozurk_add_audio_player( $text = '' ) { global $boozurk_opt, $bz_is_mobile_browser, $bz_is_printpreview, $post; if ( is_admin() || $bz_is_mobile_browser || $bz_is_printpreview ) return; $pattern = "/([^<]+)<\/a>/i"; if ( $text == '') preg_match_all( $pattern, $post->post_content, $result ); else preg_match_all( $pattern, $text, $result ); foreach ($result[0] as $key => $value) { ?>
$val ) { if( $boozurk_coa[$key]['type'] == 'chk' ) { if( !isset( $input[$key] ) ) { $input[$key] = 0; } else { $input[$key] = ( $input[$key] == 1 ? 1 : 0 ); } } elseif( $boozurk_coa[$key]['type'] == 'sel' ) { if ( !in_array( $input[$key], $boozurk_coa[$key]['options'] ) ) $input[$key] = $boozurk_coa[$key]['default']; } elseif( $boozurk_coa[$key]['type'] == 'col' ) { $color = str_replace( '#' , '' , $input[$key] ); $color = preg_replace( '/[^0-9a-fA-F]/' , '' , $color ); $input[$key] = '#' . $color; } elseif( $boozurk_coa[$key]['type'] == 'url' ) { $input[$key] = esc_url( $input[$key] ); } } foreach ( $input['boozurk_cat_colors'] as $key => $val ) { $color = str_replace( '#' , '' , $input['boozurk_cat_colors'][$key] ); $color = preg_replace( '/[^0-9a-fA-F]/' , '' , $color ); $input['boozurk_cat_colors'][$key] = '#' . $color; } // check for required options foreach ( $boozurk_coa as $key => $val ) { if ( $boozurk_coa[$key]['req'] != '' ) { if ( $input[$boozurk_coa[$key]['req']] == ( 0 || '') ) $input[$key] = 0; } } $input['version'] = $boozurk_current_theme['Version']; // keep version number return $input; } } // the custon header style - called only on your theme options page if ( !function_exists( 'boozurk_theme_admin_styles' ) ) { function boozurk_theme_admin_styles() { wp_enqueue_style( 'bz-options-style', get_template_directory_uri() . '/css/options.css', array('farbtastic','thickbox'), '', 'screen' ); ?>

' . __( 'Options saved.','boozurk' ) . '

'; } ?>

$val) { ?>
/>
 - 
'name', 'order' => 'ASC' ); $categories=get_categories($args); foreach($categories as $category) { $hexnumber = '#'; for ($i2=1; $i2<=3; $i2++) { $hexnumber .= dechex( rand(64,256) ); } $catcolor = isset($boozurk_opt[$key][$category->term_id]) ? $boozurk_opt[$key][$category->term_id] : $hexnumber; ?> name; ?>
 -  description ) { ?>
description; ?>
$subval) { ?> : />
 - 

' . __('requires','boozurk') . ': ' . $boozurk_coa[$boozurk_coa[$key]['req']]['description']; ?>


Support the theme in your language, provide a translation.

__( 'Main Navigation Menu', 'boozurk' ) ) ); register_nav_menus( array( 'secondary1' => __( 'Secondary Navigation Menu #1', 'boozurk' ) ) ); register_nav_menus( array( 'secondary2' => __( 'Secondary Navigation Menu #2', 'boozurk' ) ) ); // Register Features Support add_theme_support( 'automatic-feed-links' ); // Thumbnails support add_theme_support( 'post-thumbnails' ); // Add the editor style if ( isset( $boozurk_opt['boozurk_editor_style'] ) && ( $boozurk_opt['boozurk_editor_style'] == 1 ) ) add_editor_style( 'css/editor-style.css' ); // This theme uses post formats add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); } } //add a default gravatar if ( !function_exists( 'boozurk_addgravatar' ) ) { function boozurk_addgravatar( $avatar_defaults ) { $myavatar = get_template_directory_uri() . '/images/user.png'; $avatar_defaults[$myavatar] = __( 'boozurk Default Gravatar', 'boozurk' ); return $avatar_defaults; } add_filter( 'avatar_defaults', 'boozurk_addgravatar' ); } // pages navigation links if ( !function_exists( 'boozurk_page_navi' ) ) { function boozurk_page_navi($this_page_id) { $pages = get_pages( array('sort_column' => 'menu_order') ); // get the menu-ordered list of the pages $page_links = array(); foreach ($pages as $k => $pagg) { if ( $pagg->ID == $this_page_id ) { // we are in this $pagg if ( $k == 0 ) { // is first page $page_links['next']['link'] = get_page_link($pages[1]->ID); $page_links['next']['title'] = $pages[1]->post_title; if ( $page_links['next']['title'] == '' ) $page_links['next']['title'] = __( '(no title)','boozurk' ); } elseif ( $k == ( count( $pages ) -1 ) ) { // is last page $page_links['prev']['link'] = get_page_link($pages[$k - 1]->ID); $page_links['prev']['title'] = $pages[$k - 1]->post_title; if ( $page_links['prev']['title'] == '' ) $page_links['prev']['title'] = __( '(no title)','boozurk' ); } else { $page_links['next']['link'] = get_page_link($pages[$k + 1]->ID); $page_links['next']['title'] = $pages[$k + 1]->post_title; if ( $page_links['next']['title'] == '' ) $page_links['next']['title'] = __( '(no title)','boozurk' ); $page_links['prev']['link'] = get_page_link($pages[$k - 1]->ID); $page_links['prev']['title'] = $pages[$k - 1]->post_title; if ( $page_links['prev']['title'] == '' ) $page_links['prev']['title'] = __( '(no title)','boozurk' ); } } } return $page_links; } } //Displays the amount of time since a post or page was written in a nice friendly manner. //Based on Plugin: Date in a nice tone (http://wordpress.org/extend/plugins/date-in-a-nice-tone/) if ( !function_exists( 'boozurk_friendly_date' ) ) { function boozurk_friendly_date() { $postTime = get_the_time('U'); $currentTime = time(); $timeDifference = $currentTime - $postTime; $minInSecs = 60; $hourInSecs = 3600; $dayInSecs = 86400; $monthInSecs = $dayInSecs * 31; $yearInSecs = $dayInSecs * 366; //if over 2 years if ($timeDifference > ($yearInSecs * 2)) { $dateWithNiceTone = __( 'quite a long while ago...', 'boozurk' ); //if over a year } else if ($timeDifference > $yearInSecs) { $dateWithNiceTone = __( 'over a year ago', 'boozurk' ); //if over 2 months } else if ($timeDifference > ($monthInSecs * 2)) { $num = round($timeDifference / $monthInSecs); $dateWithNiceTone = sprintf(__('%s months ago', 'boozurk' ),$num); //if over a month } else if ($timeDifference > $monthInSecs) { $dateWithNiceTone = __( 'a month ago', 'boozurk' ); //if more than 2 days ago } else { $htd = human_time_diff( get_the_time('U'), current_time('timestamp') ); $dateWithNiceTone = sprintf(__('%s ago', 'boozurk' ), $htd ); } echo $dateWithNiceTone; } } // create a random nick name if ( !function_exists( 'boozurk_random_nick' ) ) { function boozurk_random_nick ( ) { $prefix = array( 'ATX-', 'Adorable ', 'Adventurous ', 'Alien ', 'Angry ', 'Annoyed ', 'Anxious ', 'Atrocious ', 'Attractive ', 'Bad ', 'Bad ', 'Barbarious ', 'Bavarian ', 'Beautiful ', 'Bewildered ', 'Bitter ', 'Black ', 'Blond ', 'Blue ', 'Blue-Eyed ', 'Bored ', 'Breezy ', 'Bright ', 'Brown ', 'Cloudy ', 'Clumsy ', 'Colorful ', 'Combative ', 'Condemned ', 'Confused ', 'Cool ', 'Crazy ', 'Creepy ', 'Cruel ', 'Cubic ', 'Curly ', 'Cute ', 'Dance ', 'Dangerous ', 'Dark ', 'Death ', 'Delicious ', 'Dinky ', 'Distinct ', 'Disturbed ', 'Dizzy ', 'Drunk ', 'Drunken ', 'Dull ', 'Dumb ', 'E-', 'Electro ', 'Elegant ', 'Elite ', 'Embarrassed ', 'Envious ', 'Evil ', 'Fancy ', 'Fast ', 'Fat ', 'Fierce ', 'Flipped-out ', 'Flying ', 'Fourios ', 'Frantic ', 'Fresh ', 'Frustraded ', 'Funny ', 'Furious ', 'Fuzzy ', 'Gameboy ', 'Giant ', 'Giga ', 'Green ', 'Handsome ', 'Hard ', 'Harsh ', 'Hazardous ', 'Hiphop ', 'Hi-res ', 'Holy ', 'Horny ', 'Hot ', 'House ', 'i-', 'Icy ', 'Infested ', 'Insane ', 'Joyous ', 'Kentucky Fried ', 'Lame ', 'Leaking ', 'Lone ', 'Lovely ', 'Lucky ', 'Mc', 'Melodic ', 'Micro ', 'Mighty ', 'Mini ', 'Mutated ', 'Nasty ', 'Nice ', 'Orange ', 'PS/2-', 'Pretty ', 'Purple ', 'Purring ', 'Quiet ', 'Radioactive ', 'Red ', 'Resonant ', 'Salty ', 'Sexy ', 'Slow ', 'Smooth ', 'Stinky ', 'Strong ', 'Supa-Dupa-', 'Super ', 'USB-', 'Ugly ', 'Unholy ', 'Vivacious ', 'Whispering ', 'White ', 'Wild ', 'X', 'XBox ', 'Yellow ' ); $suffix = array( '16', '3', '6', '7', 'Abe', 'Bee', 'Bird', 'Boy', 'Cat', 'Cow', 'Crow', 'Cypher', 'DJ', 'Dad', 'Deer', 'Dog', 'Donkey', 'Duck', 'Eagle', 'Elephant', 'Fly', 'Fox', 'Frog', 'Girl', 'Girlie', 'Guinea Pig', 'Hasi', 'Hawk', 'Jackal', 'Lizard', 'MC', 'Men', 'Mom', 'Morpheus', 'Mouse', 'Mule', 'Neo', 'Pig', 'Rabbit', 'Rat', 'Rhino', 'Smurf', 'Snail', 'Snake', 'Star', 'Tank', 'Tiger', 'Wolf', 'Butterfly', 'Elk', 'Godzilla', 'Horse', 'Penguin', 'Pony', 'Reindeer', 'Sheep', 'Sock-Puppet', 'Worm', 'Bermuda' ); return $prefix[array_rand($prefix)] . $suffix[array_rand($suffix)]; } } // add 'quoted on' before trackback/pingback comments link if ( !function_exists( 'boozurk_add_quoted_on' ) ) { function boozurk_add_quoted_on( $return ) { global $comment; $text = ''; if ( get_comment_type() != 'comment' ) { $text = '' . __( 'quoted on', 'boozurk' ) . ' '; } return $text . $return; } } // custom image caption if ( !function_exists( 'boozurk_img_caption_shortcode' ) ) { function boozurk_img_caption_shortcode( $deprecated, $attr, $content = null ) { extract(shortcode_atts(array( 'id' => '', 'align' => 'alignnone', 'width' => '', 'caption' => '' ), $attr)); if ( 1 > (int) $width || empty($caption) ) return $content; if ( $id ) $id = 'id="' . esc_attr($id) . '" '; return '
' . do_shortcode( $content ) . '
' . $caption . '
'; } } /** * Create HTML list of nav menu items. * Replacement for the native Walker, using the thumbnail. * * @see http://wordpress.stackexchange.com/q/14037/ * @author toscho, http://toscho.de */ class boozurk_Thumb_Walker extends Walker_Nav_Menu { /** * Start the element output. * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. May be used for padding. * @param array $args Additional strings. * @return void */ function start_el(&$output, $item, $depth, $args) { global $boozurk_opt; $classes = empty ( $item->classes ) ? array () : (array) $item->classes; $class_names = join( ' ' , apply_filters( 'nav_menu_css_class' , array_filter( $classes ), $item ) ); ! empty ( $class_names ) and $class_names = ' class="'. esc_attr( $class_names ) . '"'; $output .= "