Support the theme in your language, provide a translation.
$val ) { $the_opt[$key] = $the_coa[$key]['default']; } $the_opt['version'] = ''; //null value to keep admin notice alive and invite user to discover theme options update_option( 'boozurk_options' , $the_opt ); } else if ( !isset( $the_opt['version'] ) || $the_opt['version'] < $boozurk_version ) { // check for unset values and set them to default value -> when updated to new version foreach ( $the_coa as $key => $val ) { if ( !isset( $the_opt[$key] ) ) $the_opt[$key] = $the_coa[$key]['default']; } $the_opt['version'] = ''; //null value to keep admin notice alive and invite user to discover theme options update_option( 'boozurk_options' , $the_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( __( "%s theme says: \"Dont forget to set my options!\"", 'boozurk' ), 'Boozurk', get_admin_url() . 'themes.php?page=boozurk_functions' ) . '
';
}
$outer .= ']*>([\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; } } } if ( !function_exists( 'boozurk_theme_admin_scripts' ) ) { function boozurk_theme_admin_scripts() { global $boozurk_version; wp_enqueue_script( 'boozurk-options-script', get_template_directory_uri().'/js/options.dev.js',array('jquery','farbtastic','thickbox'),$boozurk_version, true ); //thebird js $data = array( 'confirm_to_defaults' => __( 'Are you really sure you want to set all the options to their default values?', 'boozurk' ) ); wp_localize_script( 'boozurk-options-script', 'bz_l10n', $data ); } } if ( !function_exists( 'boozurk_widgets_style' ) ) { function boozurk_widgets_style() { //add custom stylesheet wp_enqueue_style( 'bz-widgets-style', get_template_directory_uri() . '/css/widgets.css', false, '', 'screen' ); } } if ( !function_exists( 'boozurk_widgets_scripts' ) ) { function boozurk_widgets_scripts() { global $boozurk_version; wp_enqueue_script( 'bz-widgets-scripts', get_template_directory_uri() . '/js/widgets.dev.js', array('jquery'), $boozurk_version, true ); } } // 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' ); } } // sanitize options value if ( !function_exists( 'boozurk_sanitize_options' ) ) { function boozurk_sanitize_options($input) { global $boozurk_version; $the_coa = boozurk_get_coa(); foreach ( $the_coa as $key => $val ) { if( $the_coa[$key]['type'] == 'chk' ) { //CHK if( !isset( $input[$key] ) ) { $input[$key] = 0; } else { $input[$key] = ( $input[$key] == 1 ? 1 : 0 ); } } elseif( $the_coa[$key]['type'] == 'sel' ) { //SEL if ( !in_array( $input[$key], $the_coa[$key]['options'] ) ) $input[$key] = $the_coa[$key]['default']; } elseif( $the_coa[$key]['type'] == 'opt' ) { //OPT if ( !in_array( $input[$key], $the_coa[$key]['options'] ) ) $input[$key] = $the_coa[$key]['default']; } elseif( $the_coa[$key]['type'] == 'col' ) { //COL $color = str_replace( '#' , '' , $input[$key] ); $color = preg_replace( '/[^0-9a-fA-F]/' , '' , $color ); $input[$key] = '#' . $color; } elseif( $the_coa[$key]['type'] == 'url' ) { //URL $input[$key] = esc_url( trim( strip_tags( $input[$key] ) ) ); } elseif( $the_coa[$key]['type'] == 'txt' ) { //TXT if( !isset( $input[$key] ) ) { $input[$key] = ''; } else { $input[$key] = trim( strip_tags( $input[$key] ) ); } } elseif( $the_coa[$key]['type'] == 'int' ) { //INT if( !isset( $input[$key] ) ) { $input[$key] = $the_coa[$key]['default']; } else { $input[$key] = (int) $input[$key] ; } } elseif( $the_coa[$key]['type'] == 'txtarea' ) { //TXTAREA if( !isset( $input[$key] ) ) { $input[$key] = ''; } else { $input[$key] = trim( strip_tags( $input[$key] ) ); } } } foreach ( $input['boozurk_cat_colors'] as $key => $val ) { //CATCOL $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 ( $the_coa as $key => $val ) { if ( $the_coa[$key]['req'] != '' ) { if ( $input[$the_coa[$key]['req']] == ( 0 || '') ) $input[$key] = 0; } } $input['version'] = $boozurk_version; // keep version number return $input; } } // the theme option page if ( !function_exists( 'boozurk_edit_options' ) ) { function boozurk_edit_options() { if ( !current_user_can( 'edit_theme_options' ) ) wp_die( 'You do not have sufficient permissions to access this page.' ); global $boozurk_opt, $boozurk_current_theme, $boozurk_version; $the_coa = boozurk_get_coa(); $the_groups = boozurk_get_coa( 'groups' ); $the_option_name = 'boozurk_options'; if ( isset( $_GET['erase'] ) ) { $_SERVER['REQUEST_URI'] = remove_query_arg( 'erase', $_SERVER['REQUEST_URI'] ); delete_option( $the_option_name ); boozurk_default_options(); $boozurk_opt = get_option( $the_option_name ); } // update version value when admin visit options page if ( $boozurk_opt['version'] < $boozurk_version ) { $boozurk_opt['version'] = $boozurk_version; update_option( $the_option_name , $boozurk_opt ); } $the_opt = $boozurk_opt; // options have been updated if ( isset( $_REQUEST['settings-updated'] ) ) { //return options save message echo ''; } // options to defaults done if ( isset( $_GET['erase'] ) ) { echo '' . __( 'Options saved.','boozurk' ) . '
'; } ?>' . __( 'Defaults values loaded.', 'boozurk' ) . '
($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; } } // 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; } } // strip tags and apply title format for blank titles function boozurk_titles_filter( $title, $id = null ) { global $boozurk_opt; if ( is_admin() ) return $title; $title = strip_tags( $title, 'Support the theme in your language, provide a translation.
' ); if ( $id == null ) return $title; if ( !$boozurk_opt['boozurk_blank_title'] ) return $title; if ( empty( $title ) ) { if ( !isset( $boozurk_opt['boozurk_blank_title_text'] ) || empty( $boozurk_opt['boozurk_blank_title_text'] ) ) return __( '(no title)', 'boozurk' ); $postdata = array( get_post_format( $id )? get_post_format_string( get_post_format( $id ) ): __( 'Post', 'boozurk' ), get_the_time( get_option( 'date_format' ), $id ), $id ); $codes = array( '%f', '%d', '%n' ); return str_replace( $codes, $postdata, $boozurk_opt['boozurk_blank_title_text'] ); } else return $title; } //set the excerpt length if ( !function_exists( 'boozurk_excerpt_length' ) ) { function boozurk_excerpt_length( $length ) { global $boozurk_opt; return (int) $boozurk_opt['boozurk_excerpt_length']; } } // use the "excerpt more" string as a link to the post function boozurk_excerpt_more( $more ) { global $boozurk_opt, $post; if ( is_admin() ) return $more; if ( isset( $boozurk_opt['boozurk_excerpt_more_txt'] ) && isset( $boozurk_opt['boozurk_excerpt_more_link'] ) ) { if ( $boozurk_opt['boozurk_excerpt_more_link'] ) { return '' . $boozurk_opt['boozurk_excerpt_more_txt'] . ''; } else { return $boozurk_opt['boozurk_excerpt_more_txt']; } } return $more; } // custom text for the "more" tag function boozurk_more_link( $more_link, $more_link_text ) { global $boozurk_opt; if ( isset( $boozurk_opt['boozurk_more_tag'] ) && !is_admin() ) { $text = str_replace ( '%t', get_the_title(), $boozurk_opt['boozurk_more_tag'] ); return str_replace( $more_link_text, $text, $more_link ); } return $more_link; } //Add new contact methods to author panel if ( !function_exists( 'boozurk_new_contactmethods' ) ) { function boozurk_new_contactmethods( $contactmethods ) { //add Twitter $contactmethods['twitter'] = 'Twitter'; //add Facebook $contactmethods['facebook'] = 'Facebook'; return $contactmethods; } } // Add Thumbnail Column in Manage Posts/Pages List function boozurk_addthumbcolumn($cols) { $cols['thumbnail'] = ucwords( __('thumbnail', 'boozurk') ); return $cols; } // Add Thumbnails in Manage Posts/Pages List function boozurk_addthumbvalue($column_name, $post_id) { $width = (int) 60; $height = (int) 60; if ( 'thumbnail' == $column_name ) { // thumbnail of WP 2.9 $thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true ); if ($thumbnail_id) $thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true ); if ( isset($thumb) && $thumb ) { echo $thumb; } else { echo ''; } } } // Add Thumbnail Column style in Manage Posts/Pages List if ( !function_exists( 'boozurk_post_manage_style' ) ) { function boozurk_post_manage_style(){ ?> ID ) . ' « '; } // Get the Site Name $site_name = get_bloginfo( 'name' ); // Append name $filtered_title = $title . $site_name; // If site front page, append description if ( is_front_page() ) { // Get the Site Description $site_description = get_bloginfo( 'description' ); // Append Site Description to title $filtered_title .= ' - ' . $site_description; } // Return the modified title return $filtered_title; } // check if in media preview mode $boozurk_is_media = false; if ( isset( $_GET['tb_media'] ) ) { $boozurk_is_media = true; } // media preview if ( !function_exists( 'boozurk_media' ) ) { function boozurk_media () { global $boozurk_is_media; if ( $boozurk_is_media ) { get_template_part( 'lib/media' ); exit; } } }