├── screenshot.png ├── images ├── grey.png ├── qzone.gif ├── sina.gif ├── look │ ├── lei.gif │ ├── tu.gif │ ├── xu.gif │ ├── aini.gif │ ├── bishi.gif │ ├── bizui.gif │ ├── haha.gif │ ├── hehe.gif │ ├── jiyan.gif │ ├── keai.gif │ ├── shuai.gif │ ├── weiqu.gif │ ├── xixi.gif │ ├── chijing.gif │ ├── haixiu.gif │ ├── kelian.gif │ ├── qinqin.gif │ ├── touxiao.gif │ ├── wabishi.gif │ ├── landelini.gif │ ├── shengbing.gif │ ├── taikaixin.gif │ ├── youhengheng.gif │ └── zuohengheng.gif ├── qq_32x32.png ├── screenshot_64.png ├── weibo_32x32.png └── wordpress_32x32.png ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff ├── README.md ├── style.css ├── page.php ├── footer.php ├── taxonomy-gift_tag.php ├── sidebar.php ├── inc ├── nonce.php ├── adsense.php ├── recent-user.php ├── settings-discussion.php ├── version.php ├── settings-general.php ├── post-meta.php ├── settings-smtp.php ├── seo.php ├── settings-writing.php ├── settings-credit.php ├── bootstrap_navwalker.php ├── settings-open.php ├── settings-gift.php ├── meta.php ├── cache.php ├── vote.php ├── comment-meta.php ├── settings.php ├── commentlist.php ├── message.php ├── shortcode.php ├── mail.php ├── settings-home.php ├── settings-reading.php ├── credit.php ├── settings-tool.php ├── user-page.php ├── tracker.php └── settings-slide.php ├── searchform.php ├── single.php ├── 404.php ├── search.php ├── content.php ├── js ├── html5shiv-3.7.0.js └── respond-1.4.2.min.js ├── header.php ├── content-archive.php ├── archive.php ├── footer-colophon.php ├── index.php ├── archive-gift.php ├── comments.php ├── header-masthead.php └── single-gift.php /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/screenshot.png -------------------------------------------------------------------------------- /images/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/grey.png -------------------------------------------------------------------------------- /images/qzone.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/qzone.gif -------------------------------------------------------------------------------- /images/sina.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/sina.gif -------------------------------------------------------------------------------- /images/look/lei.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/lei.gif -------------------------------------------------------------------------------- /images/look/tu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/tu.gif -------------------------------------------------------------------------------- /images/look/xu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/xu.gif -------------------------------------------------------------------------------- /images/qq_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/qq_32x32.png -------------------------------------------------------------------------------- /images/look/aini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/aini.gif -------------------------------------------------------------------------------- /images/look/bishi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/bishi.gif -------------------------------------------------------------------------------- /images/look/bizui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/bizui.gif -------------------------------------------------------------------------------- /images/look/haha.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/haha.gif -------------------------------------------------------------------------------- /images/look/hehe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/hehe.gif -------------------------------------------------------------------------------- /images/look/jiyan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/jiyan.gif -------------------------------------------------------------------------------- /images/look/keai.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/keai.gif -------------------------------------------------------------------------------- /images/look/shuai.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/shuai.gif -------------------------------------------------------------------------------- /images/look/weiqu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/weiqu.gif -------------------------------------------------------------------------------- /images/look/xixi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/xixi.gif -------------------------------------------------------------------------------- /images/look/chijing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/chijing.gif -------------------------------------------------------------------------------- /images/look/haixiu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/haixiu.gif -------------------------------------------------------------------------------- /images/look/kelian.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/kelian.gif -------------------------------------------------------------------------------- /images/look/qinqin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/qinqin.gif -------------------------------------------------------------------------------- /images/look/touxiao.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/touxiao.gif -------------------------------------------------------------------------------- /images/look/wabishi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/wabishi.gif -------------------------------------------------------------------------------- /images/screenshot_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/screenshot_64.png -------------------------------------------------------------------------------- /images/weibo_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/weibo_32x32.png -------------------------------------------------------------------------------- /images/look/landelini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/landelini.gif -------------------------------------------------------------------------------- /images/look/shengbing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/shengbing.gif -------------------------------------------------------------------------------- /images/look/taikaixin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/taikaixin.gif -------------------------------------------------------------------------------- /images/wordpress_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/wordpress_32x32.png -------------------------------------------------------------------------------- /images/look/youhengheng.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/youhengheng.gif -------------------------------------------------------------------------------- /images/look/zuohengheng.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/images/look/zuohengheng.gif -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malaohu/dmeng-wordpress-theme/HEAD/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dmeng-wordpress-theme 2 | 多梦主题 3 | 4 | 5 | 按照自己的需求进行了一些修改!! 6 | 7 | 8 | 主要做了对HTTPS的兼容。 9 | 10 | 参考这篇文章: https://github.com/hrwhisper/baiduShare 将百度分享的代码放到你本地。 11 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: DMENG 2.0 3 | Theme URI: http://www.dmeng.net/dmeng-theme-2-0.html 4 | Author: steven.chan.chihyu 5 | Author URI: http://www.dmeng.net/ 6 | Description: a magical theme from dmeng.net 7 | Version: 2.0.7.1 8 | Text Domain: dmeng 9 | */ 10 | -------------------------------------------------------------------------------- /page.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /taxonomy-gift_tag.php: -------------------------------------------------------------------------------- 1 | 17 | 24 | -------------------------------------------------------------------------------- /inc/nonce.php: -------------------------------------------------------------------------------- 1 | 10 | 16 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 |
15 | 21 | 22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /inc/adsense.php: -------------------------------------------------------------------------------- 1 | $local)); 25 | 26 | if($content) return '
'.trim($content).'
'; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /inc/recent-user.php: -------------------------------------------------------------------------------- 1 | ID, 'dmeng_latest_login', current_time( 'mysql' ) ); 19 | } 20 | add_action( 'wp_login', 'dmeng_update_latest_login', 10, 1 ); 21 | 22 | function dmeng_latest_login_column( $columns ) { 23 | $columns['dmeng_latest_login'] = '上次登录'; 24 | return $columns; 25 | } 26 | add_filter( 'manage_users_columns', 'dmeng_latest_login_column' ); 27 | 28 | function dmeng_latest_login_column_callback( $value, $column_name, $user_id ) { 29 | if('dmeng_latest_login' == $column_name){ 30 | $user = get_user_by( 'id', $user_id ); 31 | $value = ( $user->dmeng_latest_login ) ? $user->dmeng_latest_login : $value = __('没有记录','dmeng'); 32 | } 33 | return $value; 34 | } 35 | add_action( 'manage_users_custom_column', 'dmeng_latest_login_column_callback', 10, 3 ); 36 | 37 | function dmeng_get_recent_user($number=10){ 38 | $user_query = new WP_User_Query( array ( 'orderby' => 'meta_value', 'order' => 'DESC', 'meta_key' => 'dmeng_latest_login', 'number' => $number ) ); 39 | if($user_query) return $user_query->results; 40 | return; 41 | } 42 | -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 |
16 |
17 |
18 |
19 |
20 |

