$val){ $included_file[$key] = basename($val); } $raindrops_included_files = $included_file; $raindrops_color_file_path = get_stylesheet_directory().'/lib/csscolor/csscolor.php'; if(!in_array('csscolor.php',$raindrops_included_files) and file_exists($raindrops_color_file_path)){ require_once($raindrops_color_file_path); }elseif(!in_array('csscolor.php',$raindrops_included_files)){ require_once(get_template_directory().'/lib/csscolor/csscolor.php'); } $raindrops_color_file_path = get_stylesheet_directory().'/lib/csscolor.css.php'; if(!in_array('csscolor.css.php',$raindrops_included_files) and file_exists($raindrops_color_file_path)){ require_once($raindrops_color_file_path); }elseif(!in_array('csscolor.css.php',$raindrops_included_files)){ require_once(get_template_directory().'/lib/csscolor.css.php'); } add_filter('contextual_help','raindrops_edit_help'); /** * It has alias functions. * * * * */ $raindrops_functions_file_path = get_stylesheet_directory().'/lib/alias_functions.php'; if(!in_array('alias_functions.php',$raindrops_included_files) and file_exists($raindrops_functions_file_path)){ require_once($raindrops_functions_file_path); }elseif(!in_array('alias_functions.php',$raindrops_included_files)){ require_once(get_template_directory().'/lib/alias_functions.php'); } /** * It has hooks. * * * * */ $raindrops_functions_file_path = get_stylesheet_directory().'/lib/hooks.php'; if(!in_array('alias_functions.php',$raindrops_included_files) and file_exists($raindrops_functions_file_path)){ require_once($raindrops_functions_file_path); }elseif(!in_array('alias_functions.php',$raindrops_included_files)){ require_once(get_template_directory().'/lib/hooks.php'); } /*----- Copy this area and paste Child functions.php when functions customize / End------*/ /** * Your extend function , settings write below. * * * * */ /** * Original page width implementation by manual labor * * If you need original page width * you can specific pixel page width * e.g. '$raindrops_page_width = '776';' is 776px page width. * * */ if(!isset($raindrops_page_width)){ $raindrops_page_width = ''; } /** * Content width implementation by manual labor * * If you need specific $content_width. * value set 400 When not setting or empty. * */ //$content_width = ''; /** * 750px,950px centered layout fluid or fixed page width switch * * Empty value makes like a Elastic layout * * value 'fixed' or empty * */ if(!isset($raindrops_fluid_or_fixed)){ $raindrops_fluid_or_fixed = 'fixed'; } /** * fluid page main column minimam width px * * * * * */ if( !isset( $raindrops_fluid_minimam_width ) ){ $raindrops_fluid_minimam_width = '400'; } /** * Raindrops header and footer image upload * * * * * */ // Allow image type Raindrops footer and header. if( !isset( $raindrops_allow_file_type ) ){ $raindrops_allow_file_type = array('image/png','image/jpeg','image/jpg','image/gif'); } //max upload size byte if( !isset( $raindrops_max_upload_size ) ){ $raindrops_max_upload_size = 2000000; } //header or footer image max width px if( !isset( $raindrops_max_width ) ){ $raindrops_max_width = 1300; } /** * * * * * */ if(!defined('SHOW_DELETE_POST_LINK')){ define("SHOW_DELETE_POST_LINK",false); } /** * the_content() or the_excerpt * * the_excerpt use where index,archive,other not single pages. * If RAINDROPS_USE_LIST_EXCERPT value false and use the_content . * */ if(!defined('RAINDROPS_USE_LIST_EXCERPT')){ define("RAINDROPS_USE_LIST_EXCERPT",false); } /** * Auto Color On or Off * If you want no Auto Color when set value false. * * * * */ if(!defined('RAINDROPS_USE_AUTO_COLOR')){ define("RAINDROPS_USE_AUTO_COLOR",true); } /** * header text * * * * * */ if(!defined('NO_HEADER_TEXT')){ define('NO_HEADER_TEXT', false ); } /** * title and description default color * * * * * */ if(!defined('HEADER_TEXTCOLOR')){ define('HEADER_TEXTCOLOR', 'dddddd'); } /** * header image * * * * * */ if(!defined('HEADER_IMAGE')){ if(file_exists(get_stylesheet_directory().'/images/headers/wp3.jpg')){ define('HEADER_IMAGE', get_stylesheet_directory_uri().'/images/headers/wp3.jpg'); }else{ define('HEADER_IMAGE', get_template_directory_uri().'/images/headers/wp3.jpg'); } } if(!defined('HEADER_IMAGE_WIDTH')){ define('HEADER_IMAGE_WIDTH', 950); } if(!defined('HEADER_IMAGE_HEIGHT')){ define('HEADER_IMAGE_HEIGHT', 198); } /** * Monthly archive, Daily archive time format * * * * * */ if(!defined('RAINDROPS_TABLE_TITLE')){ define("RAINDROPS_TABLE_TITLE",'options'); } if(!defined('RAINDROPS_PLUGIN_TABLE')){ define('RAINDROPS_PLUGIN_TABLE',$wpdb->prefix . RAINDROPS_TABLE_TITLE); } if(!isset($raindrops_theme_settings)){ $raindrops_theme_settings = get_option('raindrops_theme_settings','no'); } /** * single-post-thumbnail * * * * */ if(!defined('RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH')){ define('RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH',600); } if(!defined('RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT')){ define('RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT',200); } add_image_size( 'single-post-thumbnail', RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH, RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT, true); /** * widget settings * * Registered Default Sidebar, Extra Sidebar, Sticky Widget, Footer Widget, Category Blog Widget * * * */ if(!function_exists('raindrops_widgets_init')){ function raindrops_widgets_init() { register_sidebar(array ( 'name' => __('Default Sidebar', 'Raindrops'), 'id' => 'sidebar-1', 'before_widget' => '
permalink.', 'Raindrops' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'Raindrops' ); } else { $posted_in = __( 'Bookmark the permalink.', 'Raindrops' ); } // Prints the string, replacing the placeholders. $result = sprintf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); echo apply_filters("raindrops_posted_in",$result); } } /** * Template function posted_on * * * * loop.php * */ if (!function_exists('raindrops_posted_on')) { function raindrops_posted_on() { $raindrops_date_format = get_option('date_format'); $author = raindrops_blank_fallback(get_the_author(),'Somebody'); if (comments_open()){ $raindrops_comment_html = '%2$s %3$s'; if(get_comments_number() > 0 ){ $raindrops_comment_string = _n('Comment','Comments',get_comments_number(),'Raindrops'); $raindrops_comment_number = get_comments_number(); }else{ $raindrops_comment_string = 'Comment'; $raindrops_comment_number = ''; } }else{ $raindrops_comment_html = ''; $raindrops_comment_string = ''; $raindrops_comment_number = ''; } $result = sprintf( __( 'Posted on %2$s %3$s %4$s' , 'Raindrops' ), 'meta-prep meta-prep-author', sprintf( '%3$s', get_permalink(), esc_attr( get_the_time($raindrops_date_format) ), get_the_date() ), sprintf( ' ', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), $author ), $author ), sprintf($raindrops_comment_html,get_comments_link(),$raindrops_comment_number,$raindrops_comment_string) ); echo apply_filters("raindrops_posted_on",$result); } } /** * Special custom fields key css, javascript, metatags * * * css,javascrip,meta is separated anothor Custom Field. * * */ if (!function_exists('raindrops_filter_explode_meta_keys')) { function raindrops_filter_explode_meta_keys( $content, $key ) { $explode_keys = array( 'css', 'javascript', 'meta'); if ( in_array( $key, $explode_keys ) ) return; else return $content; } } /** * Like a get_option() * * * Raindrops conditional response. * * for templates */ if (!function_exists('raindrops_warehouse')) { function raindrops_warehouse($name){ return apply_filters("raindrops_warehouse",raindrops_warehouse_clone($name)); } } /** * Return $raindrops_base_setting value. * * * * * */ if (!function_exists('raindrops_admin_meta')) { function raindrops_admin_meta($name,$meta_name){ global $raindrops_base_setting; global $raindrops_page_width; $vertical = array(); foreach($raindrops_base_setting as $key=>$val){ if(!is_null($raindrops_base_setting)){ $vertical[] = $val['option_name']; } } $row = array_search($name,$vertical); return __($raindrops_base_setting[$row][$meta_name],'Raindrops'); } } /** * Admin Panel help * * * * * */ if (!function_exists('raindrops_help')) { function raindrops_help($text){ global $title; if(RAINDROPS_TABLE_TITLE == $title){ $result = "
".sprintf(__('WEBSite:%2$s'),'http://www.tenman.info/wp3/raindrops','Raindrops').'
'; return $result; }else{ return $text; } } } /** * Raindrops edit help * * * Check the real color of the Cradation Class and the Color Class. * * */ if (!function_exists('raindrops_edit_help') and RAINDROPS_USE_AUTO_COLOR == true) { function raindrops_edit_help($text,$force = false){ global $post_type_object; global $title; if((isset($post_type_object) and ($title == $post_type_object->labels->add_new_item or $title == $post_type_object->labels->edit_item) or $force == true)){ $result = "'.__('If Raindrops Options panel is opened, and the reference color is set, this arrangement of color is changed at once.',"Raindrops")."
"; $result .= "class color5 | class color4 | class color3 | class color2 | class color1 |
class color-1 | class color-2 | class color-3 | class color-4 | class color-5 |
'.__('code example:please HTML editor mode','Raindrops').'
<div class="color3">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</div>
|
class gradient5 | class gradient4 | class gradient3 | class gradient2 | class gradient1 |
class gradient-1 | class gradient-2 | class gradient-3 | class gradient-4 | class gradient-5 |
'.__('code example:please HTML editor mode','Raindrops').'
<div class="gradient3">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> |
".__('image width and height aspect ratio is 3:1. another aspect ratio will be trimming center','Raindrops').'
'.__('Option','Raindrops').'
'; return apply_filters("raindrops_comment_form",$form); } } /** * filter function remove area required * * * * */ if(!function_exists("custom_remove_aria_required1")){ function custom_remove_aria_required1($arg){ $change = array("aria-required=\"true\"","aria-required='true'"); $arg = str_replace($change,'',$arg); return $arg; } } /** * filter function remove area required * * * * */ if(!function_exists("custom_remove_aria_required2")){ function custom_remove_aria_required2($args) { $change = array("aria-required=\"true\"","aria-required='true'"); if(isset($args['author'])){ $args['author'] = str_replace($change,'',$args['author']); } if(isset($args['email'])){ $args['email'] = str_replace($change,'',$args['email']); } return $args; } } /** * Option value set when install. * * * * */ if(!function_exists("setup_raindrops")){ function setup_raindrops(){ global $wpdb,$raindrops_base_setting; if(RAINDROPS_USE_AUTO_COLOR == false){ return; } $raindrops_theme_settings = get_option('raindrops_theme_settings'); foreach($raindrops_base_setting as $add){ $option_name = $add['option_name']; if(!isset($raindrops_theme_settings[$option_name])){ $raindrops_theme_settings[$option_name] = $add['option_value']; } } $style_type = raindrops_warehouse_clone("raindrops_style_type"); $raindrops_indv_css = raindrops_design_output_clone($style_type).raindrops_color_base_clone(); $raindrops_theme_settings['_raindrops_indv_css'] = $raindrops_indv_css; update_option('raindrops_theme_settings',$raindrops_theme_settings,"",$add['autoload']); } } /** * image element has attribute 'width','height' and image size > column width * style max-width value 100% set when expand height height attribute value. * * IE filter * */ if(!function_exists("raindrops_ie_height_expand_issue")){ function raindrops_ie_height_expand_issue($content){ global $is_IE,$content_width; if($is_IE){ preg_match_all('#(]+)(height|width)(=")([0-9]+)"([^>]+)(height|width)(=")([0-9]+)"([^>]+)>#',$content,$images,PREG_SET_ORDER); foreach($images as $image){ if(($image[3] == "width" and $image[5] > $content_width) or ($image[7] == "width" and $image[9] > $content_width)){ $content = str_replace($image[0],$image[1].$image[2].$image[6].$image[10].'>',$content); } } return $content; }else{ return $content; } } } /** * Raindrops once message when install. * * * * * */ if(!function_exists("raindrops_first_only_msg")){ function raindrops_first_only_msg($type=0) { if ( $type == 1 ) { $query = 'raindrops_settings'; $link = get_site_url('', 'wp-admin/themes.php', 'admin') . '?page='.$query; if (version_compare(PHP_VERSION, '5.0.0', '<')) { $msg = sprintf(__('Sorry Your PHP version is %s Please use PHP version 5 or later.','Raindrops'),PHP_VERSION); }else{ $msg = sprintf(__('Thank you for adopting the %s theme. It is necessary to set it to this theme. Please move to a set screen clicking this Raindrops settings view.','Raindrops'),get_current_theme() ,$link); } } return '' . $msg . '
$day | "; } $cal .= '|
---|---|
'; if (isset($the_month[$i])) { $cal .= $the_month[$i]; } else { $cal .= $i; } $cal .= ' | '; $daycount++; if ($daycount >= 7) { $cal .= '|
'; } else { $after .= ' | '; if (isset($next_month[$i])) { $after .= $next_month[$i]; } else { $after .= $i; } $after .= ' | '; } } // end if ($pad) ... $cal .= $after; $cal .= '
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 |
'; if (10 > $i) { $output .= "0$i:00"; } else { $output .= "$i:00"; } $output .= ' | ';
if (isset($today[$i])) {
foreach ($today[$i] as $mytime) {
$mytime->post_title = raindrops_fallback_title($mytime->post_title);
$output .= "ID) . "\"
title=\"".esc_attr($mytime->post_title)."\">$mytime->post_title "; } } else { $output .= ' '; } $output .= ' |
%4$s
[WordPress site description]
%7$s