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' ) . '
]*>([\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' ) . '
'; } ?>__( '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 'Support the theme in your language, provide a translation.
'; } } /** * 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 .= ""; $attributes = ''; ! empty( $item->attr_title ) and $attributes .= ' title="' . esc_attr( $item->attr_title ) .'"'; ! empty( $item->target ) and $attributes .= ' target="' . esc_attr( $item->target ) .'"'; ! empty( $item->xfn ) and $attributes .= ' rel="' . esc_attr( $item->xfn ) .'"'; ! empty( $item->url ) and $attributes .= ' href="' . esc_attr( $item->url ) .'"'; $title = apply_filters( 'the_title', $item->title, $item->ID ); if ( 0 == $depth ) { $thumb = ''; if ( has_post_thumbnail((int)$item->object_id) ) { $thumb = get_the_post_thumbnail( (int)$item->object_id, array((int)$boozurk_opt['boozurk_main_menu_icon_size'],(int)$boozurk_opt['boozurk_main_menu_icon_size']), array( 'title' => $title, 'class' => 'bz-menu-thumb' ) ); } if ( $boozurk_opt['boozurk_main_menu'] == __('thumbnail','boozurk') ) { $title = $thumb; } elseif ( $boozurk_opt['boozurk_main_menu'] == __('thumbnail and text','boozurk') ) { $title = $thumb . $title; } } $item_output = $args->before . "" . $args->link_before . $title . ' ' . $args->link_after . $args->after; // Since $output is called by reference we don't need to return anything. $output .= apply_filters( 'walker_nav_menu_start_el' , $item_output , $item , $depth , $args ); } } // retrieve the post content, then die (for "post_expander" ajax request) if ( !function_exists( 'boozurk_post_expander_show_post' ) ) { function boozurk_post_expander_show_post ( ) { if ( have_posts() ) { while ( have_posts() ) { the_post(); the_content(); } } die(); } } //is a "post_expander" ajax request? function boozurk_post_expander_activate ( ) { if ( isset( $_POST["bz_post_expander"] ) ) { add_action( 'wp', 'boozurk_post_expander_show_post' ); } } // retrieve the posts page, then die (for "infinite_scroll" ajax request) if ( !function_exists( 'boozurk_infinite_scroll_show_page' ) ) { function boozurk_infinite_scroll_show_page ( ) { global $post, $boozurk_opt, $wp_query, $paged; if ( !$paged ) { $paged = 1; } if ( have_posts() ) { echo ' '; while ( have_posts() ) { the_post(); ?> ID ) ] ) && $boozurk_opt['boozurk_post_formats_' . get_post_format( $post->ID ) ] == 1 ) ? get_post_format( $post->ID ) : '' ; } ?> ', '', $content ); $content = str_replace( '' . sprintf( __('Page %s','boozurk'), $paged ) . '