21 |
    22 |
  • 23 |
      24 |
    1. 25 |
    2. 26 |
    27 |
  • 28 |
29 | 30 | true, 'posts_per_page' => 5, 'orderby' => 'modified') ); 32 | while ( have_posts() ) : the_post(); 33 | get_template_part('content','archive'); 34 | endwhile; // end of the loop. 35 | wp_reset_query(); 36 | ?> 37 |
38 |
39 |
40 | 41 |
42 |
43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 21 | 22 |
23 |
24 |
25 | 26 |
27 |
28 |

'.$wp_query->found_posts.'' );?> 29 |

30 | 31 | 37 |
38 |
39 | 40 |
41 | 42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /inc/settings-discussion.php: -------------------------------------------------------------------------------- 1 | 31 |
32 |

33 |
34 | 35 | 36 | table( array( 42 | array( 43 | 'type' => 'input', 44 | 'th' => __('“置顶评论”标题文本','dmeng'), 45 | 'key' => 'sticky_comment_title', 46 | 'value' => $title 47 | ), 48 | array( 49 | 'type' => 'input', 50 | 'th' => __('“置顶”按钮文本','dmeng'), 51 | 'key' => 'sticky_comment_button_txt', 52 | 'value' => $button_txt 53 | ) 54 | ) ); 55 | ?> 56 |

