├── 404.php ├── README.md ├── ajax-comment ├── app.js └── do.php ├── favicon.ico ├── functions.js ├── functions.php ├── index.php ├── prettify.min.js ├── screenshot.png └── style.css /404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 404 Not Found 7 | 13 | 14 | 15 | 16 | 17 | 28 | 29 |
18 | 19 | 20 | 25 | 26 |
21 |

404

22 |

大事不妙啦!

23 |

你访问的页面好像不小心被博主给弄丢了~
惩罚博主 >

24 |
27 |
30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | siinger , a wordpress theme 2 | 3 | ## Feature 4 | 5 | - banner 6 | - pjax 7 | - one column 8 | - responsive 9 | 10 | ## Site 11 | 12 | [demo site](https://github.com/Siinger/wp_theme_siinger) 13 | 14 | ## Screen 15 | 16 | ![screen](https://github.com/Siinger/wp_theme_siinger/blob/master/screenshot.png) 17 | 18 | 19 | ## Roadmap 20 | 21 | - add archive page 22 | -------------------------------------------------------------------------------- /ajax-comment/app.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(jQuery) { 2 | var __cancel = jQuery('#cancel-comment-reply-link'), 3 | __cancel_text = __cancel.text(), 4 | __list = 'commentlist';//your comment wrapprer 5 | jQuery(document).on("submit", "#commentform", function() { 6 | jQuery.ajax({ 7 | url: ajaxcomment.ajax_url, 8 | data: jQuery(this).serialize() + "&action=ajax_comment", 9 | type: jQuery(this).attr('method'), 10 | beforeSend: addComment.createButterbar("提交中...."), 11 | error: function(request) { 12 | var t = addComment; 13 | t.createButterbar(request.responseText); 14 | }, 15 | success: function(data) { 16 | jQuery('textarea').each(function() { 17 | this.value = '' 18 | }); 19 | var t = addComment, 20 | cancel = t.I('cancel-comment-reply-link'), 21 | temp = t.I('wp-temp-form-div'), 22 | respond = t.I(t.respondId), 23 | post = t.I('comment_post_ID').value, 24 | parent = t.I('comment_parent').value; 25 | if (parent != '0') { 26 | jQuery('#respond').before('
    ' + data + '
'); 27 | } else if (!jQuery('.' + __list ).length) { 28 | if (ajaxcomment.formpostion == 'bottom') { 29 | jQuery('#respond').before('
    ' + data + '
'); 30 | } else { 31 | jQuery('#respond').after('
    ' + data + '
'); 32 | } 33 | 34 | } else { 35 | if (ajaxcomment.order == 'asc') { 36 | jQuery('.' + __list ).append(data); // your comments wrapper 37 | } else { 38 | jQuery('.' + __list ).prepend(data); // your comments wrapper 39 | } 40 | } 41 | t.createButterbar("提交成功"); 42 | cancel.style.display = 'none'; 43 | cancel.onclick = null; 44 | t.I('comment_parent').value = '0'; 45 | if (temp && respond) { 46 | temp.parentNode.insertBefore(respond, temp); 47 | temp.parentNode.removeChild(temp) 48 | } 49 | } 50 | }); 51 | return false; 52 | }); 53 | addComment = { 54 | moveForm: function(commId, parentId, respondId) { 55 | var t = this, 56 | div, comm = t.I(commId), 57 | respond = t.I(respondId), 58 | cancel = t.I('cancel-comment-reply-link'), 59 | parent = t.I('comment_parent'), 60 | post = t.I('comment_post_ID'); 61 | __cancel.text(__cancel_text); 62 | t.respondId = respondId; 63 | if (!t.I('wp-temp-form-div')) { 64 | div = document.createElement('div'); 65 | div.id = 'wp-temp-form-div'; 66 | div.style.display = 'none'; 67 | respond.parentNode.insertBefore(div, respond) 68 | }!comm ? (temp = t.I('wp-temp-form-div'), t.I('comment_parent').value = '0', temp.parentNode.insertBefore(respond, temp), temp.parentNode.removeChild(temp)) : comm.parentNode.insertBefore(respond, comm.nextSibling); 69 | jQuery("body").animate({ 70 | scrollTop: jQuery('#respond').offset().top - 180 71 | }, 400); 72 | parent.value = parentId; 73 | cancel.style.display = ''; 74 | cancel.onclick = function() { 75 | var t = addComment, 76 | temp = t.I('wp-temp-form-div'), 77 | respond = t.I(t.respondId); 78 | t.I('comment_parent').value = '0'; 79 | if (temp && respond) { 80 | temp.parentNode.insertBefore(respond, temp); 81 | temp.parentNode.removeChild(temp); 82 | } 83 | this.style.display = 'none'; 84 | this.onclick = null; 85 | return false; 86 | }; 87 | try { 88 | t.I('comment').focus(); 89 | } catch (e) {} 90 | return false; 91 | }, 92 | I: function(e) { 93 | return document.getElementById(e); 94 | }, 95 | clearButterbar: function(e) { 96 | if (jQuery(".butterBar").length > 0) { 97 | jQuery(".butterBar").remove(); 98 | } 99 | }, 100 | createButterbar: function(message) { 101 | var t = this; 102 | t.clearButterbar(); 103 | jQuery("body").append('

