├── 404.php ├── README.md ├── ajax-comment ├── app.js └── do.php ├── functions.js ├── functions.php ├── images ├── favicon.png ├── iconfont.eot ├── iconfont.svg ├── iconfont.ttf └── iconfont.woff ├── index.php ├── 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 | 最新版本 v2.0.0 2 | 3 | ## 亮点功能 4 | 5 | 1. 简洁的设计风格(最大的亮点?好吧,初衷就是简洁) 6 | 2. 轻量化的安装体积(仅62.3K,文件少了,功能却不少) 7 | 3. 全PJAX无刷新操作(又一买点,优化的很好了,基本不会遇到什么问题) 8 | 4. 响应式的布局(嗯,我的主题全都是响应式的) 9 | 5. 个性的展示区域(文章和页面下面,好像很有biger) 10 | 6. 强劲的性能优化(去掉了很多冗余代码,可能感受不到,但是强迫症会看源代码) 11 | 7. 读者墙,新建页面填入[active num=72 size=70 days=730]字段 12 | 13 | ## 界面演示 14 | 15 | ![DEMO](https://ws1.sinaimg.cn/large/76679337gy1fc0c4pkurrj21hc0u0jyl.jpg) 16 | 17 | ## 更新历史 18 | 19 | #### 2016年2月18日更新 20 | 21 | 1. 修复了php7下无法正常使用的问题[重要] 22 | 2. 修复了视网膜屏幕下,icon图片模糊的问题 23 | 3. 新增评论链接跳转 24 | 4. 更改了手机下icon样式 25 | 5. 其他细节改进 2016年2月25日更新 26 | 27 | #### 2016年2月25日更新 28 | 29 | 1. 修复了php7.0.3下评论区域错误[重要] 30 | 2. 移除了自带的jquery,改调用又拍云的公共库 31 | 3. 公共库如果加载失败,可以ajax评论,无法pjax页面 32 | 33 | #### 2016年3月3日更新 34 | 35 | 1. 新增返回顶部功能 36 | 2. 优化了pjax方式,更方便的控制非pjax链接 37 | 38 | #### 2016年3月4日更新 39 | 40 | 1. 新增主题更新推送[重要] 41 | 2. 精简主题体积,新版压缩包仅47kb 42 | 3. 道歉,由于版本控制不规范,上个版本出了一些问题,紧急推送 43 | 44 | #### 2016年3月13日更新 45 | 46 | 1. 更换了文章列表翻页效果[重要] 47 | 2. 修复了手机下导航菜单点击区域过小问题,且可以正常显示与隐藏了 48 | 3. 新增“赏赐”功能 49 | 4. 新增社交链接区域 50 | 5. 优化评论区域显示效果 51 | 6. 修复了裁剪图片文件太大的问题 52 | 7. 评论者链接已经过base64处理,外链跳转方式更安全 53 | 8. 优化了loading动画显示效果 54 | 55 | #### 2016年4月2日更新 56 | 57 | 1. CSS细节优化 58 | 2. 新增评论楼层显示 59 | 3. 新增代码高亮功能【已取消】 60 | 61 | #### 2016年4月15日更新 62 | 63 | 1. 修复了文章列表时间显示问题[重要] 64 | 2. 调整了wordpress更新后评论区域样式 65 | 3. 全新的邮件通知样式 66 | 4. 取消了上一个版本的代码高亮功能(BUG不好调。懒) 67 | 5. 新的文章结束样式,先这样,不喜欢的话下期再更新 68 | 69 | #### 2016年5月2日更新 70 | 71 | 1. Css样式细节微调 72 | 2. 其他几处bug修复 73 | 74 | #### 2016年7月3日更新 75 | 76 | 1. 导航菜单手机端支持打开和关闭了【终于】 77 | 2. 导航菜单支持耳机菜单了 78 | 3. 其他CSS微调 79 | 80 | ···1.7.5、1.8.1、1.9.3 81 | 82 | #### 2016年12月30日更新 83 | 84 | 1. 更改主题设置方式【重要】 85 | 2. 优化缩略图函数 86 | 3. 其他CSS微调 87 | 88 | #### 2017年1月4日更新 89 | 90 | 1. 新增Pjax开关【重要】 --出现插件不兼容时可以关闭pjax 91 | 2. 文章插入相册美化 92 | 3. 代码块CSS优化 93 | 4. 滚动条美化 94 | 95 | ## 附加功能 96 | 97 | // 静态资源使用七牛 CDN 98 | function Qiniu_cdn(){ob_start( 'Qiniu_cdn_replace' );} 99 | add_action( 'template_redirect', 'Qiniu_cdn' ); 100 | function Qiniu_cdn_replace( $code ){ 101 | $cdn_exts = 'png|jpg|jpeg|gif|bmp'; 102 | $cdn_dirs = str_replace( '-', '\-', 'wp-content|wp-includes' ); 103 | $regex = '/' . str_replace( '/', '\/', site_url() ) . '\/((' . $cdn_dirs . ')\/[^\s\?\\\'\"\;\>\<]{1,}.(' . $cdn_exts . '))([\"\\\'\s\?]{1})/'; 104 | return preg_replace( $regex, '//七牛的链接/$1$4', $code ); 105 | } 106 | 107 | ## 主题声明 108 | 109 | > 声明1:iDevise目前已经暂停更能行更新,仅对重大BUG进行维护。 110 | > 111 | > 声明2:使用过程中如果遇到什么问题可以前往 https://biji.io/2016/3661.html 留言,但不保证解答全部问题。 112 | > 113 | > 声明3:iDevise的移植、衍生版本的主题及产品的使用问题请联系移植、修改作者,本博客不提供无偿答疑服务,请谅解。 114 | -------------------------------------------------------------------------------- /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 | 200){$(".back2top").fadeIn(100)}else{$(".back2top").fadeOut(200)}});$(".back2top").click(function(){$("body,html").animate({scrollTop:0},400);return false}); 3 | 4 | //重载 5 | function overloaded(){ 6 | //导航菜单 7 | menu_click("topMenu", "menu_click", "menu_close", true); 8 | function menu_click(btn, on, off, flag) { 9 | (btn = document.getElementById(btn)).onclick = function () { 10 | btn.setAttribute("class", (flag = !flag) ? on : off); 11 | } 12 | } 13 | 14 | jQuery(document).ready(function(){ 15 | jQuery("a[rel='external'],a[rel='external nofollow'],#commentform a,.single a").click( 16 | function(){window.open(this.href);return false}) 17 | $(".navigation a,.comment-body a,.page-numbers").addClass("no-ajax");//排除规则 18 | }); 19 | $('div.navigation').slice(0,1).remove()//删除一个评论分页导航 20 | 21 | index_overloaded(); //外部重载 22 | } 23 | overloaded(); 24 | 25 | //PJAX 26 | var pjax_main = '.pjax' , // 容器 27 | pjax_a = 'a[target!=_blank][rel!=nofollow][class!=no-ajax][date-ajax!=false]' , // 排除规则 28 | pjax_form = '.search form' , // 搜索表单form 29 | pjax_key = '.search_key' ; // 搜索表单input 30 | function reload_func(){ 31 | overloaded(); 32 | } 33 | $(function() { 34 | a(); 35 | }); 36 | function body_am(id) { 37 | id = isNaN(id) ? $('#' + id).offset().top : id; 38 | $("body,html").animate({ 39 | scrollTop: id 40 | }, 0); 41 | return false; 42 | } 43 | function to_am(url) { 44 | var anchor = location.hash.indexOf('#'); 45 | anchor = window.location.hash.substring(anchor + 1); 46 | body_am(anchor); 47 | } 48 | var home_url = document.location.href.match(/\/\/([^\/]+)\//i)[0]; 49 | function getFormJson(frm) { 50 | var o = {}; 51 | var a = $(frm).serializeArray(); 52 | $.each(a, 53 | function() { 54 | if (o[this.name] !== undefined) { 55 | if (!o[this.name].push) { 56 | o[this.name] = [o[this.name]]; 57 | } 58 | o[this.name].push(this.value || ''); 59 | } else { 60 | o[this.name] = this.value || ''; 61 | } 62 | }); 63 | return o; 64 | } 65 | function l(){ 66 | history.replaceState( 67 | { url: window.document.location.href, 68 | title: window.document.title, 69 | html: $(document).find(pjax_main).html(), 70 | }, window.document.title, document.location.href); 71 | } 72 | function a(){ 73 | window.addEventListener( 'popstate', function( e ){ 74 | if( e.state ){ 75 | document.title = e.state.title; 76 | $(pjax_main).html( e.state.html ); 77 | window.load =reload_func(); 78 | } 79 | }); 80 | } 81 | //AJAX核心 82 | function ajax(reqUrl, msg, method, data) { 83 | if (msg == 'pagelink' || msg == 'search') { // 页面、搜索 84 | $("body,html").animate({scrollTop:0}, 500); 85 | $("html").addClass("load"); 86 | } 87 | $.ajax({ 88 | url: reqUrl, 89 | type: method, 90 | data: data, 91 | beforeSend : function () { 92 | l(); 93 | }, 94 | success: function(data) { 95 | if (msg == 'pagelink' || msg == 'search') { 96 | $(pjax_main).html($(data).find(pjax_main).html()) ; 97 | $("html").removeClass("load"); 98 | } 99 | document.title = $(data).filter("title").text(); 100 | if (msg != 'comment') { 101 | var state = { 102 | url: reqUrl, 103 | title: $(data).filter("title").text(), 104 | html: $(data).find(pjax_main).html(), 105 | }; 106 | window.history.pushState(state, $(data).filter("title").text(), reqUrl); 107 | } 108 | }, 109 | complete: function() { 110 | if (msg == 'pagelink') { 111 | to_am(reqUrl) ; 112 | } 113 | window.load =reload_func(); 114 | }, 115 | timeout: 10000, 116 | error: function(request) { 117 | if (msg == msg == 'pagelink' || msg == 'search'){ 118 | location.href = reqUrl; 119 | }else { 120 | location.href = reqUrl; 121 | } 122 | }, 123 | }); 124 | } -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | add_section('biji_config',array( 18 | 'title' => '基本设置', 19 | 'priority' => 102 20 | ) ); 21 | $wp_customize->add_setting( 'biji_config_pjax', array( 22 | 'default' => '', 23 | ) ); 24 | $wp_customize->add_setting( 'biji_config_pjax_search', array( 25 | 'default' => '', 26 | ) ); 27 | $wp_customize->add_setting( 'biji_config_links', array( 28 | 'default' => '<li><a target="_blank" href="http://biji.io/">设计笔记</a></li>', 29 | ) ); 30 | $wp_customize->add_setting( 'biji_config_overcode', array( 31 | 'default' => '//一般放置统计代码 或者 需要在页面载入重新夹在的js代码', 32 | ) ); 33 | //-|------------ 34 | $wp_customize->add_control( 'biji_config_pjax', array( 35 | 'label' => __( '是否启用PJAX ', 'Bing' ), 36 | 'section' => 'biji_config', 37 | 'type' => 'checkbox' 38 | ) ); 39 | $wp_customize->add_control( 'biji_config_pjax_search', array( 40 | 'label' => __( '是否启用PJAX搜索 ', 'Bing' ), 41 | 'section' => 'biji_config', 42 | 'type' => 'checkbox' 43 | ) ); 44 | $wp_customize->add_control( 'biji_config_links', array( 45 | 'label' => __( '友情链接', 'Bing' ), 46 | 'section' => 'biji_config', 47 | 'type' => 'textarea' 48 | ) ); 49 | $wp_customize->add_control( 'biji_config_overcode', array( 50 | 'label' => __( '需要重载的代码', 'Bing' ), 51 | 'section' => 'biji_config', 52 | 'type' => 'textarea' 53 | ) ); 54 | 55 | 56 | $wp_customize->add_section('biji_other',array( 57 | 'title' => '其它设置', 58 | 'priority' => 103 59 | ) ); 60 | $wp_customize->add_setting( 'biji_other_pay_alipay', array( 61 | 'default' => '', 62 | 'transport' => 'postMessage', 63 | 'type' => 'option' 64 | ) ); 65 | $wp_customize->add_setting( 'biji_other_pay_wexpay', array( 66 | 'default' => '', 67 | 'transport' => 'postMessage', 68 | 'type' => 'option' 69 | ) ); 70 | $wp_customize->add_setting( 'biji_other_weibo', array( 71 | 'default' => '', 72 | ) ); 73 | $wp_customize->add_setting( 'biji_other_qq', array( 74 | 'default' => '', 75 | ) ); 76 | $wp_customize->add_setting( 'biji_other_douban', array( 77 | 'default' => '', 78 | ) ); 79 | $wp_customize->add_setting( 'biji_other_zhihu', array( 80 | 'default' => '', 81 | ) ); 82 | $wp_customize->add_setting( 'biji_other_github', array( 83 | 'default' => '', 84 | ) ); 85 | //-|------------ 86 | $wp_customize->add_control( 'biji_other_weibo', array( 87 | 'label' => '新浪微博', 88 | 'section' => 'biji_other' 89 | ) ); 90 | $wp_customize->add_control( 'biji_other_qq', array( 91 | 'label' => '腾讯QQ', 92 | 'section' => 'biji_other' 93 | ) ); 94 | $wp_customize->add_control( 'biji_other_douban', array( 95 | 'label' => '豆瓣', 96 | 'section' => 'biji_other' 97 | ) ); 98 | $wp_customize->add_control( 'biji_other_zhihu', array( 99 | 'label' => '知乎', 100 | 'section' => 'biji_other' 101 | ) ); 102 | $wp_customize->add_control( 'biji_other_github', array( 103 | 'label' => 'GitHub', 104 | 'section' => 'biji_other' 105 | ) ); 106 | $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'biji_other_pay_alipay', array( 107 | 'label' => '支付宝收款', 108 | 'section' => 'biji_other' 109 | ) ) ); 110 | $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'biji_other_pay_wexpay', array( 111 | 'label' => '微信收款', 112 | 'section' => 'biji_other' 113 | ) ) ); 114 | 115 | } 116 | add_action( 'customize_register', 'theme_customize_register' ); 117 | 118 | // 注册菜单 119 | if (function_exists('register_nav_menus')){ 120 | register_nav_menus( array( 121 | 'header_nav' => __('站点导航') 122 | //,'footer_nav' => __('底部菜单') 123 | ) ); 124 | } 125 | // 引入AJAX 126 | add_action('wp_ajax_nopriv_load_postlist', 'load_postlist_callback'); 127 | add_action('wp_ajax_load_postlist', 'load_postlist_callback'); 128 | function load_postlist_callback(){ 129 | $postlist = ''; 130 | $paged = $_POST["paged"]; 131 | $total = $_POST["total"]; 132 | $category = $_POST["category"]; 133 | $author = $_POST["author"]; 134 | $tag = $_POST["tag"]; 135 | $search = $_POST["search"]; 136 | $year = $_POST["year"]; 137 | $month = $_POST["month"]; 138 | $day = $_POST["day"]; 139 | $query_args = array( 140 | "posts_per_page" => get_option('posts_per_page'), 141 | "cat" => $category, 142 | "tag" => $tag, 143 | "author" => $author, 144 | "post_status" => "publish", 145 | "post_type" => "post", 146 | "paged" => $paged, 147 | "s" => $search, 148 | "year" => $year, 149 | "monthnum" => $month, 150 | "day" => $day 151 | ); 152 | $the_query = new WP_Query( $query_args ); 153 | while ( $the_query->have_posts() ){ 154 | $the_query->the_post(); 155 | $postlist .= make_post_section(); 156 | } 157 | $code = $postlist ? 200 : 500; 158 | wp_reset_postdata(); 159 | $next = ( $total > $paged )? ( $paged + 1 ) : '' ; 160 | echo json_encode(array('code'=>$code,'postlist'=>$postlist,'next'=> $next)); 161 | die; 162 | } 163 | 164 | // 优化代码 165 | remove_action( 'wp_head', 'feed_links_extra', 3 ); // 额外的feed,例如category, tag页 166 | remove_action( 'wp_head', 'wp_generator' ); //隐藏wordpress版本 167 | remove_filter('the_content', 'wptexturize'); //取消标点符号转义 168 | remove_action( 'admin_print_scripts', 'print_emoji_detection_script'); // 禁用Emoji表情 169 | remove_action( 'admin_print_styles', 'print_emoji_styles'); 170 | remove_action( 'wp_head', 'print_emoji_detection_script', 7); 171 | remove_action( 'wp_print_styles', 'print_emoji_styles'); 172 | remove_filter( 'the_content_feed', 'wp_staticize_emoji'); 173 | remove_filter( 'comment_text_rss', 'wp_staticize_emoji'); 174 | remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email'); 175 | add_filter('login_errors', create_function('$a', "return null;")); //取消登录错误提示 176 | add_filter( 'show_admin_bar', '__return_false' ); //删除AdminBar 177 | if ( function_exists('add_theme_support') )add_theme_support('post-thumbnails'); //添加特色缩略图支持 178 | // 移除菜单冗余代码 179 | add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); 180 | add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); 181 | add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); 182 | function my_css_attributes_filter($var) { 183 | return is_array($var) ? array_intersect($var, array('current-menu-item','current-post-ancestor','current-menu-ancestor','current-menu-parent')) : ''; 184 | } 185 | // 禁止wp-embed.min.js 186 | function disable_embeds_init() { 187 | global $wp; 188 | $wp->public_query_vars = array_diff( $wp->public_query_vars, array( 189 | 'embed', 190 | ) ); 191 | remove_action( 'rest_api_init', 'wp_oembed_register_route' ); 192 | add_filter( 'embed_oembed_discover', '__return_false' ); 193 | remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 ); 194 | remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); 195 | remove_action( 'wp_head', 'wp_oembed_add_host_js' ); 196 | add_filter( 'tiny_mce_plugins', 'disable_embeds_tiny_mce_plugin' ); 197 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 198 | } 199 | add_action( 'init', 'disable_embeds_init', 9999 ); 200 | function disable_embeds_tiny_mce_plugin( $plugins ) { 201 | return array_diff( $plugins, array( 'wpembed' ) ); 202 | } 203 | function disable_embeds_rewrites( $rules ) { 204 | foreach ( $rules as $rule => $rewrite ) { 205 | if ( false !== strpos( $rewrite, 'embed=true' ) ) { 206 | unset( $rules[ $rule ] ); 207 | } 208 | } 209 | return $rules; 210 | } 211 | function disable_embeds_remove_rewrite_rules() { 212 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 213 | flush_rewrite_rules(); 214 | } 215 | register_activation_hook( __FILE__, 'disable_embeds_remove_rewrite_rules' ); 216 | function disable_embeds_flush_rewrite_rules() { 217 | remove_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 218 | flush_rewrite_rules(); 219 | } 220 | register_deactivation_hook( __FILE__, 'disable_embeds_flush_rewrite_rules' ); 221 | // Gravatar头像使用中国服务器 222 | function gravatar_cn( $url ){ 223 | $gravatar_url = array('0.gravatar.com','1.gravatar.com','2.gravatar.com'); 224 | return str_replace( $gravatar_url, 'cn.gravatar.com', $url ); 225 | } 226 | add_filter( 'get_avatar_url', 'gravatar_cn', 4 ); 227 | // 阻止站内文章互相Pingback 228 | function theme_noself_ping( &$links ) { 229 | $home = get_option( 'home' ); 230 | foreach ( $links as $l => $link ) 231 | if ( 0 === strpos( $link, $home ) ) 232 | unset($links[$l]); 233 | } 234 | add_action('pre_ping','theme_noself_ping'); 235 | // 网页标题 236 | function Bing_add_theme_support_title(){ 237 | add_theme_support( 'title-tag' ); 238 | } 239 | add_action( 'after_setup_theme', 'Bing_add_theme_support_title' ); 240 | // 编辑器增强 241 | function enable_more_buttons($buttons) { 242 | $buttons[] = 'hr'; 243 | $buttons[] = 'del'; 244 | $buttons[] = 'sub'; 245 | $buttons[] = 'sup'; 246 | $buttons[] = 'fontselect'; 247 | $buttons[] = 'fontsizeselect'; 248 | $buttons[] = 'cleanup'; 249 | $buttons[] = 'styleselect'; 250 | $buttons[] = 'wp_page'; 251 | $buttons[] = 'anchor'; 252 | $buttons[] = 'backcolor'; 253 | return $buttons; 254 | } 255 | add_filter("mce_buttons_3", "enable_more_buttons"); 256 | // 拦截机器评论 257 | class anti_spam { 258 | function anti_spam() { 259 | if ( !current_user_can('level_0') ) { 260 | add_action('template_redirect', array($this, 'w_tb'), 1); 261 | add_action('init', array($this, 'gate'), 1); 262 | add_action('preprocess_comment', array($this, 'sink'), 1); 263 | } 264 | } 265 | function w_tb() { 266 | if ( is_singular() ) { 267 | ob_start(create_function('$input','return preg_replace("#textarea(.*?)name=([\"\'])comment([\"\'])(.+)/textarea>#", 268 | "textarea$1name=$2w$3$4/textarea>",$input);') ); 269 | } 270 | } 271 | function gate() { 272 | if ( !empty($_POST['w']) && empty($_POST['comment']) ) { 273 | $_POST['comment'] = $_POST['w']; 274 | } else { 275 | $request = $_SERVER['REQUEST_URI']; 276 | $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '隐瞒'; 277 | $IP= isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] . ' (透过代理)' : $_SERVER["REMOTE_ADDR"]; 278 | $way = isset($_POST['w'])? '手动操作' : '未经评论表格'; 279 | $spamcom = isset($_POST['comment'])? $_POST['comment']: null; 280 | $_POST['spam_confirmed'] = "请求: ". $request. "\n来路: ". $referer. "\nIP: ". $IP. "\n方式: ". $way. "\n內容: ". $spamcom. "\n -- 已备案 --"; 281 | } 282 | } 283 | function sink( $comment ) { 284 | if ( !empty($_POST['spam_confirmed']) ) { 285 | if ( in_array( $comment['comment_type'], array('pingback', 'trackback') ) ) return $comment; 286 | // 方法一: 直接挡掉, 將 die(); 287 | die(); 288 | // 方法二: 标记为 spam, 留在资料库检查是否误判. 289 | // add_filter('pre_comment_approved', create_function('', 'return "spam";')); 290 | // $comment['comment_content'] = "[ 防火墙提示:此条评论疑似Spam! ]\n". $_POST['spam_confirmed']; 291 | } 292 | return $comment; 293 | } 294 | } 295 | $anti_spam = new anti_spam(); 296 | 297 | function scp_comment_post( $incoming_comment ) { // 纯英文评论拦截 298 | if(!preg_match('/[一-龥]/u', $incoming_comment['comment_content'])) exit('

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

    '); 299 | //die(); // 直接挡掉,无提示 300 | return( $incoming_comment ); 301 | } 302 | add_filter('preprocess_comment', 'scp_comment_post'); 303 | // 评论@回复 304 | function idevs_comment_add_at( $comment_text, $comment = '') { 305 | if( $comment->comment_parent > 0) { 306 | $comment_text = '@'.get_comment_author( $comment->comment_parent ) . ' ' . $comment_text; 307 | } 308 | 309 | return $comment_text; 310 | } 311 | add_filter( 'comment_text' , 'idevs_comment_add_at', 20, 2); 312 | // 评论邮件延迟 313 | add_action('comment_post', 'comment_mail_schedule'); 314 | function comment_mail_schedule($comment_id){ 315 | wp_schedule_single_event( time()+60, 'comment_mail_event',array($comment_id)); 316 | } 317 | add_action('comment_mail_event','comment_mail_notify'); 318 | // 评论邮件通知 319 | function comment_mail_notify($comment_id) { 320 | $comment = get_comment($comment_id); 321 | $parent_id = $comment->comment_parent ? $comment->comment_parent : ''; 322 | $spam_confirmed = $comment->comment_approved; 323 | 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)) { 324 | $wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); //可以修改为你自己的邮箱地址 325 | $to = trim(get_comment($parent_id)->comment_author_email); 326 | $subject = '你在 [' . get_option("blogname") . '] 的留言有了新回复'; 327 | $message = ' 328 | 329 | 330 | 344 | 345 | 346 | 349 | 350 | 351 |
    331 | 336 |
    337 |

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

    338 |

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

    339 |

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

    340 |

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

    341 | 立即回复 342 |
    343 |
    347 |
    本邮件由 ' . get_option("blogname") . ' 后台自动发送,请勿直接回复!
    348 |
    '; 352 | $from = "From: \"" . get_option('blogname') . "\" <$wp_email>"; 353 | $headers = "$from\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n"; 354 | wp_mail( $to, $subject, $message, $headers ); 355 | } 356 | }; 357 | // 缩略图技术 by:http://www.bgbk.org 358 | if( !defined( 'THEME_THUMBNAIL_PATH' ) ) define( 'THEME_THUMBNAIL_PATH', '/cache/theme-thumbnail' ); //存储目录 359 | function biji_build_empty_index( $path ){ //生成空白首页 360 | $index = $path . '/index.php'; 361 | if( is_file( $index ) ) return; 362 | wp_mkdir_p( $path ); 363 | file_put_contents( $index, "get_size(); 375 | $dims = image_resize_dimensions( $size['width'], $size['height'], $width, $height, true ); 376 | //if( !$dims ) return $url; 377 | $cmp = min( $size['width'] / $width, $size['height'] / $height ); 378 | if( is_wp_error( $editor->crop( $dims[2], $dims[3], $width * $cmp, $height * $cmp, $width, $height ) ) ) return $url; 379 | biji_build_empty_index( constant( 'WP_CONTENT_DIR' ) . constant( 'THEME_THUMBNAIL_PATH' ) ); 380 | return is_wp_error( $editor->save( $file_path, 'image/jpg' ) ) ? $url : $file_url; 381 | } 382 | //缩略图获取post_thumbnail 383 | function post_thumbnail($width = 275,$height = 170 ) 384 | { 385 | global $post; 386 | //如果有特色图片则取特色图片 387 | if( has_post_thumbnail( $post->ID ) ){ 388 | $thumbnail_ID = get_post_thumbnail_id( $post->ID ); 389 | $thumbnailsrc = wp_get_attachment_image_src( $thumbnail_ID, 'full' ); 390 | return biji_crop_thumbnail($thumbnailsrc[0],$width,$height); 391 | } else { 392 | $content = $post->post_content; 393 | preg_match_all('//sim', $content, $strResult, PREG_PATTERN_ORDER); 394 | if(count($strResult[1]) > 0) return biji_crop_thumbnail($strResult[1][0],$width,$height); 395 | else{ 396 | return false; 397 | } 398 | } 399 | } 400 | // 读者墙 401 | if(!function_exists("deep_in_array")) { 402 | function deep_in_array($value, $array) { 403 | $i = -1; 404 | foreach($array as $item => $v) { 405 | $i++; 406 | if($v["email"] == $value) return $i; 407 | } 408 | return -1; 409 | } 410 | } 411 | 412 | function get_active_friends($num = null,$size = null,$days = null) { 413 | $num = $num ? $num : 15; 414 | $size = $size ? $size : 34; 415 | $days = $days ? $days : 30; 416 | $array = array(); 417 | $comments = get_comments( array('status' => 'approve','author__not_in'=>1,'date_query'=>array('after' => $days . ' days ago')) ); 418 | if(!empty($comments)) { 419 | foreach($comments as $comment){ 420 | $email = $comment->comment_author_email; 421 | $author = $comment->comment_author; 422 | $url = $comment->comment_author_url; 423 | $data = human_time_diff(strtotime($comment->comment_date)); 424 | if($email!=""){ 425 | $index = deep_in_array($email, $array); 426 | if( $index > -1){ 427 | $array[$index]["number"] +=1; 428 | }else{ 429 | array_push($array, array( 430 | "email" => $email, 431 | "author" => $author, 432 | "url" => $url, 433 | "date" => $data, 434 | "number" => 1 435 | )); 436 | } 437 | } 438 | } 439 | foreach ($array as $k => $v) { 440 | $edition[] = $v['number']; 441 | } 442 | array_multisort($edition, SORT_DESC, $array); // 数组倒序排列 443 | } 444 | $output = ''; 458 | return $output; 459 | } 460 | function active_shortcode( $atts, $content = null ) { 461 | 462 | extract( shortcode_atts( array( 463 | 'num' => '', 464 | 'size' => '', 465 | 'days' => '', 466 | ), 467 | $atts ) ); 468 | return get_active_friends($num,$size,$days); 469 | } 470 | add_shortcode('active', 'active_shortcode'); 471 | 472 | /* 473 | //链接重定向跳转 474 | add_filter('get_comment_author_link', 'add_redirect_comment_link', 5); 475 | add_filter('comment_text', 'add_redirect_comment_link', 99); 476 | function add_redirect_comment_link($text = ''){ 477 | $text=str_replace(get_comment_author_url(),get_option('home')."/index.php?link=".base64_encode(get_comment_author_url()),$text); 478 | return $text; 479 | } 480 | */ 481 | 482 | /** 483 | * Theme Update Checker Library 1.2 / 主题更新推送 484 | * http://w-shadow.com/ 485 | * Copyright 2012 Janis Elsts 486 | * Licensed under the GNU GPL license. 487 | * http://www.gnu.org/licenses/gpl.html 488 | */ 489 | if ( !class_exists('ThemeUpdateChecker') ): 490 | class ThemeUpdateChecker { 491 | public $theme = ''; 492 | public $metadataUrl = ''; 493 | public $enableAutomaticChecking = true; 494 | protected $optionName = ''; 495 | protected $automaticCheckDone = false; 496 | protected static $filterPrefix = 'tuc_request_update_'; 497 | public function __construct($theme, $metadataUrl, $enableAutomaticChecking = true){ 498 | $this->metadataUrl = $metadataUrl; 499 | $this->enableAutomaticChecking = $enableAutomaticChecking; 500 | $this->theme = $theme; 501 | $this->optionName = 'external_theme_updates-'.$this->theme; 502 | $this->installHooks(); 503 | } 504 | public function installHooks(){ 505 | if ( $this->enableAutomaticChecking ){ 506 | add_filter('pre_set_site_transient_update_themes', array($this, 'onTransientUpdate')); 507 | } 508 | add_filter('site_transient_update_themes', array($this,'injectUpdate')); 509 | add_action('delete_site_transient_update_themes', array($this, 'deleteStoredData')); 510 | } 511 | public function requestUpdate($queryArgs = array()){ 512 | $queryArgs['installed_version'] = $this->getInstalledVersion(); 513 | $queryArgs = apply_filters(self::$filterPrefix.'query_args-'.$this->theme, $queryArgs); 514 | $options = array( 515 | 'timeout' => 10, 516 | ); 517 | $options = apply_filters(self::$filterPrefix.'options-'.$this->theme, $options); 518 | $url = $this->metadataUrl; 519 | if ( !empty($queryArgs) ){ 520 | $url = add_query_arg($queryArgs, $url); 521 | } 522 | $result = wp_remote_get($url, $options); 523 | $themeUpdate = null; 524 | $code = wp_remote_retrieve_response_code($result); 525 | $body = wp_remote_retrieve_body($result); 526 | if ( ($code == 200) && !empty($body) ){ 527 | $themeUpdate = ThemeUpdate::fromJson($body); 528 | if ( ($themeUpdate != null) && version_compare($themeUpdate->version, $this->getInstalledVersion(), '<=') ){ 529 | $themeUpdate = null; 530 | } 531 | } 532 | $themeUpdate = apply_filters(self::$filterPrefix.'result-'.$this->theme, $themeUpdate, $result); 533 | return $themeUpdate; 534 | } 535 | public function getInstalledVersion(){ 536 | if ( function_exists('wp_get_theme') ) { 537 | $theme = wp_get_theme($this->theme); 538 | return $theme->get('Version'); 539 | } 540 | foreach(get_themes() as $theme){ 541 | if ( $theme['Stylesheet'] === $this->theme ){ 542 | return $theme['Version']; 543 | } 544 | } 545 | return ''; 546 | } 547 | public function checkForUpdates(){ 548 | $state = get_option($this->optionName); 549 | if ( empty($state) ){ 550 | $state = new StdClass; 551 | $state->lastCheck = 0; 552 | $state->checkedVersion = ''; 553 | $state->update = null; 554 | } 555 | $state->lastCheck = time(); 556 | $state->checkedVersion = $this->getInstalledVersion(); 557 | update_option($this->optionName, $state); 558 | $state->update = $this->requestUpdate(); 559 | update_option($this->optionName, $state); 560 | } 561 | public function onTransientUpdate($value){ 562 | if ( !$this->automaticCheckDone ){ 563 | $this->checkForUpdates(); 564 | $this->automaticCheckDone = true; 565 | } 566 | return $value; 567 | } 568 | public function injectUpdate($updates){ 569 | $state = get_option($this->optionName); 570 | if ( !empty($state) && isset($state->update) && !empty($state->update) ){ 571 | $updates->response[$this->theme] = $state->update->toWpFormat(); 572 | } 573 | return $updates; 574 | } 575 | public function deleteStoredData(){ 576 | delete_option($this->optionName); 577 | } 578 | public function addQueryArgFilter($callback){ 579 | add_filter(self::$filterPrefix.'query_args-'.$this->theme, $callback); 580 | } 581 | public function addHttpRequestArgFilter($callback){ 582 | add_filter(self::$filterPrefix.'options-'.$this->theme, $callback); 583 | } 584 | public function addResultFilter($callback){ 585 | add_filter(self::$filterPrefix.'result-'.$this->theme, $callback, 10, 2); 586 | } 587 | } 588 | endif; 589 | if ( !class_exists('ThemeUpdate') ): 590 | class ThemeUpdate { 591 | public $version; 592 | public $details_url; 593 | public $download_url; 594 | public static function fromJson($json){ 595 | $apiResponse = json_decode($json); 596 | if ( empty($apiResponse) || !is_object($apiResponse) ){ 597 | return null; 598 | } 599 | $valid = isset($apiResponse->version) && !empty($apiResponse->version) && isset($apiResponse->details_url) && !empty($apiResponse->details_url); 600 | if ( !$valid ){ 601 | return null; 602 | } 603 | $update = new self(); 604 | foreach(get_object_vars($apiResponse) as $key => $value){ 605 | $update->$key = $value; 606 | } 607 | return $update; 608 | } 609 | public function toWpFormat(){ 610 | $update = array( 611 | 'new_version' => $this->version, 612 | 'url' => $this->details_url, 613 | ); 614 | if ( !empty($this->download_url) ){ 615 | $update['package'] = $this->download_url; 616 | } 617 | return $update; 618 | } 619 | } 620 | endif; 621 | $mytheme_update_checker = new ThemeUpdateChecker( 622 | 'iDevise', 623 | 'https://biji.io/idevise/update.json' 624 | ); 625 | // 全部配置完毕 626 | ?> -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tokinx/iDevise/e9b9669d79e3fb566f29b89697035955ea21e326/images/favicon.png -------------------------------------------------------------------------------- /images/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tokinx/iDevise/e9b9669d79e3fb566f29b89697035955ea21e326/images/iconfont.eot -------------------------------------------------------------------------------- /images/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Wed Feb 24 00:09:14 2016 6 | By Ads 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 36 | 43 | 52 | 54 | 58 | 63 | 67 | 74 | 80 | 82 | 84 | 87 | 90 | 93 | 97 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /images/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tokinx/iDevise/e9b9669d79e3fb566f29b89697035955ea21e326/images/iconfont.ttf -------------------------------------------------------------------------------- /images/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tokinx/iDevise/e9b9669d79e3fb566f29b89697035955ea21e326/images/iconfont.woff -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 |
    17 |
    18 | 30 | 31 |
    32 | 33 |

    34 |
    35 | 39 |
    40 |
    41 | 42 |
      43 | 44 |
    • 45 | 46 |
    • 47 | 48 |
    • 49 | 50 |
    • 51 | 52 |
    • 53 | 54 |
    55 | 56 | 57 | 58 |
    59 | 打 60 |
      61 | 62 |
    • 用支付宝打我
    • 63 | 64 |
    • 用微信打我
    • 65 | 66 |
    67 |
    68 | 69 | 70 |
    71 | 72 |

    73 |
    74 |
    75 | 76 | 78 |
    79 |
    80 | 81 | 82 | '; 84 | }?> 85 | 86 |
    87 |

    88 |
    89 |

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

    90 |
    91 |
    92 | 93 |
    94 |
    95 | 98 |
    99 |
    100 | 101 |
    102 | 108 | 125 | \nfunction index_overloaded(){\n".get_theme_mod('biji_config_overcode')."\n}\n\n"?> 127 | 128 | 129 | 149 | 150 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tokinx/iDevise/e9b9669d79e3fb566f29b89697035955ea21e326/screenshot.png -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* 3 | Theme Name: iDevise 4 | Theme URL: http://biji.io 5 | Description: 长期支援版本。 6 | Author: Tokin 7 | Author URI: http://biji.io 8 | Version: 2.0.0 9 | */ 10 | 11 | /* 初始化 */ 12 | *,*:before,*:after{transition:.2s;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} 13 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;outline:none;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;margin:0;padding:0;} 14 | html,body{height:100%;} 15 | body{background:#fff} 16 | body,input,button,textarea{-webkit-appearance:none;border-radius:0;font-family: "Lucida Grande", "Helvetica Neue", "Arial", "Hiragino Sans GB", "Noto Sans CJK SC", "Heiti SC", "Microsoft YaHei", "WenQuanYi Microhei", sans-serif;letter-spacing:.04em;line-height:2.4em;font-size:15px;color:#888;} 17 | p{color:#333;} 18 | br{display:block;line-height:1.6em;} 19 | ol,ul,li{list-style:none;} 20 | input,textarea,button{outline:none;} 21 | blockquote,q{quotes:none;} 22 | blockquote:before,blockquote:after,q:before,q:after{content:none;} 23 | strong,b{font-weight:bold;} 24 | em,i{font-style:italic;} 25 | table{border-collapse:collapse;border-spacing:0;} 26 | a{color:#333;text-decoration:none;position:relative;} 27 | a:hover{color:#f55;} 28 | img{border:0;max-width:100%;} 29 | @font-face {font-family: 'iconfont'; 30 | src: url('images/iconfont.eot'); 31 | src: url('images/iconfont.eot?#iefix') format('embedded-opentype'), 32 | url('images/iconfont.woff') format('woff'), 33 | url('images/iconfont.ttf') format('truetype'), 34 | url('images/iconfont.svg#iconfont') format('svg');} 35 | .iconfont,.icon:before{font-family:"iconfont" !important;font-size:16px;font-style:normal;-webkit-font-smoothing: antialiased;-webkit-text-stroke-width: 0.2px;-moz-osx-font-smoothing: grayscale;} 36 | .clearer{display:block;clear:both;} 37 | .container{margin:auto;max-width:860px;width:96%;} 38 | .left{float:left;} 39 | .right{float:right;} 40 | ::-webkit-scrollbar-track-piece{background-color:#fff;} 41 | ::-webkit-scrollbar{width:10px;height:10px;} 42 | ::-webkit-scrollbar-thumb{background:#666;border-left:2px solid #fff;border-right:2px solid #fff} 43 | /* 页头 */ 44 | #header{width:100%;height:120px;background:#fff;} 45 | #header:before{content:'';position:absolute;height:1px;top:120px;left:0;right:0;background:#eee} 46 | #header .logo{font-size:28px;line-height:120px;float:left;position:relative;} 47 | #header .logo i{font-size:30px;position:absolute;top:51%;right:-35px;line-height:0;opacity:0;} 48 | #header .logo:hover i{font-size:20px;right:-29px;opacity:1;} 49 | 50 | /* 导航 */ 51 | #topMenu{float:right;cursor:pointer;height:40px;margin:38px 0 0 -10px;padding:6px;position:relative;} 52 | #topMenu ul {display:none;line-height:36px;margin:0 0 0 -10px;width:120px;position:absolute;right:0;top:21px;background:#fff;box-shadow:0 1px 5px rgba(0,0,0,.2);z-index:9;animation:nav_ul .3s;} 53 | #topMenu ul li {display:inline;font-size:.8rem;position:relative;padding:0 0 15px 0;} 54 | #topMenu ul li a {width:100%;display:block;text-align:center;} 55 | #topMenu ul li:hover a {background:#f55;color:#fff;} 56 | #topMenu ul li ul {display:none;} 57 | #topMenu ul li:hover ul {display:block;position:absolute;width:100px;right:-10px;top:-32px;line-height:32px;} 58 | #topMenu ul li:hover ul li a {background:none;color:#333;} 59 | #topMenu ul li:hover ul li:hover a {background:#f55;color:#fff;} 60 | #topMenu .i_1,#topMenu .i_2{content:"";position:absolute;} 61 | #topMenu div,#topMenu .i_1,#topMenu .i_2 {top:14px;left:0;width:26px;height:1px;background:#ccc;display:block;position:relative;} 62 | #topMenu .i_1 {top:2px;} 63 | #topMenu .i_2 {top:23px;} 64 | #topMenu.menu_close .i_2{top:11px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);-moz-transform:rotate(-45deg);} 65 | #topMenu.menu_close .i_1{top:12px;transform:rotate(45deg);-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);-moz-transform:rotate(45deg);} 66 | #topMenu.menu_close .i_1,#topMenu.menu_close .i_2 {background:#f55;} 67 | #topMenu.menu_close div {background:none;} 68 | #topMenu.menu_close ul {display:block;} 69 | #topMenu.menu_close ul li ul {display:none;} 70 | #topMenu.menu_close ul li:hover ul {display:block;} 71 | @keyframes nav_ul { 72 | 0% {opacity:0;transform:scale(0);} 73 | 100% {opacity:1;} 74 | } 75 | 76 | /* 文章列表 */ 77 | .blockGroup{padding:5% 30px;} 78 | .post-list{margin:0 0 10% 0;position:relative;} 79 | .post-list .icon{position:absolute;width:55px;height:55px;top:4px;left:0px;padding:1px;border-radius:100px;box-shadow: 0 0 0 1px #eee,0 3px 3px -1px #eee;} 80 | .post-list .icon:after{content:'';position:absolute;width:1px;top:25%;height:50%;right:-14px;background:#eee;} 81 | .post-list .icon i{position:absolute;left:3px;right:0;top:4px;color:#ccc;text-align:center;font-size:26px;line-height:50px;z-index:0;} 82 | .post-list .icon img{border-radius:100px;position:relative;z-index:1;width:100%;height:100%;} 83 | 84 | .post-list h2.title{font-size:22px;margin:0 0 0 80px;position:relative;z-index:1;overflow:hidden;} 85 | .post-list h2.title a{padding:0 10px 0 0;} 86 | .post-list .p_time{font-size:12px;margin:0 0 0 80px;} 87 | .post-list p{margin:1% 0 0 0;color:#666;} 88 | 89 | 90 | /* 通用文章格式支持 */ 91 | .single{position:relative;} 92 | h2.s_title{font-size:22px;margin:0 0 8% 0;position:relative;color:#333;} 93 | h2.s_title:after{position:absolute;content:"";height:1px;width:30%;background:#eee;left:0;bottom:-.6em;} 94 | 95 | .single img{max-width:100%;height:auto;margin:10px auto;display:block;float:none;} 96 | .single embed{max-width:100%;margin:10px auto;display:block;} 97 | .single a {text-decoration:none;} 98 | .single p{margin:0 0 10px;} 99 | .single p a,.single p a span{background:#fafafa;color:#333!important;padding:2px 6px;} 100 | .single p a span{padding:0;} 101 | .single p a:hover,.single p a:hover span{background:#f55;color:#fff!important;} 102 | .single h1,.single h2,.single h3,.single h4{margin:30px 0 10px 1.6em;color:#333;position:relative} 103 | .single h1:before,.single h2:before,.single h3:before,.single h4:before,.single h1:after,.single h2:after,.single h3:after,.single h4:after{content:"";position:absolute;width:4px;height:4px;background:#fa1;left:-22px;top:.7em;} 104 | .single h1:after,.single h2:after,.single h3:after,.single h4:after{background:#f55;left:-12px;top:.3em;} 105 | .single h1{font-size:24px;line-height:28px;} 106 | .single h2{font-size:20px;line-height:24px;} 107 | .single h3{font-size:18px;line-height:22px;} 108 | .single h4{font-size:16px;line-height:18px;} 109 | .single blockquote{border-left:3px solid #333;background:#fafafa;margin:20px 0;padding:10px 20px;} 110 | .single ol,.single ul{margin:10px 0;padding:10px 40px;background:#fafafa;} 111 | .single ol li{list-style-type:decimal;} 112 | .single ul li{list-style-type:disc;} 113 | .single strong{font-weight:bold;color:#000;background:#eee;border-radius:3px;padding:0 2px;} 114 | .single hr{border:none;height:1px;background:#eee;margin:50px 30%;} 115 | .single pre code{display:block;overflow:auto;max-height:18em;font-size:14px;line-height:26px;padding:1em;margin:1em 0;background:#333;border-radius:0;white-space: pre-wrap;word-wrap: break-word;} 116 | .single code{padding:2px 4px;background:#eee;box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;border-radius:3px;color:#2aa;} 117 | .single code{font-family:"Verdana","Courier New","Trebuchet MS","Helvetica",sans-serif;} 118 | .single table{border-bottom:1px solid #504F4F;border-right:1px solid #504F4F;border-collapse:collapse;border-spacing:0;margin:0 0 20px;width:100%;} 119 | .single th{font-size:14px;font-weight:bold;} 120 | .single th,.single td{border-top:1px solid #504F4F;padding:6px 10px 6px 6px;border-left:1px solid #504F4F;} 121 | .single dl{margin:0 20px;} 122 | .single dt {font-weight:bold;} 123 | .single dd {margin:0 0 20px;} 124 | 125 | .single div.img{overflow:hidden;margin: 0 -30px;} 126 | .single div.img br{display:none;} 127 | .single div.img img{width:100%;margin:auto;} 128 | .single div.img_3 img{width:33.333333%;float:left;margin:0;} 129 | .single div.img_2 img{width:50%;float:left;margin:0;} 130 | 131 | .gallery{ 132 | margin:-1%!important; 133 | } 134 | .gallery .gallery-item { 135 | padding:1%; 136 | /* width:14.66666%!important; */ 137 | margin: 0 !important; 138 | overflow:hidden; 139 | position:relative; 140 | } 141 | .gallery-columns-3 .gallery-item{ 142 | width:33.3333333%!important; 143 | } 144 | .gallery .gallery-item dt:before { 145 | content: ""; 146 | display: block; 147 | padding-top: 100%; 148 | } 149 | .gallery .gallery-item dt { 150 | position: relative; 151 | box-shadow:0 0 0 1px rgba(0,0,0,.1) inset; 152 | background: #eee; 153 | cursor: pointer; 154 | overflow: hidden; 155 | } 156 | .gallery .gallery-item a { 157 | position: absolute; 158 | top: 0; 159 | right: 0; 160 | bottom: 0; 161 | left: 0; 162 | opacity: 1; 163 | -webkit-transition: opacity .1s; 164 | transition: opacity .1s; 165 | transform: translate(50%,50%); 166 | } 167 | .gallery .gallery-item img{ 168 | margin:0; 169 | position:absolute; 170 | top: 0; 171 | left: 0; 172 | max-height:100%; 173 | max-width:none!important; 174 | width:auto!important; 175 | border:0!important; 176 | transform: translate(-50%,-50%); 177 | } 178 | 179 | .ending{display:block;width:100%;height:60px;margin:30px 0;border-top:1px dashed #ddd;border-bottom:1px dashed #ddd;position:relative;} 180 | /* 赏赐 */ 181 | .reward{width:30px;height:30px;line-height:30px;font-size:18px;color:#fff;border-radius:100px;text-align:center;position:relative; 182 | border:1px solid #f1b60e;background:#fccd60;cursor:pointer;position:absolute;left:66px;top:14px;} 183 | .reward ul{z-index:1;display:none;position:absolute;top:-60px;right:-280px;padding:6px;font-size:13px;width:260px;height:150px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 1px 1px 1px #efefef} 184 | .reward ul:after,.reward ul:before {position:absolute;content:'';border:10px solid transparent;top:50%;left:-20px;margin-top:-10px;} 185 | .reward ul:before{left:-21px;border-right-color:#e6e6e6;} 186 | .reward ul:after{border-right-color:#fff;} 187 | .reward:hover ul{display:block} 188 | .reward ul li{display:inline-block;width:48%;padding:10px;color:#333;line-height:20px;} 189 | /* 简介 */ 190 | .about{position:relative;position:absolute;left:20px;top:14px;} 191 | .about img{width:30px;height:30px;border-radius:100%;border:1px solid #ccc;cursor:pointer;} 192 | .about p{z-index:1;display:none;position:absolute;top:-8px;right:-280px;padding:10px;font-size:13px;line-height:26px;width:260px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 1px 1px 1px #efefef} 193 | .about p:after,.about p:before {position:absolute;content:'';border:10px solid transparent;top:12px;left:-20px;} 194 | .about p:before{left:-21px;border-right-color:#e6e6e6;} 195 | .about p:after{border-right-color:#fff;} 196 | .about:hover p{display:block} 197 | /* 社交 */ 198 | .sns{margin:0 10px;float:right} 199 | .sns li{float:left;margin:0 10px;} 200 | .sns li i{line-height:56px;} 201 | .sns li.weibo i{color:#d55} 202 | .sns li.tencent i{color:#3cf} 203 | .sns li.douban i{color:#5a7} 204 | .sns li.zhihu i{color:#2ae} 205 | .sns li.github i{color:#000;line-height:58px;} 206 | /* 评论部分 */ 207 | #comments{text-align:center;margin:40px 0;font-size:13px;color:#aaa;} 208 | .comment{z-index:1;} 209 | .comment.depth-1{margin:20px 0 20px 0;border-bottom:1px solid #eee;padding:0 0 20px;overflow:hidden;} 210 | .comment.depth-1 .depth-1{padding: 0 0;border:0;} 211 | .comment .comment{margin-left:30px;margin-top:10px;} 212 | .comment .comment .comment{margin-left:0px;} 213 | .comment .comment-body{padding:10px;position:relative;} 214 | .comment .comment-body p{font-size:13px;clear:both;} 215 | .comment br{display:none;} 216 | .comment .comment-author{font-size:13px;margin:0 0 24px 0;line-height: 26px;} 217 | .comment .comment-author .avatar{float:left;width:42px;height:42px;padding:1px;margin:0 10px 0 0;border-radius: 100px;box-shadow:0 0 1px #fff,0 0 2px #aaa} 218 | .comment .comment-author cite,.comment .comment-author span{position:relative;top: -2px;} 219 | .comment .comment-author span{left:5px;color:#aaa} 220 | .comment .comment-awaiting-moderation{font-style:normal;color:#f55;} 221 | .comment .comment-meta {position:absolute;top: 28px;left:62px;height: 26px;overflow: hidden;font-size:13px;color:#aaa;} 222 | .comment .comment-meta a{color:#aaa} 223 | .comment .comment-meta a.comment-edit-link{display:none;} 224 | .comment .reply a{position:absolute;top:10px;right:0;font-size: 12px;line-height:20px;padding:0 5px;color:#fff;border-radius:3px;background:#fa1;} 225 | .comment .reply:hover a{background:#f55;} 226 | #respond{border-top:1px solid #eee;position:relative;} 227 | #respond:before{content:"";position:absolute;width:7.6em;height:1px;background:#f55;top:-1px;left:-100px;opacity:0;} 228 | #respond:hover:before{left:0;opacity:1;} 229 | #respond h3{font-weight:bold;float:left;margin:10px 0 0;} 230 | #commentform{clear:both;line-height:1em;font-size:13px;} 231 | #commentform a{line-height:2.6em} 232 | #commentform label{display:block;position:relative;right:0;margin:10px 0 -4px 0;} 233 | #commentform input,#commentform textarea{max-width:220px;width:100%;padding:3px 10px;margin:10px 5px 0 0;border:2px solid #eee;border-radius:3px;background:#fff;font-size:13px} 234 | #commentform textarea {max-width:100%;width:100%;height:8em;} 235 | #commentform textarea:focus,#commentform input:focus{border:2px solid #f55;} 236 | #commentform input#submit{cursor:pointer;max-width:100%} 237 | #commentform input#submit:hover{background:#f55;border:2px solid #f55;color:#fff;} 238 | .butterBar{width:100%;line-height:80px;position:fixed;text-align:center;left:0;top:0;z-index:11;background:rgba(255,255,255,.8);box-shadow:0 1px 3px #eee;} 239 | .butterBar-message{font-size:14px;} 240 | 241 | .commentlist{counter-reset: comment-floor;} 242 | .commentlist > .comment{position:relative;} 243 | .commentlist > .comment:before{content:'#'counter(comment-floor);counter-increment:comment-floor;font-size:18px;position:absolute;top:40px;right:0;color:#ccc;} 244 | 245 | /* 翻页按钮 */ 246 | .navigator {text-align:center;background:none;border:0;padding: 0 0 12% 0;} 247 | .navigator a{margin:0 5%;width:40px;height:40px;line-height:40px;display:inline-block;font-size:30px;border-radius:100px;border:1px solid #ddd;color:#aaa;} 248 | .navigator a i{font-size:30px;} 249 | .navigator a:hover{border:1px solid #e00;background:#f55;color:#fff;} 250 | .navigator a:hover i{color:#fff;} 251 | 252 | .is-loading div,.load .load_comments div{background-color: #f55;width: 10px;height: 10px;margin:0 5px;display: inline-block; 253 | -webkit-animation: ball-beat 0.7s 0s infinite linear;animation: ball-beat 0.7s 0s infinite linear; } 254 | .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; } 255 | .load .load_comments{text-align:center;margin:10% 0;} 256 | 257 | .navigation{text-align:center;margin:40px 0;} 258 | .navigation div{display:inline-block;} 259 | .navigation a{margin:0 20px;padding:0 12px;} 260 | 261 | /* 读者排行 */ 262 | ul.active-items{text-align:center;overflow:hidden;background:none;padding:0;margin:0 0 60px 0;line-height:0;} 263 | ul.active-items li{display:inline-block;margin:0;padding:0;width:42px;height:42px;list-style:none;} 264 | ul.active-items li img{margin:0;} 265 | 266 | /* 友情链接 */ 267 | ul.link-items{overflow:hidden;padding:0;background:none;} 268 | ul.link-items li{width:19.4%;display:inline-block;text-align:center;} 269 | ul.link-items li img{width:50%;border-radius:100%;margin-bottom:0;} 270 | 271 | /* 搜索 */ 272 | .search{width:100%;text-align:center;background: #eee;padding:12px 0;} 273 | .search input,.search button{max-width:220px;width:100%;border:0;padding:0 10px;margin:0;line-height:36px;height:36px;} 274 | .search button{max-width:100px;background:#fa1;color:#fff;cursor:pointer;margin:0 0 0 -6px} 275 | .search button:hover{background:#f55;} 276 | 277 | /* 页脚 */ 278 | #footer{color:#ccc;text-shadow:0 1px 1px #eee;padding:20px 0;text-align:center;font-size:13px;text-shadow:none;} 279 | #footer *{color:#aaa;text-shadow:none;}#footer *:hover{color:#f55;} 280 | #footer ul li {display:inline-block;margin:0 10px 0 0;} 281 | #footer ul{margin:0 auto 10px;overflow:hidden;border-bottom:1px solid #eee;padding:0 0 10px 0;} 282 | .back2top{z-index:99;content:"";position:fixed;right:40px;bottom:40px;width: 0;height: 0;cursor:pointer; 283 | border-left:15px solid transparent; 284 | border-right:15px solid transparent; 285 | border-bottom:20px solid #ddd;} 286 | /* 动画 */ 287 | @keyframes ball-beat {50% {opacity: 0;transform: scale(0.75); }100% {opacity: 1;transform: scale(1); } } 288 | @-webkit-keyframes ball-beat {50% {opacity: 0;-webkit-transform: scale(0.75);}100% {opacity: 1;-webkit-transform: scale(1);} } 289 | @-moz-keyframes ball-beat {50% {opacity: 0;-moz-transform: scale(0.75);}100% {opacity: 1;-moz-transform: scale(1);} } 290 | body{opacity:1;} 291 | .load body{opacity:.3;} 292 | .load:before{content:"";line-height:0;position:fixed;left:-100%;width:100%;height:2px;background:#f55;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;} 293 | @keyframes load {0% {left:-100%;}100% {left:100%;}} 294 | @-webkit-keyframes load {0% {left:-100%;}100% {left:100%;}} 295 | @-moz-keyframes load {0% {left:-100%;}100% {left:100%;}} 296 | 297 | /* 响应式 */ 298 | @media(max-width:720px){ 299 | #header{line-height:50px;height:50px;position:fixed;background:#fff;z-index:10;border-bottom:1px solid #eee} 300 | #header .logo{line-height:50px;} 301 | #topMenu{margin:4px 0 0 -10px;} 302 | #main{width:100%;} 303 | .post-list .icon{width:55px;height:55px;overflow:hidden;margin: 8px 0 0 0;left:-75px;} 304 | .post-list .icon i{line-height:55px;top:1px;} 305 | .post-list{margin:0 0 3% 75px;padding:0 0 3% 0;border-bottom:1px solid #eee} 306 | .post-list h2.title{font-size:16px;margin:0;line-height:30px;height: 26px;overflow:hidden;} 307 | .post-list .p_time{line-height:18px;margin:auto;color:#ccc;} 308 | .post-list p{font-size:12px;margin:0 0 5px 0;line-height:18px;height:2.8em;overflow:hidden;} 309 | .blockGroup {margin:0;padding:4%;padding-top:62px;} 310 | .navigator {padding: 0 0 6% 0;} 311 | .search input{max-width:56%;} 312 | .arrow,#footer .links_adlink,.post-list h2.title:before,.post-list h2.title:after,#header:before,.post-list .icon:after{display:none;} 313 | 314 | .ending{height:80px;} 315 | .about{width:30px;height:30px;left:0;right:0;margin:auto;top:-15px;} 316 | .about p{left:-376%;top:-500%;} 317 | .reward{left:0;right:0;margin:auto;bottom:-60px;} 318 | .reward ul{left:-408%;top:-1000%;} 319 | .reward ul:after,.reward ul:before,.about p:after,.about p:before{display:none} 320 | .sns{margin:10px 10px 0;float:none;text-align:center} 321 | .sns li{float:none;display:inline-block;} 322 | } 323 | } --------------------------------------------------------------------------------