57 |
58 |
59 | 12 |
13 | 14 |
15 |
16 |
17 |

', ' '); ?>

18 | 19 |
20 |
21 | 22 | 23 |
24 | 25 |
26 | 27 | 39 |
40 | 41 | 42 | 43 | 44 |
45 | -------------------------------------------------------------------------------- /js/html5shiv-3.7.0.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); 8 | if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;dget( 'Version' ); 40 | $version = json_decode(dmeng_get_url('http://cdn.dmeng.net/version/version.json'),true); 41 | if ( $version["NO"] != $dmengVersion ) $check = 1; 42 | update_option('dmeng_theme_upgrade',$check); 43 | } 44 | } 45 | 46 | //~ 新版本提示 47 | function dmeng_update_alert_callback(){ 48 | $dmeng_upgrade = get_option('dmeng_theme_upgrade',0); 49 | if($dmeng_upgrade){ 50 | echo '

'.__('多梦主题有了更新的版本,请到多梦网络了解详情!','dmeng').'

'; 51 | } 52 | } 53 | add_action( 'admin_notices', 'dmeng_update_alert_callback' ); 54 | 55 | function dmeng_new_friend(){ 56 | global $pagenow; 57 | if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) ){ 58 | 59 | $url = get_bloginfo('url'); 60 | $name = get_bloginfo('name'); 61 | $email = get_bloginfo('admin_email'); 62 | 63 | $theme = wp_get_theme(); 64 | 65 | dmeng_get_url('http://tool.dmeng.net/report.php?',http_build_query(array( 66 | 'url'=>$url, 67 | 'name'=>$name, 68 | 'email'=>$email, 69 | 'version'=>( $theme->get('Version') ) 70 | )),'POST'); 71 | 72 | } 73 | } 74 | add_action( 'load-themes.php', 'dmeng_new_friend' ); 75 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | > 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | <?php wp_title( '-', true, 'right' ); ?> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 41 | 42 | > 43 | -------------------------------------------------------------------------------- /content-archive.php: -------------------------------------------------------------------------------- 1 | 21 |
22 | '.get_the_title().''; 27 | $has_thumbnail_class = ' has_post_thumbnail'; 28 | } 29 | ?> 30 |
31 | 32 |
33 |

34 | '.__('置顶','dmeng').''; ?> 35 |

36 | post_status!='publish' ){ 38 | 39 | $meta_output = ''; 46 | 47 | echo $meta_output; 48 | 49 | }else{ 50 | dmeng_post_meta(); 51 | } 52 | ?> 53 |
54 |
55 |
56 |
57 | -------------------------------------------------------------------------------- /inc/settings-general.php: -------------------------------------------------------------------------------- 1 | 32 |
33 |