' + message + '

'); 104 | setTimeout("jQuery('.butterBar').remove()", 3000); 105 | } 106 | }; 107 | }); -------------------------------------------------------------------------------- /ajax-comment/do.php: -------------------------------------------------------------------------------- 1 | admin_url('admin-ajax.php'), 7 | 'order' => get_option('comment_order'), 8 | 'formpostion' => 'top', //默认为bottom,如果你的表单在顶部则设置为top。 9 | ) ); 10 | } 11 | add_action( 'wp_enqueue_scripts', 'ajax_comment_scripts' ); 12 | 13 | add_action('wp_ajax_nopriv_ajax_comment', 'ajax_comment_callback'); 14 | add_action('wp_ajax_ajax_comment', 'ajax_comment_callback'); 15 | function ajax_comment_callback(){ 16 | global $wpdb; 17 | $comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; 18 | $post = get_post($comment_post_ID); 19 | $post_author = $post->post_author; 20 | if ( empty($post->comment_status) ) { 21 | do_action('comment_id_not_found', $comment_post_ID); 22 | ajax_comment_err('Invalid comment status.'); 23 | } 24 | $status = get_post_status($post); 25 | $status_obj = get_post_status_object($status); 26 | if ( !comments_open($comment_post_ID) ) { 27 | do_action('comment_closed', $comment_post_ID); 28 | ajax_comment_err('Sorry, comments are closed for this item.'); 29 | } elseif ( 'trash' == $status ) { 30 | do_action('comment_on_trash', $comment_post_ID); 31 | ajax_comment_err('Invalid comment status.'); 32 | } elseif ( !$status_obj->public && !$status_obj->private ) { 33 | do_action('comment_on_draft', $comment_post_ID); 34 | ajax_comment_err('Invalid comment status.'); 35 | } elseif ( post_password_required($comment_post_ID) ) { 36 | do_action('comment_on_password_protected', $comment_post_ID); 37 | ajax_comment_err('Password Protected'); 38 | } else { 39 | do_action('pre_comment_on_post', $comment_post_ID); 40 | } 41 | $comment_author = ( isset($_POST['author']) ) ? trim(strip_tags($_POST['author'])) : null; 42 | $comment_author_email = ( isset($_POST['email']) ) ? trim($_POST['email']) : null; 43 | $comment_author_url = ( isset($_POST['url']) ) ? trim($_POST['url']) : null; 44 | $comment_content = ( isset($_POST['comment']) ) ? trim($_POST['comment']) : null; 45 | $user = wp_get_current_user(); 46 | if ( $user->exists() ) { 47 | if ( empty( $user->display_name ) ) 48 | $user->display_name=$user->user_login; 49 | $comment_author = esc_sql($user->display_name); 50 | $comment_author_email = esc_sql($user->user_email); 51 | $comment_author_url = esc_sql($user->user_url); 52 | $user_ID = esc_sql($user->ID); 53 | if ( current_user_can('unfiltered_html') ) { 54 | if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { 55 | kses_remove_filters(); 56 | kses_init_filters(); 57 | } 58 | } 59 | } else { 60 | if ( get_option('comment_registration') || 'private' == $status ) 61 | ajax_comment_err('Sorry, you must be logged in to post a comment.'); 62 | } 63 | $comment_type = ''; 64 | if ( get_option('require_name_email') && !$user->exists() ) { 65 | if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 66 | ajax_comment_err( 'Error: please fill the required fields (name, email).' ); 67 | elseif ( !is_email($comment_author_email)) 68 | ajax_comment_err( 'Error: please enter a valid email address.' ); 69 | } 70 | if ( '' == $comment_content ) 71 | ajax_comment_err( 'Error: please type a comment.' ); 72 | $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' "; 73 | if ( $comment_author_email ) $dupe .= "OR comment_author_email = '$comment_author_email' "; 74 | $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; 75 | if ( $wpdb->get_var($dupe) ) { 76 | ajax_comment_err('Duplicate comment detected; it looks as though you’ve already said that!'); 77 | } 78 | if ( $lasttime = $wpdb->get_var( $wpdb->prepare("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author = %s ORDER BY comment_date DESC LIMIT 1", $comment_author) ) ) { 79 | $time_lastcomment = mysql2date('U', $lasttime, false); 80 | $time_newcomment = mysql2date('U', current_time('mysql', 1), false); 81 | $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 82 | if ( $flood_die ) { 83 | ajax_comment_err('You are posting comments too quickly. Slow down.'); 84 | } 85 | } 86 | $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; 87 | $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 88 | 89 | $comment_id = wp_new_comment( $commentdata ); 90 | 91 | 92 | $comment = get_comment($comment_id); 93 | do_action('set_comment_cookies', $comment, $user); 94 | $comment_depth = 1; 95 | $tmp_c = $comment; 96 | while($tmp_c->comment_parent != 0){ 97 | $comment_depth++; 98 | $tmp_c = get_comment($tmp_c->comment_parent); 99 | } 100 | $GLOBALS['comment'] = $comment; 101 | //这里修改成你的评论结构 102 | ?> 103 |
  • > 104 |
    105 |
    106 | 107 | 说道: 108 |
    109 | 110 | 111 |
    112 |
  • 113 | 13 |

    主题设置

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
    28 | __('站点导航') 44 | //,'footer_nav' => __('底部菜单') 45 | ) ); 46 | } 47 | // 引入AJAX 48 | add_action('wp_ajax_nopriv_load_postlist', 'load_postlist_callback'); 49 | add_action('wp_ajax_load_postlist', 'load_postlist_callback'); 50 | function load_postlist_callback(){ 51 | $postlist = ''; 52 | $paged = $_POST["paged"]; 53 | $total = $_POST["total"]; 54 | $category = $_POST["category"]; 55 | $author = $_POST["author"]; 56 | $tag = $_POST["tag"]; 57 | $search = $_POST["search"]; 58 | $year = $_POST["year"]; 59 | $month = $_POST["month"]; 60 | $day = $_POST["day"]; 61 | $query_args = array( 62 | "posts_per_page" => get_option('posts_per_page'), 63 | "cat" => $category, 64 | "tag" => $tag, 65 | "author" => $author, 66 | "post_status" => "publish", 67 | "post_type" => "post", 68 | "paged" => $paged, 69 | "s" => $search, 70 | "year" => $year, 71 | "monthnum" => $month, 72 | "day" => $day 73 | ); 74 | $the_query = new WP_Query( $query_args ); 75 | while ( $the_query->have_posts() ){ 76 | $the_query->the_post(); 77 | $postlist .= make_post_section(); 78 | } 79 | $code = $postlist ? 200 : 500; 80 | wp_reset_postdata(); 81 | $next = ( $total > $paged )? ( $paged + 1 ) : '' ; 82 | echo json_encode(array('code'=>$code,'postlist'=>$postlist,'next'=> $next)); 83 | die; 84 | } 85 | 86 | // 优化代码 87 | remove_action( 'wp_head', 'feed_links_extra', 3 ); // 额外的feed,例如category, tag页 88 | remove_action( 'wp_head', 'wp_generator' ); //隐藏wordpress版本 89 | remove_filter('the_content', 'wptexturize'); //取消标点符号转义 90 | remove_action( 'admin_print_scripts', 'print_emoji_detection_script'); // 禁用Emoji表情 91 | remove_action( 'admin_print_styles', 'print_emoji_styles'); 92 | remove_action( 'wp_head', 'print_emoji_detection_script', 7); 93 | remove_action( 'wp_print_styles', 'print_emoji_styles'); 94 | remove_filter( 'the_content_feed', 'wp_staticize_emoji'); 95 | remove_filter( 'comment_text_rss', 'wp_staticize_emoji'); 96 | remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email'); 97 | add_filter('login_errors', create_function('$a', "return null;")); //取消登录错误提示 98 | add_filter( 'show_admin_bar', '__return_false' ); //删除AdminBar 99 | if ( function_exists('add_theme_support') )add_theme_support('post-thumbnails'); //添加特色缩略图支持 100 | // 移除菜单冗余代码 101 | add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); 102 | add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); 103 | add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); 104 | function my_css_attributes_filter($var) { 105 | return is_array($var) ? array_intersect($var, array('current-menu-item','current-post-ancestor','current-menu-ancestor','current-menu-parent')) : ''; 106 | } 107 | // 禁止wp-embed.min.js 108 | function disable_embeds_init() { 109 | global $wp; 110 | $wp->public_query_vars = array_diff( $wp->public_query_vars, array( 111 | 'embed', 112 | ) ); 113 | remove_action( 'rest_api_init', 'wp_oembed_register_route' ); 114 | add_filter( 'embed_oembed_discover', '__return_false' ); 115 | remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 ); 116 | remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); 117 | remove_action( 'wp_head', 'wp_oembed_add_host_js' ); 118 | add_filter( 'tiny_mce_plugins', 'disable_embeds_tiny_mce_plugin' ); 119 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 120 | } 121 | add_action( 'init', 'disable_embeds_init', 9999 ); 122 | function disable_embeds_tiny_mce_plugin( $plugins ) { 123 | return array_diff( $plugins, array( 'wpembed' ) ); 124 | } 125 | function disable_embeds_rewrites( $rules ) { 126 | foreach ( $rules as $rule => $rewrite ) { 127 | if ( false !== strpos( $rewrite, 'embed=true' ) ) { 128 | unset( $rules[ $rule ] ); 129 | } 130 | } 131 | return $rules; 132 | } 133 | function disable_embeds_remove_rewrite_rules() { 134 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 135 | flush_rewrite_rules(); 136 | } 137 | register_activation_hook( __FILE__, 'disable_embeds_remove_rewrite_rules' ); 138 | function disable_embeds_flush_rewrite_rules() { 139 | remove_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 140 | flush_rewrite_rules(); 141 | } 142 | register_deactivation_hook( __FILE__, 'disable_embeds_flush_rewrite_rules' ); 143 | // Gravatar头像使用中国服务器 144 | function gravatar_cn( $url ){ 145 | $gravatar_url = array('0.gravatar.com','1.gravatar.com','2.gravatar.com'); 146 | return str_replace( $gravatar_url, 'cn.gravatar.com', $url ); 147 | } 148 | add_filter( 'get_avatar_url', 'gravatar_cn', 4 ); 149 | // 阻止站内文章互相Pingback 150 | function theme_noself_ping( &$links ) { 151 | $home = get_option( 'home' ); 152 | foreach ( $links as $l => $link ) 153 | if ( 0 === strpos( $link, $home ) ) 154 | unset($links[$l]); 155 | } 156 | add_action('pre_ping','theme_noself_ping'); 157 | // 网页标题 158 | function Bing_add_theme_support_title(){ 159 | add_theme_support( 'title-tag' ); 160 | } 161 | add_action( 'after_setup_theme', 'Bing_add_theme_support_title' ); 162 | // 编辑器增强 163 | function enable_more_buttons($buttons) { 164 | $buttons[] = 'hr'; 165 | $buttons[] = 'del'; 166 | $buttons[] = 'sub'; 167 | $buttons[] = 'sup'; 168 | $buttons[] = 'fontselect'; 169 | $buttons[] = 'fontsizeselect'; 170 | $buttons[] = 'cleanup'; 171 | $buttons[] = 'styleselect'; 172 | $buttons[] = 'wp_page'; 173 | $buttons[] = 'anchor'; 174 | $buttons[] = 'backcolor'; 175 | return $buttons; 176 | } 177 | add_filter("mce_buttons_3", "enable_more_buttons"); 178 | // 拦截机器评论 179 | class anti_spam { 180 | function anti_spam() { 181 | if ( !current_user_can('level_0') ) { 182 | add_action('template_redirect', array($this, 'w_tb'), 1); 183 | add_action('init', array($this, 'gate'), 1); 184 | add_action('preprocess_comment', array($this, 'sink'), 1); 185 | } 186 | } 187 | function w_tb() { 188 | if ( is_singular() ) { 189 | ob_start(create_function('$input','return preg_replace("#textarea(.*?)name=([\"\'])comment([\"\'])(.+)/textarea>#", 190 | "textarea$1name=$2w$3$4/textarea>",$input);') ); 191 | } 192 | } 193 | function gate() { 194 | if ( !empty($_POST['w']) && empty($_POST['comment']) ) { 195 | $_POST['comment'] = $_POST['w']; 196 | } else { 197 | $request = $_SERVER['REQUEST_URI']; 198 | $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '隐瞒'; 199 | $IP= isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] . ' (透过代理)' : $_SERVER["REMOTE_ADDR"]; 200 | $way = isset($_POST['w'])? '手动操作' : '未经评论表格'; 201 | $spamcom = isset($_POST['comment'])? $_POST['comment']: null; 202 | $_POST['spam_confirmed'] = "请求: ". $request. "\n来路: ". $referer. "\nIP: ". $IP. "\n方式: ". $way. "\n內容: ". $spamcom. "\n -- 已备案 --"; 203 | } 204 | } 205 | function sink( $comment ) { 206 | if ( !empty($_POST['spam_confirmed']) ) { 207 | if ( in_array( $comment['comment_type'], array('pingback', 'trackback') ) ) return $comment; 208 | // 方法一: 直接挡掉, 將 die(); 209 | die(); 210 | // 方法二: 标记为 spam, 留在资料库检查是否误判. 211 | // add_filter('pre_comment_approved', create_function('', 'return "spam";')); 212 | // $comment['comment_content'] = "[ 防火墙提示:此条评论疑似Spam! ]\n". $_POST['spam_confirmed']; 213 | } 214 | return $comment; 215 | } 216 | } 217 | $anti_spam = new anti_spam(); 218 | 219 | function scp_comment_post( $incoming_comment ) { // 纯英文评论拦截 220 | if(!preg_match('/[一-龥]/u', $incoming_comment['comment_content'])) exit('

    提交失败:评论必须包含中文(Chinese),请再次尝试!

    '); 221 | //die(); // 直接挡掉,无提示 222 | return( $incoming_comment ); 223 | } 224 | add_filter('preprocess_comment', 'scp_comment_post'); 225 | // 评论@回复 226 | function idevs_comment_add_at( $comment_text, $comment = '') { 227 | if( $comment->comment_parent > 0) { 228 | $comment_text = '@'.get_comment_author( $comment->comment_parent ) . ' ' . $comment_text; 229 | } 230 | 231 | return $comment_text; 232 | } 233 | add_filter( 'comment_text' , 'idevs_comment_add_at', 20, 2); 234 | // 评论邮件延迟 235 | add_action('comment_post', 'comment_mail_schedule'); 236 | function comment_mail_schedule($comment_id){ 237 | wp_schedule_single_event( time()+60, 'comment_mail_event',array($comment_id)); 238 | } 239 | add_action('comment_mail_event','comment_mail_notify'); 240 | // 评论邮件通知 241 | function comment_mail_notify($comment_id) { 242 | $comment = get_comment($comment_id); 243 | $parent_id = $comment->comment_parent ? $comment->comment_parent : ''; 244 | $spam_confirmed = $comment->comment_approved; 245 | if (($parent_id != '') && ($spam_confirmed != 'spam') && (!get_comment_meta($parent_id,'_deny_email',true)) && (get_option('admin_email') != get_comment($parent_id)->comment_author_email)) { 246 | $wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); //可以修改为你自己的邮箱地址 247 | $to = trim(get_comment($parent_id)->comment_author_email); 248 | $subject = '你在 [' . get_option("blogname") . '] 的留言有了新回复'; 249 | $message = ' 250 | 251 | 252 | 266 | 267 | 268 | 271 | 272 | 273 |
    253 | 258 |
    259 |

    ' . trim(get_comment($parent_id)->comment_author) . ',您在文章 《' . get_the_title($comment->comment_post_ID) . '》 中的评论:

    260 |

    ' . trim(get_comment($parent_id)->comment_content) . '

    261 |

    '. $comment->comment_author .' 给您的回复如下:

    262 |

    ' . trim($comment->comment_content) . '

    263 | 立即回复 264 |
    265 |
    269 |
    本邮件由 ' . get_option("blogname") . ' 后台自动发送,请勿直接回复!
    270 |
    '; 274 | $from = "From: \"" . get_option('blogname') . "\" <$wp_email>"; 275 | $headers = "$from\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n"; 276 | wp_mail( $to, $subject, $message, $headers ); 277 | } 278 | }; 279 | // 缩略图技术 by:http://www.bgbk.org 280 | if( !defined( 'THEME_THUMBNAIL_PATH' ) ) define( 'THEME_THUMBNAIL_PATH', '/cache/theme-thumbnail' ); 281 | function Bing_build_empty_index( $path ){ 282 | $index = $path . '/index.php'; 283 | if( is_file( $index ) ) return; 284 | wp_mkdir_p( $path ); 285 | file_put_contents( $index, "get_size(); 297 | if( !$dims = image_resize_dimensions( $size['width'], $size['height'], $width, $height, true ) ) return $url; 298 | $cmp_x = $size['width'] / $width; 299 | $cmp_y = $size['height'] / $height; 300 | $cmp = min( $cmp_x, $cmp_y ); 301 | $min_width = round( $width * $cmp ); 302 | $min_height = round( $height * $cmp ); 303 | $crop = $editor->crop( $dims[2], $dims[3], $min_width, $min_height, $width, $height ); 304 | if( is_wp_error( $crop ) ) return $url; 305 | Bing_build_empty_index( WP_CONTENT_DIR . THEME_THUMBNAIL_PATH ); 306 | $save = $editor->save( $file_path, 'image/jpg' ); 307 | return is_wp_error( $save ) ? $url : $file_url; 308 | } 309 | function Bing_add_support_post_thumbnails(){ 310 | add_theme_support( 'post-thumbnails' ); 311 | } 312 | add_action( 'after_setup_theme', 'Bing_add_support_post_thumbnails' ); 313 | // 获取文章第一张图片 314 | function get_content_first_image($content){ 315 | if ( $content === false ) $content = get_the_content(); 316 | preg_match_all('||i', $content, $images); 317 | if($images){ 318 | return $images[1][0]; 319 | }else{ 320 | return false; 321 | } 322 | } 323 | // 读者墙 324 | if(!function_exists("deep_in_array")) { 325 | function deep_in_array($value, $array) { 326 | $i = -1; 327 | foreach($array as $item => $v) { 328 | $i++; 329 | if($v["email"] == $value) return $i; 330 | } 331 | return -1; 332 | } 333 | } 334 | 335 | function get_active_friends($num = null,$size = null,$days = null) { 336 | $num = $num ? $num : 15; 337 | $size = $size ? $size : 34; 338 | $days = $days ? $days : 30; 339 | $array = array(); 340 | $comments = get_comments( array('status' => 'approve','author__not_in'=>1,'date_query'=>array('after' => $days . ' days ago')) ); 341 | if(!empty($comments)) { 342 | foreach($comments as $comment){ 343 | $email = $comment->comment_author_email; 344 | $author = $comment->comment_author; 345 | $url = $comment->comment_author_url; 346 | $data = human_time_diff(strtotime($comment->comment_date)); 347 | if($email!=""){ 348 | $index = deep_in_array($email, $array); 349 | if( $index > -1){ 350 | $array[$index]["number"] +=1; 351 | }else{ 352 | array_push($array, array( 353 | "email" => $email, 354 | "author" => $author, 355 | "url" => $url, 356 | "date" => $data, 357 | "number" => 1 358 | )); 359 | } 360 | } 361 | } 362 | foreach ($array as $k => $v) { 363 | $edition[] = $v['number']; 364 | } 365 | array_multisort($edition, SORT_DESC, $array); // 数组倒序排列 366 | } 367 | $output = ''; 381 | return $output; 382 | } 383 | function active_shortcode( $atts, $content = null ) { 384 | 385 | extract( shortcode_atts( array( 386 | 'num' => '', 387 | 'size' => '', 388 | 'days' => '', 389 | ), 390 | $atts ) ); 391 | return get_active_friends($num,$size,$days); 392 | } 393 | add_shortcode('active', 'active_shortcode'); 394 | 395 | /* 396 | //链接重定向跳转 397 | add_filter('get_comment_author_link', 'add_redirect_comment_link', 5); 398 | add_filter('comment_text', 'add_redirect_comment_link', 99); 399 | function add_redirect_comment_link($text = ''){ 400 | $text=str_replace(get_comment_author_url(),get_option('home')."/index.php?link=".base64_encode(get_comment_author_url()),$text); 401 | return $text; 402 | } 403 | */ 404 | 405 | //禁止加载默认jq库 406 | function my_enqueue_scripts() { 407 | wp_deregister_script('jquery'); 408 | } 409 | add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts', 1 ); 410 | 411 | // function to display number of posts. 412 | function getPostViews($postID){ 413 | $count_key = 'post_views_count'; 414 | $count = get_post_meta($postID, $count_key, true); 415 | if($count==''){ 416 | delete_post_meta($postID, $count_key); 417 | add_post_meta($postID, $count_key, '0'); 418 | return ""; 419 | } 420 | //return $count.' 次阅读'; 421 | return $count.' 次阅读'; 422 | } 423 | 424 | // function to count views. 425 | function setPostViews($postID) { 426 | $count_key = 'post_views_count'; 427 | $count = get_post_meta($postID, $count_key, true); 428 | if($count==''){ 429 | $count = 0; 430 | delete_post_meta($postID, $count_key); 431 | add_post_meta($postID, $count_key, '0'); 432 | }else{ 433 | $count++; 434 | update_post_meta($postID, $count_key, $count); 435 | } 436 | } 437 | @ini_set( 'upload_max_size' , '64M' ); 438 | @ini_set( 'post_max_size', '64M'); 439 | @ini_set( 'max_execution_time', '300' ); 440 | 441 | //字数统计 442 | function count_words($content) { 443 | return mb_strlen(preg_replace('/\s/','',html_entity_decode(strip_tags($content))),'UTF-8'); 444 | } 445 | // 全部配置完毕 446 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 25 | 26 | 27 | 28 |
    29 |
    30 | 49 |
    50 | 51 | 55 | 56 | 57 | 58 |
    59 |
    60 | 61 | 62 |

    63 |
        
    64 | 65 | 66 |
    67 | 71 |
    72 |

    — 于 ,共写了 字;

    73 |

    — 本文共有 个标签:

    74 |
    75 |
    76 |
    77 | 78 |
      79 | 80 |
    • 81 | 82 |
    • 83 | 84 | 85 | 86 |
    87 | 88 |
    89 | 90 | 91 |
    92 |
    93 | 95 |
    96 |

    97 |

    post_content))), 0, 430,"...");?>

    98 |
        
    99 |
    100 |
    101 | 102 |
    103 |
    104 | 107 |
    108 |
    109 | 110 |
    111 | 118 | 119 | ".get_the_author_meta('my_code')."\n"; 120 | echo "\n"?> 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /prettify.min.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
    "+a+"
    ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i .comment{position:relative;} 169 | .commentlist > .comment:before{content:'#'counter(comment-floor);counter-increment:comment-floor;font-size:18px;position:absolute;top:40px;right:0;color:#ccc;} 170 | /* 翻页按钮 */ 171 | .navigator{text-align:center;background:none;border:0;padding:0 0 12% 0;} 172 | .navigator a{margin:0 5%;width:40px;height:40px;display:inline-block;border-radius:100px;border:1px solid #ddd;color:#aaa;} 173 | .navigator a i{font-size:30px;} 174 | .navigator a:hover{border:1px solid #1F1F1F;background:#1F1F1F;color:#fff;} 175 | .navigator a:hover i{color:#fff;} 176 | .is-loading div,.load .load_comments div{background-color:#1F1F1F;width:10px;height:10px;margin:0 5px;display:inline-block;-webkit-animation:ball-beat 0.7s 0s infinite linear;animation:ball-beat 0.7s 0s infinite linear;} 177 | .is-loading div:nth-child(2n-1),.load .load_comments div:nth-child(2n-1){-webkit-animation-delay:0.35s !important;animation-delay:0.35s !important;} 178 | .load .load_comments{text-align:center;margin:10% 0;} 179 | .navigation{text-align:center;margin:40px 0;} 180 | .navigation div{display:inline-block;} 181 | .navigation a{margin:0 20px;padding:0 12px;} 182 | /* 读者排行 */ 183 | ul.active-items{text-align:center;overflow:hidden;background:none;padding:0;margin:0 0 60px 0;line-height:0;} 184 | ul.active-items li{display:inline-block;margin:0;padding:0;width:42px;height:42px;list-style:none;} 185 | ul.active-items li img{margin:0;} 186 | /* 友情链接 */ 187 | ul.link-items{overflow:hidden;padding:0;background:none;} 188 | ul.link-items li{width:19.4%;display:inline-block;text-align:center;} 189 | ul.link-items li img{width:50%;border-radius:100%;margin-bottom:0;} 190 | /* 页脚 */ 191 | #footer{color:#ccc;text-shadow:0 1px 1px #eee;padding:20px 0;text-align:center;font-size:12px;text-shadow:none;} 192 | #footer a{color:#A6A6A6;text-shadow:none;} 193 | #footer *:hover{color:#1F1F1F;} 194 | #footer .copyright a{color:#d6d6d6;margin:0px 2px;} 195 | #footer .copyright a:hover{color:#1F1F1F;} 196 | #footer .heart{font-family:kaiti;font-size:16px;color:#444;font-weight:bold;} 197 | #footer ul li{display:inline-block;margin:0 10px 0 0;} 198 | #footer ul{margin:0 auto;overflow:hidden;} 199 | /* 动画 */ 200 | @keyframes ball-beat{50%{opacity:0;transform:scale(0.75);} 201 | 100%{opacity:1;transform:scale(1);}} 202 | @-webkit-keyframes ball-beat{50%{opacity:0;-webkit-transform:scale(0.75);} 203 | 100%{opacity:1;-webkit-transform:scale(1);}} 204 | @-moz-keyframes ball-beat{50%{opacity:0;-moz-transform:scale(0.75);} 205 | 100%{opacity:1;-moz-transform:scale(1);}} 206 | body{opacity:1;} 207 | .load body{opacity:.3;} 208 | .load:before{content:"";line-height:0;position:fixed;left:-100%;width:100%;height:1px;background:#1F1F1F;display:block;z-index:9;animation:load 1s -0.1s ease-in-out infinite;-webkit-animation:load 1s .1s ease-in-out infinite;-moz-animation:load 1s -0.1s ease-in-out infinite;} 209 | @keyframes load{0%{left:-100%;} 210 | 100%{left:100%;}} 211 | @-webkit-keyframes load{0%{left:-100%;} 212 | 100%{left:100%;}} 213 | @-moz-keyframes load{0%{left:-100%;} 214 | 100%{left:100%;}} 215 | /*滚动条*/ 216 | ::-webkit-scrollbar{width:10px;height:6px} 217 | ::-webkit-scrollbar-button:vertical{display:none} 218 | ::-webkit-scrollbar-track:vertical{background-color:black} 219 | ::-webkit-scrollbar-track-piece{background:#E8ECEF} 220 | ::-webkit-scrollbar-thumb:vertical{background-color:#999;border-radius:0px} 221 | ::-webkit-scrollbar-thumb:vertical:hover{background-color:#3B3B3B} 222 | ::-webkit-scrollbar-corner:vertical{background-color:#535353} 223 | ::-webkit-scrollbar-resizer:vertical{background-color:#FF6E00} 224 | /* 动画 */ 225 | .animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both;} 226 | @-webkit-keyframes fadeIn{from{opacity:0;} 227 | to{opacity:1;}} 228 | @keyframes fadeIn{from{opacity:0;} 229 | to{opacity:1;}} 230 | .fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn;} 231 | /* 响应式 */ 232 | @media(max-width:720px){#main{width:100%;margin-top:0px;} 233 | #header,.container{padding-left:22px;padding-right:22px;} 234 | .ending{height:80px;} 235 | .reward{left:0;right:0;margin:auto;bottom:-60px;} 236 | .reward ul{left:-408%;top:-1000%;} 237 | .reward ul:after,.reward ul:before{display:none}} 238 | 239 | body ::selection {background: #87d283} 240 | body ::-moz-selection {background: #50be4b} 241 | /* 代码高亮 */ 242 | .single pre{background-color: #f8f8f8;border: 1px solid #eee;overflow: hidden;font-size: 12px;white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;} 243 | .single pre.prettyprint{margin-bottom: 20px} 244 | .single pre code{color: inherit;white-space: pre;white-space: pre-wrap;background-color: transparent;border: 0} 245 | .prettyprint.linenums,pre.prettyprint.linenums{-webkit-box-shadow: inset 40px 0 0 #fff,inset 42px 0 0 #33b796;-moz-box-shadow: inset 40px 0 0 #fff,inset 42px 0 0 #33b796;box-shadow: inset 40px 0 0 #fff,inset 42px 0 0 #33b796} 246 | .prettyprint.linenums ol,pre.prettyprint.linenums ol{margin: 0 0 0 0px;} 247 | .prettyprint.linenums ol li,pre.prettyprint.linenums ol li{padding-left: 15px;color: #bebec5;line-height: 20px;margin-left: 0;list-style: decimal} 248 | .prettyprint.linenums ol li:before,pre.prettyprint.linenums ol li:before{content: "";width: 0} 249 | .prettyprint .com{color: #666} 250 | .prettyprint .lit{color: #c0c} 251 | .prettyprint .pun,.prettyprint .opn,.prettyprint .clo{color: #0a0} 252 | .prettyprint .fun{color: #dc322f} 253 | .prettyprint .str,.prettyprint .atv{color: #333} 254 | .prettyprint .kwd,.prettyprint .tag{color: #f92659} 255 | .prettyprint .typ,.prettyprint .atn,.prettyprint .dec,.prettyprint .var{color: #0a0} 256 | .prettyprint .pln{color: #00f} 257 | --------------------------------------------------------------------------------