prefix . TMN_TABLE_TITLE); } if(!defined('TMN_TABLE_VERSION')){ define('TMN_TABLE_VERSION','0.1'); } if(!defined('INDIVIDUAL_STYLE')){ define('INDIVIDUAL_STYLE',$stylesheet_name); } if(!defined('NO_HEADER_TEXT')){ define('NO_HEADER_TEXT', false ); } if(!defined('HEADER_TEXTCOLOR')){ define('HEADER_TEXTCOLOR', 'ffffff'); } if(!defined('HEADER_IMAGE')){ define('HEADER_IMAGE', '%s/images/headers/wp3.jpg'); } if(!defined('HEADER_IMAGE_WIDTH')){ define('HEADER_IMAGE_WIDTH', 950); } if(!defined('HEADER_IMAGE_HEIGHT')){ define('HEADER_IMAGE_HEIGHT', 198); } if(!defined('SHOW_HEADER_IMAGE')){ define('SHOW_HEADER_IMAGE',true); } if(!defined('TMN_THE_TIME_FORMAT')){ define("TMN_THE_TIME_FORMAT",'Y/n/j');// } if(!defined('TMN_THE_MONTH_FORMAT')){ define("TMN_THE_MONTH_FORMAT",'Y/m');//archive.php } add_editor_style(); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'raindrops' ), ) ); // This theme allows users to set a custom background add_custom_background(); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 48, 48, true ); add_image_size( 'single-post-thumbnail', 600, 400, true); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // custom content_width /*When the value is specified for this variable, it is not ..width of the page.. revokable from the management screen. */ $content_width = ''; if(isset($content_width) and !empty($content_width)){ add_action("wp_head","tmn_custom_width"); function tmn_custom_width($content,$key){ global $content_width; //maybe $c_width = (int)$content_width; $width = $c_width / 13; $ie_width = $width * 0.9759; $custom_content_width = ''; echo $custom_content_width; } } if ( function_exists( 'add_custom_image_header' ) ) { add_custom_image_header('header_style', 'admin_header_style'); function header_style(){ } function admin_header_style(){ } register_default_headers( array( 'default' => array( 'url' => '%s/images/headers/wp3.jpg', 'thumbnail_url' => '%s/images/headers/wp3-thumbnail.jpg', /* translators: header image description */ 'description' => __( 'raindrops', 'raindrops' ) ) ) ); } load_textdomain( 'Raindrops', get_template_directory().'/languages/'.get_locale().'.mo' ); add_filter( 'comment_form_default_fields','tmn_comment_form'); add_filter( 'the_meta_key', 'filter_explode_meta_keys', 10, 2 ); add_filter('body_class','add_body_class'); add_filter('contextual_help','raindrops_help'); add_filter('comment_form_field_comment','custom_remove_aria_required1'); add_filter('comment_form_default_fields', 'custom_remove_aria_required2'); if ( !is_admin()) { wp_register_script('raindrops_script',get_stylesheet_directory_uri() .'/lib/script.php',array('jquery'),'0.1' ); wp_enqueue_script('raindrops_script'); add_action('wp_print_styles', 'add_raindrops_stylesheet'); } $is_submenu = new tmn_menu_create; add_action('admin_menu', array($is_submenu, 'add_menus')); add_action('admin_menu', 'setup_raindrops'); add_action( 'widgets_init', 'raindrops_widgets_init' ); function raindrops_widgets_init() { register_sidebar(array ( 'name' => __('Default Sidebar'), '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. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); } } if (!function_exists('raindrops_posted_on')) { function raindrops_posted_on() { printf( __( 'Posted on %2$s %3$s', 'raindrops' ), 'meta-prep meta-prep-author', sprintf( '%3$s', get_permalink(), esc_attr( get_the_time(get_option('date_format')) ), get_the_date() ), sprintf( ' ', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'raindrops' ), get_the_author() ), get_the_author() ) ); } } if (!function_exists('filter_explode_meta_keys')) { function filter_explode_meta_keys( $content, $key ) { $explode_keys = array( 'css', 'javascript', 'meta','embed','excerpt','template'); if ( in_array( $key, $explode_keys ) ) return; else return $content; } } if(warehouse('raindrops_show_right_sidebar') == 'hide'){ $rsidebar_show = false; }else{ $rsidebar_show = true; } if(warehouse('raindrops_right_sidebar_width_percent') == '25'){ $yui_inner_layout = 'yui-ge'; }elseif(warehouse('raindrops_right_sidebar_width_percent') == '75'){ $yui_inner_layout = 'yui-gf'; }elseif(warehouse('raindrops_right_sidebar_width_percent') == '33'){ $yui_inner_layout = 'yui-gc'; }elseif(warehouse('raindrops_right_sidebar_width_percent') == '66'){ $yui_inner_layout = 'yui-gd'; }elseif(warehouse('raindrops_right_sidebar_width_percent') == '50'){ $yui_inner_layout = 'yui-g'; }else{ $yui_inner_layout = 'yui-ge'; } /** * warehouseget raindrops setting * * */ function warehouse($name){ global $raindrops_base_setting; global $content_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); if(isset($content_width) and !empty($content_width) and $name == 'raindrops_page_width'){ return 'custom-doc'; } return get_option($name, $raindrops_base_setting[$row]['option_value']); } if (!function_exists('raindrops_help')) { function raindrops_help($text){ global $title; if(TMN_TABLE_TITLE == $title){ $result = "
".sprintf(__('WEBSite:%2$s'),'http://www.tenman.info/wp3/raindrops','Raindrops').'
'; return apply_filters("raindrops_help",$result); }else{ return $text; } } } add_filter('contextual_help','raindrops_edit_help'); if (!function_exists('raindrops_edit_help')) { function raindrops_edit_help($text){ 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)){ $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="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> |
'.sprintf(__('%1$s updated successfully.'),$option_name).'
'.__("Try again").'
'.__("Value").' | '.__("Edit").' | ||
---|---|---|---|
'.__("Color").' | '.__("Value").' | '.__("Edit").' |
'.__('Option','Raindrops').'
'; return $form; } /** * remove aria_required * */ function custom_remove_aria_required1($arg){ $change = array("aria-required=\"true\"","aria-required='true'"); $arg = str_replace($change,'',$arg); return $arg; } 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; } function setup_raindrops(){ global $wpdb,$raindrops_base_setting; $sql = 'SELECT * FROM `'.TMN_PLUGIN_TABLE.'` WHERE `option_name` LIKE \'raindrops%\''; $results = $wpdb->get_results($sql); if(empty($results)){ foreach($raindrops_base_setting as $add){ add_option($add['option_name'],$add['option_value'],"",$add['autoload']); } } } function get_url_from_element($tag){ preg_match('|(https?)(://[[:alnum:]\+\$\;\?\.%,!#~*/:@&=_-]+)|i',$tag,$regs); if(empty($regs[2])){return false;} return $regs[1].$regs[2]; } function get_title_from_element($tag){ preg_match('|title=\"([^\"]+)\"|i',$tag,$regs); if(empty($regs[1])){return "no title";} return $regs[1]; } ?>