34 |
35 | 36 | 37 | table( array( 43 | array( 44 | 'type' => 'input', 45 | 'th' => __('ICP','dmeng'), 46 | 'key' => 'zh_cn_l10n_icp_num', 47 | 'value' => get_option('zh_cn_l10n_icp_num') 48 | ), 49 | array( 50 | 'type' => 'textarea', 51 | 'th' => __('头部HEAD代码','dmeng'), 52 | 'before' => '

'.__('如添加meta信息验证网站所有权','dmeng').'

', 53 | 'key' => 'head_code', 54 | 'value' => stripslashes(htmlspecialchars_decode(get_option('dmeng_head_code'))) 55 | ), 56 | array( 57 | 'type' => 'textarea', 58 | 'th' => __('脚部统计代码','dmeng'), 59 | 'before' => '

'.__('放置CNZZ、百度统计或安全网站认证小图标等','dmeng').'

', 60 | 'key' => 'footer_code', 61 | 'value' => stripslashes(htmlspecialchars_decode(get_option('dmeng_footer_code'))) 62 | ), 63 | array( 64 | 'type' => 'select', 65 | 'th' => __('是否显示浮动按钮','dmeng'), 66 | 'before' => '

'.__('选择是时显示到顶部、刷新、到底部等浮动按钮','dmeng').'

', 67 | 'key' => 'float_button', 68 | 'value' => array( 69 | 'default' => array($float_button), 70 | 'option' => array( 71 | 1 => __( '显示', 'dmeng' ), 72 | 0 => __( '不显示', 'dmeng' ) 73 | ) 74 | ) 75 | ) 76 | ) ); 77 | 78 | ?> 79 |

80 |
81 |
82 | 12 | 13 |
14 |
15 |
16 | 17 |
18 |
19 |

53 | '.$wp_query->found_posts.'' );?> 54 |

55 | %s
', $term_description ); 60 | endif; 61 | ?> 62 | 68 |
69 |
70 | 71 |
72 | 73 |
74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /footer-colophon.php: -------------------------------------------------------------------------------- 1 | 10 | 54 | 'goTop', 60 | 'title' => __('去顶部','dmeng'), 61 | 'html' => '' 62 | ), 63 | array( 64 | 'id' => 'refresh', 65 | 'title' => __('刷新','dmeng'), 66 | 'html' => '' 67 | ) 68 | ); 69 | if ( is_single() || is_page() ) { 70 | $btn_array[] = array( 71 | 'id' => 'goComments', 72 | 'title' => __('评论','dmeng'), 73 | 'html' => '' 74 | ); 75 | } 76 | $btn_array[] = array( 77 | 'id' => 'goBottom', 78 | 'title' => __('去底部','dmeng'), 79 | 'html' => '' 80 | ); 81 | $btn_output = '
'; 82 | foreach( $btn_array as $btn ){ 83 | $btn_output .= sprintf( '', $btn['id'], $btn['title'], $btn['html']); 84 | } 85 | $btn_output .= '
'; 86 | echo $btn_output; 87 | } 88 | ?> 89 | -------------------------------------------------------------------------------- /inc/post-meta.php: -------------------------------------------------------------------------------- 1 | ID, 'dmeng_copyright_status', true ); 51 | 52 | $cc = get_post_meta( $post->ID, 'dmeng_copyright_content', true ); 53 | 54 | $copyright_status = is_numeric($cs) ? (int)$cs : (int)get_option('dmeng_copyright_status_default',1); 55 | 56 | $copyright_content = $cc ? $cc : get_option('dmeng_copyright_content_default',sprintf(__('原文链接:%s,转发请注明来源!','dmeng'),'')); 57 | 58 | ?> 59 | 60 |

61 | 65 |

66 |

67 | 68 | 69 | $_POST['dmeng_smtp_option'], 22 | 'host' => $_POST['dmeng_smtp_host'], 23 | 'ssl' => $_POST['dmeng_smtp_ssl'], 24 | 'port' => $_POST['dmeng_smtp_port'], 25 | 'user' => $_POST['dmeng_smtp_user'], 26 | 'pass' => $_POST['dmeng_smtp_pass'], 27 | 'name' => $_POST['dmeng_smtp_name'], 28 | ))); 29 | 30 | dmeng_settings_error('updated'); 31 | 32 | endif; 33 | 34 | $smtp = json_decode(get_option('dmeng_smtp','{"option":"0","host":"","ssl":"0","port":"25","user":"","pass":"","name":""}')); 35 | $open = intval($smtp->option); 36 | $host = sanitize_text_field($smtp->host); 37 | $ssl = intval($smtp->ssl); 38 | $port = intval($smtp->port); 39 | $user = sanitize_text_field($smtp->user); 40 | $pass = sanitize_text_field($smtp->pass); 41 | $name = empty($smtp->name) ? get_bloginfo('name') : sanitize_text_field($smtp->name); 42 | 43 | ?> 44 |
45 |

46 |
47 | 48 | 49 | table( array( 55 | array( 56 | 'type' => 'select', 57 | 'th' => __('启用SMTP','dmeng'), 58 | 'key' => 'dmeng_smtp_option', 59 | 'value' => array( 60 | 'default' => array(intval($open)), 61 | 'option' => array( 62 | 1 => __( '启用', 'dmeng' ), 63 | 0 => __( '禁用', 'dmeng' ) 64 | ) 65 | ) 66 | ), 67 | array( 68 | 'type' => 'input', 69 | 'th' => __('发信服务器','dmeng'), 70 | 'key' => 'dmeng_smtp_host', 71 | 'value' => $host 72 | ), 73 | array( 74 | 'type' => 'select', 75 | 'th' => __('启用SSL','dmeng'), 76 | 'key' => 'dmeng_smtp_ssl', 77 | 'value' => array( 78 | 'default' => array($ssl), 79 | 'option' => array( 80 | 1 => __( '启用', 'dmeng' ), 81 | 0 => __( '禁用', 'dmeng' ) 82 | ) 83 | ) 84 | ), 85 | array( 86 | 'type' => 'input', 87 | 'th' => __('端口号','dmeng'), 88 | 'key' => 'dmeng_smtp_port', 89 | 'value' => $port 90 | ), 91 | array( 92 | 'type' => 'input', 93 | 'th' => __('发信账号','dmeng'), 94 | 'key' => 'dmeng_smtp_user', 95 | 'value' => $user 96 | ), 97 | array( 98 | 'type' => 'input-password', 99 | 'th' => __('账号密码','dmeng'), 100 | 'key' => 'dmeng_smtp_pass', 101 | 'value' => $pass 102 | ), 103 | array( 104 | 'type' => 'input', 105 | 'th' => __('显示昵称','dmeng'), 106 | 'key' => 'dmeng_smtp_name', 107 | 'value' => $name 108 | ) 109 | ) ); 110 | ?> 111 |

112 |
113 |
114 | cat_name; 30 | } 31 | if($cat) $title .= join('|',$cat)." $sep " ; 32 | } 33 | 34 | 35 | 36 | switch(true){ 37 | 38 | case is_attachment() : 39 | $title .= get_post_mime_type()." $sep " ; 40 | break; 41 | 42 | case is_category() : 43 | $title .= __('分类目录','dmeng')." $sep " ; 44 | break; 45 | 46 | case is_tag() : 47 | $title .= __('标签','dmeng')." $sep " ; 48 | break; 49 | 50 | case is_author() : 51 | $title .= __('作者','dmeng')." $sep " ; 52 | break; 53 | 54 | case is_archive() && !is_post_type_archive('gift') : 55 | $title .= __('归档','dmeng')." $sep " ; 56 | break; 57 | 58 | case is_search() : 59 | $title .= sprintf(__('%s个相关结果','dmeng'), $wp_query->found_posts )." $sep " ; 60 | break; 61 | 62 | case is_singular('gift') : 63 | $title .= __('积分换礼','dmeng')." $sep " ; 64 | break; 65 | } 66 | 67 | // 添加站点标题 68 | $title .= get_bloginfo( 'name', 'display' ); 69 | 70 | // 首页显示站点标题和副标题 71 | $site_description = get_bloginfo( 'description', 'display' ); 72 | if ( $site_description && ( is_home() || is_front_page() ) ) 73 | $title = "$title $sep $site_description"; 74 | 75 | // 添加分页页码 76 | if ( $paged >= 2 || $page >= 2 ) 77 | $title = "$title $sep " . sprintf( __( '第 %s 页', 'dmeng' ), max( $paged, $page ) ); 78 | 79 | return $title; 80 | } 81 | add_filter( 'wp_title', 'dmeng_wp_title', 10, 2 ); 82 | 83 | //~ 关键词和描述 84 | function dmeng_keywords_and_description(){ 85 | 86 | $keywords = array(); 87 | $description = ''; 88 | 89 | if( is_home() || is_front_page() ){ 90 | $home_seo = json_decode(get_option('dmeng_home_seo','{"keywords":"","description":""}')); 91 | $keywords[] = $home_seo->keywords; 92 | $description = $home_seo->description; 93 | } 94 | 95 | if( is_single() || is_page() ){ 96 | 97 | if ( has_tag() ) { 98 | foreach( (get_the_tags()) as $tag ) { 99 | $keywords[] = $tag->name; 100 | } 101 | } 102 | 103 | foreach( (get_the_category() ) as $category ) { 104 | $keywords[] = $category->cat_name; 105 | } 106 | 107 | $description = get_the_excerpt(); 108 | 109 | } 110 | 111 | if( is_category() || is_tag() ){ 112 | 113 | $keywords[] = single_term_title("", false); 114 | $description = strip_tags(term_description()); 115 | 116 | } 117 | 118 | if( is_search() ){ 119 | $keywords[] = get_search_query(); 120 | } 121 | 122 | 123 | echo ''; 124 | 125 | } 126 | add_action('wp_head', 'dmeng_keywords_and_description'); 127 | 128 | //~ 页面链接后添加反斜杠 129 | function dmeng_nice_trailingslashit($string, $type_of_url) { 130 | if ($type_of_url != 'single') 131 | $string = trailingslashit($string); 132 | return $string; 133 | } 134 | add_filter('user_trailingslashit', 'dmeng_nice_trailingslashit', 10, 2); 135 | -------------------------------------------------------------------------------- /inc/settings-writing.php: -------------------------------------------------------------------------------- 1 | {title}')); 33 | $post_index = (int)get_option('dmeng_post_index',1); 34 | 35 | $can_post_cat = json_decode(get_option('dmeng_can_post_cat','[]')); 36 | 37 | $categories = get_categories( array('hide_empty' => 0) ); 38 | foreach ( $categories as $category ) { 39 | $categories_array[$category->term_id] = $category->name; 40 | } 41 | 42 | $option = new DmengOptionsOutput(); 43 | 44 | ?> 45 |
46 |

47 |
48 | 49 | 50 | table( array( 55 | array( 56 | 'type' => 'select', 57 | 'th' => __('(默认)版权声明开关','dmeng'), 58 | 'before' => '

'.__('在文章/页面内容下的版权声明','dmeng').'

', 59 | 'key' => 'copyright_status_default', 60 | 'value' => array( 61 | 'default' => array($copyright_status), 62 | 'option' => array( 63 | 1 => __( '显示', 'dmeng' ), 64 | 0 => __( '不显示', 'dmeng' ) 65 | ) 66 | ) 67 | ), 68 | array( 69 | 'type' => 'textarea', 70 | 'th' => __('(默认)版权声明内容','dmeng'), 71 | 'before' => '

'.__('版权声明内容,文章链接用{link}表示,文章标题用{title}表示,站点地址用{url}表示,站点名称用{name}表示','dmeng').'

', 72 | 'key' => 'copyright_content_default', 73 | 'value' => stripcslashes(htmlspecialchars_decode($copyright_content)) 74 | ), 75 | array( 76 | 'type' => 'select', 77 | 'th' => __('(默认)锚点导航开关','dmeng'), 78 | 'before' => '

'.__('选择是时将把文章页和页面内容中的H标题生成锚点导航目录','dmeng').'

', 79 | 'key' => 'post_index', 80 | 'value' => array( 81 | 'default' => array($post_index), 82 | 'option' => array( 83 | 1 => __( '显示', 'dmeng' ), 84 | 0 => __( '不显示', 'dmeng' ) 85 | ) 86 | ) 87 | ) 88 | ) ); 89 | ?> 90 |

91 | table( array( 94 | array( 95 | 'type' => 'checkbox', 96 | 'th' => __('允许投稿的分类','dmeng'), 97 | 'before' => '

'.__('不选择任何分类则不开放投稿','dmeng').'

', 98 | 'key' => 'can_post_cat', 99 | 'value' => array( 100 | 'default' => $can_post_cat, 101 | 'option' => $categories_array 102 | ) 103 | ) 104 | ) ); 105 | 106 | ?> 107 |

108 |
109 |
110 | 54 |
55 |

56 |
57 | 58 | 59 | 60 |

61 | table( array( 63 | array( 64 | 'type' => 'input', 65 | 'th' => __('新用户注册奖励','dmeng'), 66 | 'key' => 'dmeng_reg_credit', 67 | 'value' => get_option('dmeng_reg_credit','50') 68 | ), 69 | array( 70 | 'type' => 'input', 71 | 'th' => __('投稿一次得分','dmeng'), 72 | 'key' => 'dmeng_rec_post_credit', 73 | 'value' => get_option('dmeng_rec_post_credit','50') 74 | ), 75 | array( 76 | 'type' => 'input', 77 | 'th' => __('每天投稿次数','dmeng'), 78 | 'key' => 'dmeng_rec_post_num', 79 | 'value' => get_option('dmeng_rec_post_num','5') 80 | ), 81 | array( 82 | 'type' => 'input', 83 | 'th' => __('评论一次得分','dmeng'), 84 | 'key' => 'dmeng_rec_comment_credit', 85 | 'value' => get_option('dmeng_rec_comment_credit','5') 86 | ), 87 | array( 88 | 'type' => 'input', 89 | 'th' => __('每天评论次数','dmeng'), 90 | 'key' => 'dmeng_rec_comment_num', 91 | 'value' => get_option('dmeng_rec_comment_num','50') 92 | ) 93 | ) ); 94 | ?> 95 |

96 | table( array( 98 | array( 99 | 'type' => 'input', 100 | 'th' => __('注册推广一次得分','dmeng'), 101 | 'key' => 'dmeng_rec_reg_credit', 102 | 'value' => get_option('dmeng_rec_reg_credit','50') 103 | ), 104 | array( 105 | 'type' => 'input', 106 | 'th' => __('每天注册推广次数','dmeng'), 107 | 'key' => 'dmeng_rec_reg_num', 108 | 'value' => get_option('dmeng_rec_reg_num','5') 109 | ), 110 | array( 111 | 'type' => 'input', 112 | 'th' => __('访问推广一次得分','dmeng'), 113 | 'key' => 'dmeng_rec_view_credit', 114 | 'value' => get_option('dmeng_rec_view_credit','5') 115 | ), 116 | array( 117 | 'type' => 'input', 118 | 'th' => __('每天访问推广次数','dmeng'), 119 | 'key' => 'dmeng_rec_view_num', 120 | 'value' => get_option('dmeng_rec_view_num','50') 121 | ) 122 | ) ); 123 | ?> 124 |

125 |
126 |
127 | 'menu_item_parent', 'id' => 'db_id' ); 26 | 27 | function start_lvl( &$output, $depth = 0, $args = array() ) { 28 | if( $depth == 0 ){ 29 | $output .= '"; 37 | } 38 | 39 | function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { 40 | 41 | $caret = $glyphicon_icon = $item_output = ''; 42 | 43 | if( $depth > 0 && $item->description ) $item_output .= '
  • '; 44 | 45 | $atts = $atts_class = array(); 46 | $atts['target'] = ! empty( $item->target ) ? $item->target : ''; 47 | $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; 48 | $atts['href'] = ! empty( $item->url ) ? $item->url : ''; 49 | 50 | //~ 判断标题属性是否以 glyphicon 开头,是的话就当做 glyphicon 图标输出,添加在链接文本前 51 | //~ @author 多梦 at 2014.06.20 52 | if ( ! empty( $item->attr_title ) ) { 53 | if ( strpos( esc_attr( $item->attr_title ) , 'glyphicon' ) !== false && strpos( esc_attr( $item->attr_title ) , 'glyphicon' ) == 0 ){ 54 | $glyphicon_icon = ' '; 55 | }else{ 56 | $atts['title'] = $item->attr_title; 57 | } 58 | } 59 | 60 | $class_names = (array) get_post_meta( $item->ID, '_menu_item_classes', true ); 61 | 62 | if ( $depth == 0 && ($args->depth)>=0 && in_array( 'menu-item-has-children', $item->classes ) ){ 63 | $class_names[] = 'dropdown'; 64 | $atts_class[] = 'dropdown-toggle'; 65 | $atts['data-toggle'] = 'dropdown'; 66 | $caret = ' '; 67 | } 68 | 69 | if( empty( $item->url ) && empty($atts['data-toggle']) ) $atts_class[] = 'navbar-text'; 70 | 71 | if( $item->current || $item->current_item_ancestor || $item->current_item_parent ){ 72 | $class_names[] = 'active'; 73 | } 74 | 75 | $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $class_names ), $item, $args ) ); 76 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; 77 | 78 | $item_output .= ''; 79 | 80 | $atts['class'] = join('', $atts_class); 81 | 82 | $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); 83 | 84 | $attributes = ''; 85 | foreach ( $atts as $attr => $value ) { 86 | if ( ! empty( $value ) ) { 87 | $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); 88 | $attributes .= ' ' . $attr . '="' . $value . '"'; 89 | } 90 | } 91 | 92 | $item_output .= $args->before; 93 | $item_output .= ( $item->url || !empty($atts['data-toggle']) ) ? '