├── 404.php ├── README.md ├── archive.php ├── author.php ├── comments.php ├── footer.php ├── functions.php ├── header.php ├── images ├── 404.jpg ├── add@32x32.png ├── avatar.jpg ├── cd-arrow.svg ├── f-logo.png ├── favicon.ico ├── gotop.png ├── grid.png ├── hd.jpg ├── login.png ├── login_loading.gif ├── logo.png ├── none.png ├── pause@32x32.png ├── play@32x32.png ├── postload.gif ├── random │ ├── d-1.jpg │ ├── d-10.jpg │ ├── d-2.jpg │ ├── d-3.jpg │ ├── d-4.jpg │ ├── d-5.jpg │ ├── d-6.jpg │ ├── d-7.jpg │ ├── d-8.jpg │ └── d-9.jpg ├── sns │ ├── bilibili.png │ ├── csdn.png │ ├── douban.png │ ├── facebook.png │ ├── github.png │ ├── googleplus.png │ ├── heart.png │ ├── jianshu.png │ ├── lofter.png │ ├── qq.png │ ├── qzone.png │ ├── sina.png │ ├── twitter.png │ ├── wangyiyun.png │ ├── wechat.png │ ├── youku.png │ └── zhihu.png ├── temp.jpg └── ua │ ├── 360se.png │ ├── android.png │ ├── chrome.png │ ├── chromium.png │ ├── crios.png │ ├── debian.png │ ├── edge.png │ ├── fedora.png │ ├── firefox.png │ ├── ie.png │ ├── ie10.png │ ├── ie11.png │ ├── ie8.png │ ├── ie9.png │ ├── ipad.png │ ├── iphone.png │ ├── linux.png │ ├── macos.png │ ├── maxthon.png │ ├── opera.png │ ├── opera15.png │ ├── safari.png │ ├── sogou.png │ ├── ubuntu.png │ ├── ucweb.png │ ├── unknow.png │ ├── windows.png │ ├── windows_phone.png │ ├── windows_vista.png │ ├── windows_win10.png │ ├── windows_win7.png │ ├── windows_win8.png │ └── wordpress.png ├── inc ├── categories-images.php ├── css │ ├── admin.css │ ├── color-picker.min.css │ └── optionsframework.css ├── customizer.php ├── decorate.php ├── fonts │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ └── iconfont.woff ├── images │ └── ico-delete.png ├── js │ ├── color-picker.min.js │ ├── iris.min.js │ ├── media-uploader.js │ └── options-custom.js ├── login.css ├── options-framework.php ├── options-interface.php ├── options-media-uploader.php ├── options-sanitize.php ├── siren-update.php └── template-tags.php ├── index.php ├── js ├── app.js ├── customizer.js ├── input.min.js ├── jquery.min.js ├── jquery.pjax.js └── login.js ├── layouts ├── authorprofile.php ├── duoshuo.php ├── feature.php ├── imgbox.php ├── post-nextprev.php └── sharelike.php ├── options.php ├── page-archive.php ├── page-links.php ├── page.php ├── screenshot.png ├── search.php ├── sidebar.php ├── single.php ├── style.css ├── tpl ├── content-category.php ├── content-image.php ├── content-none.php ├── content-page.php ├── content-search.php ├── content-single.php ├── content-status.php ├── content-thumb.php ├── content.php └── single-image.php └── user ├── page-login.php ├── page-register.php └── verification.js /404.php: -------------------------------------------------------------------------------- 1 | 11 | > 12 | 13 | 14 | 15 | <?php global $page, $paged;wp_title( '-', true, 'right' ); 16 | bloginfo( 'name' );$site_description = get_bloginfo( 'description', 'display' ); 17 | if ( $site_description && ( is_home() || is_front_page() ) ) echo " - $site_description";if ( $paged >= 2 || $page >= 2 ) echo ' - ' . sprintf( __( '第 %s 页'), max( $paged, $page ) );?> 18 | 19 | 20 | 21 | > 22 |
23 |
24 | 25 |
26 |
27 | 返回上一页 28 | 返回主页 29 |
30 |
31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Siren 2 | WordPress Theme 3 | 4 | ## 事项 5 | 不再更新维护,新版WordPress兼容性未知。 6 | -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 | 15 | 17 | 18 | 19 | 29 | 30 | 31 | 45 |
46 | 47 | 52 | 53 |
54 | 55 | 56 | 57 | 60 | 61 |
62 | 63 | 6 |
7 |
8 | <?php the_author(); ?> 9 |
10 |
11 |

12 |
13 |
14 |
15 | 52 |
53 |
54 | 55 | 67 |
68 | 73 | 74 |
75 | 76 | 77 | 78 | 81 | 82 |
83 | 84 | 15 | 16 | 17 | 18 |
19 | 20 |
21 |
- 22 | 23 |
24 |
25 | 26 |
27 |

Comments |

28 |
29 | 30 | 31 | 34 | 35 | 38 | 39 | 40 | 41 | 42 |
43 |
44 | 45 |
46 | 47 | 48 | 49 | 50 | 滴!网络好卡'; 54 | $private_ms = akina_option('open_private_message') ? '' : ''; 55 | $args = array( 56 | 'id_form' => 'commentform', 57 | 'id_submit' => 'submit', 58 | 'title_reply' => '', 59 | 'title_reply_to' => '
' . esc_html__('Leave a Reply to', 'akina') . ' %s' . '
', 60 | 'cancel_reply_link' => esc_html__('Cancel Reply', 'akina'), 61 | 'label_submit' => esc_html__('Post Comment', 'akina'), 62 | 'comment_field' => '', 63 | 'comment_notes_after' => '', 64 | 'comment_notes_before' => '', 65 | 'fields' => apply_filters( 'comment_form_default_fields', array( 66 | 'author' => 67 | '', 68 | 'email' => 69 | '', 70 | 'url' => 71 | '' . $robot_comments . $private_ms 72 | ) 73 | ) 74 | ); 75 | comment_form($args); 76 | } 77 | 78 | ?> 79 | 80 |
81 | 82 | 83 |
84 | 85 | 86 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 21 | 22 | 37 |
38 |
39 |
40 |
41 |
42 | 43 |
44 | 45 |

46 | 47 |
48 |
49 | 50 | 51 |
52 |
53 | 54 | 55 |
56 | 61 | 2, 'theme_location' => 'primary', 'container' => false ) ); ?> 62 |
63 | 64 | 65 | 75 | 76 | 77 | 78 |
79 | 80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | section and everything up until
6 | * 7 | * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials 8 | * 9 | * @package Akina 10 | */ 11 | ?> 12 | 13 | > 14 | 15 | 16 | 17 | <?php global $page, $paged;wp_title( '-', true, 'right' ); 18 | bloginfo( 'name' );$site_description = get_bloginfo( 'description', 'display' ); 19 | if ( $site_description && ( is_home() || is_front_page() ) ) echo " - $site_description";if ( $paged >= 2 || $page >= 2 ) echo ' - ' . sprintf( __( '第 %s 页'), max( $paged, $page ) );?> 20 | 21 | name . ','; 32 | }; 33 | }; 34 | if ($categories) { 35 | foreach($categories as $category) { 36 | $keywords .= $category->name . ','; 37 | }; 38 | }; 39 | $description = mb_strimwidth( str_replace("\r\n", '', strip_tags($post->post_content)), 0, 240, '…'); 40 | } else { 41 | $keywords = akina_option('akina_meta_keywords'); 42 | $description = akina_option('akina_meta_description'); 43 | }; 44 | ?> 45 | 46 | 47 | 48 | 49 | 50 | 55 | 56 | > 57 |
58 | 62 |
63 | 64 |
65 | 66 |
67 | 89 | 90 |
-------------------------------------------------------------------------------- /images/404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/404.jpg -------------------------------------------------------------------------------- /images/add@32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/add@32x32.png -------------------------------------------------------------------------------- /images/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/avatar.jpg -------------------------------------------------------------------------------- /images/cd-arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | Imported Layers 8 | Created with Sketch. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /images/f-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/f-logo.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/favicon.ico -------------------------------------------------------------------------------- /images/gotop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/gotop.png -------------------------------------------------------------------------------- /images/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/grid.png -------------------------------------------------------------------------------- /images/hd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/hd.jpg -------------------------------------------------------------------------------- /images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/login.png -------------------------------------------------------------------------------- /images/login_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/login_loading.gif -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/logo.png -------------------------------------------------------------------------------- /images/none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/none.png -------------------------------------------------------------------------------- /images/pause@32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/pause@32x32.png -------------------------------------------------------------------------------- /images/play@32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/play@32x32.png -------------------------------------------------------------------------------- /images/postload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/postload.gif -------------------------------------------------------------------------------- /images/random/d-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-1.jpg -------------------------------------------------------------------------------- /images/random/d-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-10.jpg -------------------------------------------------------------------------------- /images/random/d-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-2.jpg -------------------------------------------------------------------------------- /images/random/d-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-3.jpg -------------------------------------------------------------------------------- /images/random/d-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-4.jpg -------------------------------------------------------------------------------- /images/random/d-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-5.jpg -------------------------------------------------------------------------------- /images/random/d-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-6.jpg -------------------------------------------------------------------------------- /images/random/d-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-7.jpg -------------------------------------------------------------------------------- /images/random/d-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-8.jpg -------------------------------------------------------------------------------- /images/random/d-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/random/d-9.jpg -------------------------------------------------------------------------------- /images/sns/bilibili.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/bilibili.png -------------------------------------------------------------------------------- /images/sns/csdn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/csdn.png -------------------------------------------------------------------------------- /images/sns/douban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/douban.png -------------------------------------------------------------------------------- /images/sns/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/facebook.png -------------------------------------------------------------------------------- /images/sns/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/github.png -------------------------------------------------------------------------------- /images/sns/googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/googleplus.png -------------------------------------------------------------------------------- /images/sns/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/heart.png -------------------------------------------------------------------------------- /images/sns/jianshu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/jianshu.png -------------------------------------------------------------------------------- /images/sns/lofter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/lofter.png -------------------------------------------------------------------------------- /images/sns/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/qq.png -------------------------------------------------------------------------------- /images/sns/qzone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/qzone.png -------------------------------------------------------------------------------- /images/sns/sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/sina.png -------------------------------------------------------------------------------- /images/sns/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/twitter.png -------------------------------------------------------------------------------- /images/sns/wangyiyun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/wangyiyun.png -------------------------------------------------------------------------------- /images/sns/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/wechat.png -------------------------------------------------------------------------------- /images/sns/youku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/youku.png -------------------------------------------------------------------------------- /images/sns/zhihu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/sns/zhihu.png -------------------------------------------------------------------------------- /images/temp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/temp.jpg -------------------------------------------------------------------------------- /images/ua/360se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/360se.png -------------------------------------------------------------------------------- /images/ua/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/android.png -------------------------------------------------------------------------------- /images/ua/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/chrome.png -------------------------------------------------------------------------------- /images/ua/chromium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/chromium.png -------------------------------------------------------------------------------- /images/ua/crios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/crios.png -------------------------------------------------------------------------------- /images/ua/debian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/debian.png -------------------------------------------------------------------------------- /images/ua/edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/edge.png -------------------------------------------------------------------------------- /images/ua/fedora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/fedora.png -------------------------------------------------------------------------------- /images/ua/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/firefox.png -------------------------------------------------------------------------------- /images/ua/ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ie.png -------------------------------------------------------------------------------- /images/ua/ie10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ie10.png -------------------------------------------------------------------------------- /images/ua/ie11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ie11.png -------------------------------------------------------------------------------- /images/ua/ie8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ie8.png -------------------------------------------------------------------------------- /images/ua/ie9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ie9.png -------------------------------------------------------------------------------- /images/ua/ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ipad.png -------------------------------------------------------------------------------- /images/ua/iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/iphone.png -------------------------------------------------------------------------------- /images/ua/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/linux.png -------------------------------------------------------------------------------- /images/ua/macos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/macos.png -------------------------------------------------------------------------------- /images/ua/maxthon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/maxthon.png -------------------------------------------------------------------------------- /images/ua/opera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/opera.png -------------------------------------------------------------------------------- /images/ua/opera15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/opera15.png -------------------------------------------------------------------------------- /images/ua/safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/safari.png -------------------------------------------------------------------------------- /images/ua/sogou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/sogou.png -------------------------------------------------------------------------------- /images/ua/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ubuntu.png -------------------------------------------------------------------------------- /images/ua/ucweb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/ucweb.png -------------------------------------------------------------------------------- /images/ua/unknow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/unknow.png -------------------------------------------------------------------------------- /images/ua/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows.png -------------------------------------------------------------------------------- /images/ua/windows_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows_phone.png -------------------------------------------------------------------------------- /images/ua/windows_vista.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows_vista.png -------------------------------------------------------------------------------- /images/ua/windows_win10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows_win10.png -------------------------------------------------------------------------------- /images/ua/windows_win7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows_win7.png -------------------------------------------------------------------------------- /images/ua/windows_win8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/windows_win8.png -------------------------------------------------------------------------------- /images/ua/wordpress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louie-senpai/Siren/51f5ca59bc61138632dc9f2bb26e18ebb34f5f82/images/ua/wordpress.png -------------------------------------------------------------------------------- /inc/categories-images.php: -------------------------------------------------------------------------------- 1 | 27 | th.column-thumb {width:60px;} 28 | .form-field img.taxonomy-image {border:1px solid #eee;max-width:300px;max-height:300px;} 29 | .inline-edit-row fieldset .thumb label span.title {width:48px;height:48px;border:1px solid #eee;display:inline-block;} 30 | .column-thumb span {width:48px;height:48px;border:1px solid #eee;display:inline-block;} 31 | .inline-edit-row fieldset .thumb img,.column-thumb img {width:48px;height:48px;} 32 | '; 33 | } 34 | 35 | // 添加在添加窗体中的图像字段 36 | function z_add_texonomy_field() { 37 | if (get_bloginfo('version') >= 3.5) // worpdress 最低版本3.5 38 | wp_enqueue_media(); 39 | else { 40 | wp_enqueue_style('thickbox'); 41 | wp_enqueue_script('thickbox'); 42 | } 43 | 44 | echo '
45 | 46 | 47 |
48 | 49 |
'.z_script(); 50 | } 51 | 52 | // 在编辑窗体中添加图像字段 53 | function z_edit_texonomy_field($taxonomy) { 54 | if (get_bloginfo('version') >= 3.5) 55 | wp_enqueue_media(); 56 | else { 57 | wp_enqueue_style('thickbox'); 58 | wp_enqueue_script('thickbox'); 59 | } 60 | 61 | if (z_taxonomy_image_url( $taxonomy->term_id, NULL, TRUE ) == Z_IMAGE_PLACEHOLDER) 62 | $image_url = ""; 63 | else 64 | $image_url = z_taxonomy_image_url( $taxonomy->term_id, NULL, TRUE ); 65 | echo ' 66 | 67 |

68 | 69 | 70 | 71 | '.z_script(); 72 | } 73 | 74 | // 上传图像 75 | function z_script() { 76 | return ''; 143 | } 144 | 145 | // 添加到钩子 146 | add_action('edit_term','z_save_taxonomy_image'); 147 | add_action('create_term','z_save_taxonomy_image'); 148 | function z_save_taxonomy_image($term_id) { 149 | if(isset($_POST['taxonomy_image'])) 150 | update_option('z_taxonomy_image'.$term_id, $_POST['taxonomy_image'], NULL); 151 | } 152 | 153 | // 附件地址 154 | function z_get_attachment_id_by_url($image_src) { 155 | global $wpdb; 156 | $query = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid = %s", $image_src); 157 | $id = $wpdb->get_var($query); 158 | return (!empty($id)) ? $id : NULL; 159 | } 160 | 161 | // 我不知道 162 | function z_taxonomy_image_url($term_id = NULL, $size = 'full', $return_placeholder = FALSE) { 163 | if (!$term_id) { 164 | if (is_category()) 165 | $term_id = get_query_var('cat'); 166 | elseif (is_tag()) 167 | $term_id = get_query_var('tag_id'); 168 | elseif (is_tax()) { 169 | $current_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); 170 | $term_id = $current_term->term_id; 171 | } 172 | } 173 | 174 | $taxonomy_image_url = get_option('z_taxonomy_image'.$term_id); 175 | if(!empty($taxonomy_image_url)) { 176 | $attachment_id = z_get_attachment_id_by_url($taxonomy_image_url); 177 | if(!empty($attachment_id)) { 178 | $taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size); 179 | $taxonomy_image_url = $taxonomy_image_url[0]; 180 | } 181 | } 182 | 183 | if ($return_placeholder) 184 | return ($taxonomy_image_url != '') ? $taxonomy_image_url : Z_IMAGE_PLACEHOLDER; 185 | else 186 | return $taxonomy_image_url; 187 | } 188 | 189 | function z_quick_edit_custom_box($column_name, $screen, $name) { 190 | if ($column_name == 'thumb') 191 | echo '
192 |
193 | 201 |
202 |
'; 203 | } 204 | 205 | /** 206 | * 添加类别管理 207 | */ 208 | function z_taxonomy_columns( $columns ) { 209 | $new_columns = array(); 210 | $new_columns['cb'] = $columns['cb']; 211 | $new_columns['thumb'] = __('图像', 'categories-images'); 212 | 213 | unset( $columns['cb'] ); 214 | 215 | return array_merge( $new_columns, $columns ); 216 | } 217 | 218 | /** 219 | * 图像列表 220 | */ 221 | function z_taxonomy_column( $columns, $column, $id ) { 222 | if ( $column == 'thumb' ) 223 | $columns = '' . __('暂无', 'categories-images') . ''; 224 | 225 | return $columns; 226 | } 227 | 228 | // 将“插入帖子”更改为“使用此图片” 229 | function z_change_insert_button_text($safe_text, $text) { 230 | return str_replace("Insert into Post", "Use this image", $text); 231 | } 232 | 233 | // 列表图片样式 234 | if ( strpos( $_SERVER['SCRIPT_NAME'], 'edit-tags.php' ) > 0 ) { 235 | add_action('quick_edit_custom_box', 'z_quick_edit_custom_box', 10, 3); 236 | add_filter("attribute_escape", "z_change_insert_button_text", 10, 2); 237 | } 238 | -------------------------------------------------------------------------------- /inc/css/admin.css: -------------------------------------------------------------------------------- 1 | .theme-about { 2 | background: #fff; 3 | max-width:860px; 4 | margin: 0 auto; 5 | box-shadow: 0 2px 6px rgba(0,0,0,.04); 6 | border: 1px solid #ddd; 7 | margin-top:50px 8 | } 9 | .fu-info { 10 | padding:20px 40px 11 | } 12 | .fu-info p { 13 | line-height: 30px; 14 | font-size: 15px; 15 | color: #797979; 16 | letter-spacing: 2px; 17 | } 18 | 19 | .fu-she { 20 | text-align: center; 21 | margin-bottom: 30px; 22 | display: inline-block; 23 | width: 100%; 24 | padding:20px 0 25 | } 26 | .fu-she span { 27 | margin-right:15px 28 | } 29 | .akina img { 30 | width: 50px; 31 | } 32 | .fufooter-info { 33 | height: 70px; 34 | background: #384152; 35 | margin-top:20px 36 | } 37 | span.copyright-fu { 38 | width: 100%; 39 | display: inline-block; 40 | padding: 25px 0; 41 | text-align: center; 42 | color: white; 43 | } 44 | .fufooter-info a{ 45 | color:#fff 46 | } -------------------------------------------------------------------------------- /inc/css/color-picker.min.css: -------------------------------------------------------------------------------- 1 | .wp-color-picker{width:80px}.wp-picker-container .hidden{display:none}.wp-color-result{background-color:#f9f9f9;border:1px solid #bbb;border-radius:2px;cursor:pointer;display:inline-block;height:22px;margin:0 6px 6px 0;position:relative;top:1px;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;vertical-align:bottom;display:inline-block;padding-left:30px}.wp-color-result:after{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);color:#333;text-shadow:0 1px 0 #fff;border-radius:0 1px 1px 0;border-left:1px solid #bbb;content:attr(title);display:block;font-size:11px;line-height:22px;padding:0 6px;position:relative;right:0;text-align:center;top:0}.wp-color-result:hover{border-color:#aaa;box-shadow:0 1px 1px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.1);-ms-box-shadow:0 1px 1px rgba(0,0,0,0.1);-o-box-shadow:0 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.1)}.wp-color-result:hover:after{color:#222;border-color:#aaa;border-left:1px solid #999}.wp-color-result.wp-picker-open{top:0}.wp-color-result.wp-picker-open:after{content:attr(data-current)}.wp-picker-container,.wp-picker-container:active{display:inline-block;outline:0}.wp-color-result:focus{border-color:#888;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.2);-ms-box-shadow:0 1px 2px rgba(0,0,0,0.2);-o-box-shadow:0 1px 2px rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)}.wp-color-result:focus:after{border-color:#888}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-container .button{margin-left:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-color:#dfdfdf;margin-top:6px}input[type="text"].iris-error{background-color:#ffebe8;border-color:#c00;color:#000} -------------------------------------------------------------------------------- /inc/css/optionsframework.css: -------------------------------------------------------------------------------- 1 | /* Options Framework Admin Styles */ 2 | 3 | body { 4 | font-family:miranafont,"Hiragino Sans GB",STXihei,"Microsoft YaHei",SimSun,sans-serif; 5 | background:#F5F5F5 ; 6 | height: auto; 7 | } 8 | 9 | .nav-tab-wrapper { 10 | position: relative; 11 | max-width: 860px; 12 | margin: auto !important; 13 | } 14 | 15 | .wrap h2.nav-tab-wrapper { 16 | border-bottom:none 17 | } 18 | 19 | .metabox-holder { 20 | padding-top:0 !important 21 | } 22 | 23 | .nav-tab-active { 24 | border-bottom: none; 25 | background: #fff; 26 | color: #000; 27 | border:none; 28 | font-weight: 300; 29 | font-size: 18px; 30 | color: #4B6894; 31 | } 32 | 33 | .nav-tab-active:hover { 34 | background: #fff; 35 | } 36 | 37 | .nav-tab { 38 | background: none; 39 | border:none; 40 | padding: 10px 20px; 41 | font-weight: 300; 42 | font-size: 15px; 43 | color: darkgoldenrod; 44 | border-radius: 3px 3px 0 0; 45 | } 46 | 47 | .nav-tab-active { 48 | background:#fff 49 | } 50 | 51 | a#options-group-1-tab:before { 52 | font-family: "dashicons"; 53 | content: "\f111"; 54 | float: left; 55 | } 56 | 57 | a#options-group-2-tab:before { 58 | font-family: "dashicons"; 59 | content: "\f102"; 60 | float: left; 61 | } 62 | 63 | a#options-group-3-tab:before { 64 | font-family: "dashicons"; 65 | content: "\f123"; 66 | float: left; 67 | } 68 | 69 | a#options-group-4-tab:before { 70 | font-family: "dashicons"; 71 | content: "\f487"; 72 | float: left; 73 | } 74 | 75 | a#options-group-5-tab:before { 76 | font-family: "dashicons"; 77 | content: "\f227"; 78 | float: left; 79 | } 80 | 81 | a#options-group-6-tab:before { 82 | font-family: "dashicons"; 83 | content: "\f105"; 84 | float: left; 85 | } 86 | 87 | a#options-group-7-tab:before { /*前台登陆*/ 88 | font-family: "dashicons"; 89 | content: "\f110"; 90 | float: left; 91 | } 92 | 93 | 94 | input[type=checkbox], input[type=radio] { 95 | border: 1px solid #b4b9be; 96 | background: #fff; 97 | color: #555; 98 | clear: none; 99 | cursor: pointer; 100 | display: inline-block; 101 | line-height: 0; 102 | height: 16px; 103 | margin: -4px 4px 0 0; 104 | outline: none; 105 | padding: 0!important; 106 | text-align: center; 107 | vertical-align: middle; 108 | width: 16px; 109 | min-width: 16px; 110 | box-shadow: none 111 | } 112 | 113 | input[type="button"]{ 114 | box-shadow: none !important; 115 | border: none !important; 116 | background:#FF5858 !important; 117 | color:#fff !important 118 | } 119 | 120 | input[type=text], 121 | input[type=password], 122 | input[type=checkbox], 123 | input[type=color], 124 | input[type=date], 125 | input[type=datetime], 126 | input[type=datetime-local], 127 | input[type=email], 128 | input[type=month], 129 | input[type=number], 130 | input[type=radio], 131 | input[type=tel], 132 | input[type=time], 133 | input[type=url], 134 | input[type=week], 135 | input[type=search], 136 | select, textarea{ 137 | box-shadow:none 138 | } 139 | input[type="submit" i], input[type="reset" i]{ 140 | 141 | } 142 | 143 | #optionsframework h4 { 144 | font-weight:300; 145 | font-size: 15px 146 | } 147 | #optionsframework { 148 | position:relative; 149 | z-index: 0; 150 | max-width:860px; 151 | background:#FBFBFB; 152 | padding: 30px; 153 | margin: auto; 154 | box-shadow: none; 155 | border: none; 156 | border: 1px solid #fff; 157 | border-radius: 3px; 158 | } 159 | #optionsframework h3 { 160 | cursor: default; 161 | cursor: default; 162 | font-size: 20px; 163 | font-weight: 600; 164 | color: #3F607D; 165 | display: none; 166 | } 167 | #optionsframework p { 168 | margin-bottom:0; 169 | padding-bottom:10px; 170 | line-height: 1.4em; 171 | } 172 | #optionsframework .section { 173 | padding: 10px; 174 | margin-bottom: 20px; 175 | padding-bottom: 30px; 176 | border-bottom: 1px solid #E8E8E8; 177 | } 178 | #optionsframework .group { 179 | padding-bottom:40px; 180 | } 181 | #optionsframework .section .heading { 182 | padding:10px 0px; 183 | margin:0 0 15px; 184 | font-weight: 600; 185 | color: #455E8C; 186 | } 187 | #optionsframework .section .controls { 188 | float: left; 189 | min-width:350px; 190 | width: 54%; 191 | padding-right:2%; 192 | } 193 | #optionsframework .section .explain { 194 | max-width:38%; 195 | float: left; 196 | font-size: 12px; 197 | line-height:20px; 198 | color: #777; 199 | } 200 | #optionsframework .section-checkbox .controls { 201 | width: 98%; 202 | } 203 | #optionsframework .section-checkbox .explain { 204 | max-width:94%; 205 | } 206 | #optionsframework .of-input { 207 | width:100%; 208 | } 209 | #optionsframework .controls select, #optionsframework .controls textarea { 210 | margin-bottom:10px; 211 | width:100%; 212 | } 213 | #optionsframework .section-radio label, #optionsframework .section-multicheck label { 214 | float:left; 215 | max-width:90%; 216 | line-height: 16px; 217 | margin-bottom: 5px; 218 | } 219 | #optionsframework input.checkbox, #optionsframework input.of-radio { 220 | width: 15px; 221 | margin-top:2px; 222 | float:left; 223 | clear:both; 224 | border-radius: 50%; 225 | } 226 | #optionsframework .section-typography .controls { 227 | float:none; 228 | width:auto; 229 | } 230 | #optionsframework .section-typography .explain { 231 | float:none; 232 | width:auto; 233 | } 234 | #optionsframework .controls .of-typography-size { 235 | width:80px; 236 | float:left 237 | } 238 | #optionsframework .controls .of-typography-unit { 239 | width:50px; 240 | margin-left:5px; 241 | float:left 242 | } 243 | #optionsframework .controls .of-typography-face { 244 | width:100px; 245 | margin-left:5px; 246 | float:left 247 | } 248 | #optionsframework .controls .of-typography-style { 249 | width:80px; 250 | margin-left:5px; 251 | margin-right:5px; 252 | float:left 253 | } 254 | #optionsframework .of-background-properties { 255 | clear:both; 256 | margin-top: 18px; 257 | } 258 | #optionsframework .controls .of-background-repeat { 259 | width:125px; 260 | margin-right:5px; 261 | float:left 262 | } 263 | #optionsframework .controls .of-background-position { 264 | width:125px; 265 | margin-right:5px; 266 | float:left 267 | } 268 | #optionsframework .controls .of-background-attachment { 269 | width:125px; 270 | margin-right:5px; 271 | float:left 272 | } 273 | #optionsframework .section-background .wp-picker-container { 274 | margin-bottom:10px; 275 | } 276 | #optionsframework .controls .of-radio-img-img { 277 | border:3px solid #f9f9f9; 278 | margin:0 5px 10px 0; 279 | display:none; 280 | cursor:pointer; 281 | float:left; 282 | } 283 | #optionsframework .controls .of-radio-img-selected { 284 | border:3px solid #ccc 285 | } 286 | #optionsframework .controls .of-radio-img-img:hover { 287 | opacity:.8; 288 | } 289 | #optionsframework .controls .of-border-width { 290 | width:80px; 291 | float:left 292 | } 293 | #optionsframework .controls .of-border-style { 294 | width:120px; 295 | float:left 296 | } 297 | #optionsframework .hide { 298 | display:none; 299 | } 300 | #optionsframework .of-option-image { 301 | max-width:340px; 302 | margin:3px 0 18px 0; 303 | } 304 | #optionsframework .mini .controls select, #optionsframework .section .mini .controls { 305 | width: 140px; 306 | } 307 | #optionsframework .mini .controls input, #optionsframework .mini .controls { 308 | min-width:140px; 309 | width: 140px; 310 | } 311 | #optionsframework .mini .explain { 312 | max-width:74%; 313 | } 314 | 315 | /* Editor */ 316 | 317 | #optionsframework .section-editor .explain { 318 | max-width: 98%; 319 | float:none; 320 | margin-bottom:5px; 321 | } 322 | 323 | /* Image Uploader */ 324 | 325 | #optionsframework .controls input.upload { 326 | width:80%; 327 | box-shadow: none; 328 | } 329 | #optionsframework .controls input.upload_button { 330 | float:right; 331 | border-color:#BBBBBB; 332 | cursor:pointer; 333 | } 334 | #optionsframework .controls input.upload_button:hover { 335 | border-color:#666666; 336 | color:#000; 337 | } 338 | #optionsframework .screenshot { 339 | float:left; 340 | margin-left:1px; 341 | position:relative; 342 | width:150px; 343 | margin-top:20px; 344 | } 345 | #optionsframework .screenshot img { 346 | background:#FAFAFA; 347 | border-color:#ccc #eee #eee #ccc; 348 | border-style:solid; 349 | border-width:1px; 350 | float:left; 351 | max-width:334px; 352 | max-height: 130px; 353 | padding:4px; 354 | margin-bottom:10px; 355 | } 356 | #optionsframework .screenshot .remove-image { 357 | background:url("../images/ico-delete.png") no-repeat; 358 | border:medium none; 359 | bottom:4px; 360 | display:block; 361 | float:left; 362 | height:16px; 363 | padding:0; 364 | position:absolute; 365 | left:-4px; 366 | text-indent:-9999px; 367 | width:16px; 368 | } 369 | #optionsframework .screenshot .no_image .file_link { 370 | margin-left: 20px; 371 | } 372 | #optionsframework .screenshot .no_image .remove-button { 373 | bottom: 0px; 374 | } 375 | #optionsframework .reset-button { 376 | float: left; 377 | box-shadow: none; 378 | border: none; 379 | background: #374D6F; 380 | text-shadow: none; 381 | color:#fff; 382 | height: 40px; 383 | width: 100px; 384 | border-radius: 0px; 385 | cursor:pointer; 386 | } 387 | 388 | /* Bottom Section */ 389 | 390 | #optionsframework-submit { 391 | padding: 7px 10px; 392 | background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC); 393 | } 394 | #optionsframework .button-primary { 395 | float: right; 396 | box-shadow: none; 397 | border: none; 398 | background: #FF6464; 399 | text-shadow: none; 400 | /* padding: 10px; */ 401 | height: 40px; 402 | width: 100px; 403 | border-radius: 0px; 404 | } 405 | #optionsframework .section:after { 406 | content: ""; 407 | display: table; 408 | } 409 | #optionsframework .section:after { 410 | clear: both; 411 | } 412 | 413 | input.of-radio-img-radio{display: none;} 414 | .of-radio-img-label{display: none;} 415 | .of-radio-color{ 416 | display: inline-block;width: 20px;height: 20px;margin: 0 5px 0 0; 417 | } 418 | #optionsframework .controls .of-radio-img-img { 419 | border:3px solid #f9f9f9; 420 | margin:0 5px 10px 0; 421 | /*display:none;*/ 422 | cursor:pointer; 423 | float:left; 424 | } 425 | #optionsframework .controls .of-radio-img-selected { 426 | border:3px solid #ccc 427 | } 428 | #optionsframework .controls .of-radio-img-img:hover { 429 | opacity:.8; 430 | } 431 | #optionsframework .controls .of-border-width { 432 | width:80px; 433 | float:left 434 | } 435 | #optionsframework .controls .of-border-style { 436 | width:120px; 437 | float:left 438 | } 439 | 440 | 441 | #optionsframework .section-color .controls, 442 | #optionsframework .section-colorradio .controls, 443 | #optionsframework .section-radio .controls{float: none;width: 100%;overflow: hidden;margin-bottom: 5px;} 444 | 445 | #optionsframework .section-color .explain, 446 | #optionsframework .section-colorradio .explain, 447 | #optionsframework .section-radio .explain{float: none;width: 100%;} 448 | -------------------------------------------------------------------------------- /inc/customizer.php: -------------------------------------------------------------------------------- 1 | get_setting( 'blogname' )->transport = 'postMessage'; 15 | $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 16 | $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; 17 | } 18 | add_action( 'customize_register', 'akina_customize_register' ); 19 | 20 | /** 21 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. 22 | */ 23 | function akina_customize_preview_js() { 24 | wp_enqueue_script( 'akina_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); 25 | } 26 | add_action( 'customize_preview_init', 'akina_customize_preview_js' ); 27 | -------------------------------------------------------------------------------- /inc/decorate.php: -------------------------------------------------------------------------------- 1 | 3 | 32 | ',c='
',b='
',g='';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(f.browser.msie&&parseInt(f.browser.version,10)<8){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery)); -------------------------------------------------------------------------------- /inc/js/iris.min.js: -------------------------------------------------------------------------------- 1 | /*! Iris - v0.9.14 - 2012-11-20 2 | * https://github.com/Automattic/Iris 3 | * Copyright (c) 2012 Matt Wiebe; Licensed GPL */ 4 | (function(e,t){function u(){if(r)i="filter";else{var t=e('
'),n="linear-gradient(top,#fff,#000)";e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),e.browser.webkit&&i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove()}}function a(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?l(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function f(t,n){t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1);var r=t==="top"?0:1,i=e(this),s=n.length-1,o=parseInt(e.browser.version,10)>=8?"-ms-filter":"filter";o="filter";var u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='
',h="";i.css("position")==="static"&&i.css({position:"relative"}),n=c(n),e.each(n,function(e,t){if(e===s)return!1;var i=n[e+1];if(t.stop===i.stop)return;var o=100-parseFloat(i.stop)+"%";t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex();var u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')";h+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(i)}function l(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=c(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function c(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=h(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function h(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i"),n=e(""),r=e.isArray(this.options.palettes)?this.options.palettes:this._palettes;e.each(r,function(e,r){n.clone().data("color",r).css("backgroundColor",r).appendTo(t).height(10).width(10)}),this.picker.append(t)},_paint:function(){var e=this;e._paintDimension("top","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var n=this,r=n.color,i=n.options.mode,s=n._getHSpaceColor(),o=n.controls[t],u=n.options.controls,a;if(t===n.active||n.active==="square"&&t!=="strip")return;switch(u[t]){case"h":if(i==="hsv"){s=r.clone();switch(t){case"horiz":s[u.vert](100);break;case"vert":s[u.horiz](100);break;case"strip":s.setHSpace("hsl")}a=s.toHsl()}else t==="strip"?a={s:s.s,l:s.l}:a={s:100,l:s.l};o.raninbowGradient(e,a);break;case"s":i==="hsv"?t==="vert"?a=[r.clone().a(0).s(0).toCSS("rgba"),r.clone().a(1).s(0).toCSS("rgba")]:t==="strip"?a=[r.clone().s(100).toCSS("hsl"),r.clone().s(0).toCSS("hsl")]:t==="horiz"&&(a=["#fff","hsl("+s.h+",100%,50%)"]):t==="vert"&&n.options.controls.horiz==="h"?a=["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:a=["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],o.gradient(e,a);break;case"l":t==="strip"?a=["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:a=["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],o.gradient(e,a);break;case"v":t==="strip"?a=[r.clone().v(100).toCSS(),r.clone().v(0).toCSS()]:a=["rgba(0,0,0,0)","#000"],o.gradient(e,a);break;default:}},_getHSpaceColor:function(){return this.options.mode==="hsv"?this.color.toHsv():this.color.toHsl()},_dimensions:function(t){var n=this,r=n.options,i=n.picker.find(".iris-picker-inner"),s=n.controls,o=s.square,u=n.picker.find(".iris-strip"),a="77.5%",f="12%",l=20,c=r.border?r.width-l:r.width,h,p=e.isArray(r.palettes)?r.palettes.length:n._palettes.length,d,v,m;t&&(o.css("width",""),u.css("width",""),n.picker.removeAttr("style")),a=c*(parseFloat(a)/100),f=c*(parseFloat(f)/100),h=r.border?a+l:a,o.width(a).height(a),u.height(a).width(f),n.picker.css({width:r.width,height:h});if(!r.palettes)return;d=a*2/100,m=a-(p-1)*d,v=m/p,n.picker.find(".iris-palette").each(function(t,n){var r=t===0?0:d;e(this).css({width:v,height:v,marginLeft:r})}),n.picker.css("paddingBottom",v+d),u.height(v+d+a)},_addInputListeners:function(e){var t=this,n=100,r=function(n){var r=new Color(e.val()),i=e.val().replace(/^#/,"");e.removeClass("iris-error"),r.error?i!==""&&e.addClass("iris-error"):r.toString()!==t.color.toString()&&(n.type!=="keyup"||!i.match(/^[0-9a-fA-F]{3}$/))&&t._setOption("color",r.toString())};e.on("change",r).on("keyup",t._debounce(r,n))},_initControls:function(){var t=this,n=t.controls,r=n.square,i=t.options.controls,s=t._scale[i.strip];n.stripSlider.slider({orientation:"vertical",max:s,slide:function(e,n){t.active="strip",i.strip==="h"&&(n.value=s-n.value),t.color[i.strip](n.value),t._change.apply(t,arguments)}}),n.squareDrag.draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(e,n){t._squareDrag(e,n)},start:function(){r.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){r.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(n){n.preventDefault();var r="ui-state-focus";n.type==="mousedown"?(t.picker.find("."+r).removeClass(r).blur(),e(this).addClass(r).focus()):e(this).removeClass(r)}).on("keydown",function(e){var r=n.square,i=n.squareDrag,s=i.position(),o=t.options.width/100;e.altKey&&(o*=10);switch(e.keyCode){case 37:s.left-=o;break;case 38:s.top-=o;break;case 39:s.left+=o;break;case 40:s.top+=o;break;default:return!0}s.left=Math.max(0,Math.min(s.left,r.width())),s.top=Math.max(0,Math.min(s.top,r.height())),i.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),r.mousedown(function(n){if(n.which!==1)return;if(!e(n.target).is("div"))return;var r=t.controls.square.offset(),i={top:n.pageY-r.top,left:n.pageX-r.left};n.preventDefault(),t._squareDrag(n,{position:i}),n.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(i).trigger(n)}),t.options.palettes&&t.picker.find(".iris-palette-container").on("click",".iris-palette",function(n){t.color.fromCSS(e(this).data("color")),t.active="external",t._change()}).on("keydown",".iris-palette",function(t){if(t.keyCode!==13&&t.keyCode!==32)return!0;t.stopPropagation(),e(this).click()})},_squareDrag:function(e,t){var n=this,r=n.options.controls,i=n._squareDimensions(),s=Math.round((i.h-t.position.top)/i.h*n._scale[r.vert]),o=n._scale[r.horiz]-Math.round((i.w-t.position.left)/i.w*n._scale[r.horiz]);n.color[r.horiz](o)[r.vert](s),n.active="square",n._change.apply(n,arguments)},_setOption:function(e,t){var n=this.options[e];if(e==="color"){t=""+t;var r=t.replace(/^#/,""),i=(new Color(t)).setHSpace(this.options.mode);i.error||(this.color=i,this.options.color=this.options[e]=this.color.toString(),this.active="external",this._change())}},_squareDimensions:function(e){var n=this.controls.square,r,i;return e!==t&&n.data("dimensions")?n.data("dimensions"):(i=this.controls.squareDrag,r={w:n.width(),h:n.height()},n.data("dimensions",r),r)},_isNonHueControl:function(e,t){return e==="square"&&this.options.controls.strip==="h"?!0:t==="external"||t==="h"&&e==="strip"?!1:!0},_change:function(t,n){var r=this,i=r.controls,s=r._getHSpaceColor(),o=r.color.toString(),u=["square","strip"],a=r.options.controls,f=a[r.active]||"external",l=r.hue;r.active==="strip"?u=[]:r.active!=="external"&&u.pop(),e.each(u,function(e,t){var n;if(t!==r.active)switch(t){case"strip":n=a.strip==="h"?r._scale[a.strip]-s[a.strip]:s[a.strip],i.stripSlider.slider("value",n);break;case"square":var o=r._squareDimensions(),u={left:s[a.horiz]/r._scale[a.horiz]*o.w,top:o.h-s[a.vert]/r._scale[a.vert]*o.h};r.controls.squareDrag.css(u)}}),s.h!==l&&r._isNonHueControl(r.active,f)&&r.color.h(l),r.hue=r.color.h(),r.options.color=r.color.toString(),r._inited&&r._trigger("change",{type:r.active},{color:r.color}),r.element.is(":input")&&!r.color.error&&(r.element.removeClass("iris-error"),r.element.val()!==r.color.toString()&&r.element.val(r.color.toString())),r._paint(),r._inited=!0,r.active=!1},_debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()}};e.widget("a8c.iris",p),e('").appendTo("head")})(jQuery),function(e,t){var n=function(e,t){return this instanceof n?this._init(e,t):new n(e,t)};n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var n="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),n=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":n,this[n](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"];for(var r=t.length-1;r>=0;r--)e[t[r]]=this[t[r]];return e},setHSpace:function(e){return this._hSpace=e==="hsv"?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,n,r=/^(rgb|hs(l|v))a?\(/;this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"");if(e.match(r)&&e.match(/\)$/)){n=e.replace(/(\s|%)/g,"").replace(r,"").replace(/,?\);?$/,"").split(",");if(n.length<3)return this._error();if(n.length===4){this.a(parseFloat(n.pop()));if(this.error)return this}for(var i=n.length-1;i>=0;i--){n[i]=parseInt(n[i],10);if(isNaN(n[i]))return this._error()}return e.match(/^rgb/)?this.fromRgb({r:n[0],g:n[1],b:n[2]}):e.match(/^hsv/)?this.fromHsv({h:n[0],s:n[1],v:n[2]}):this.fromHsl({h:n[0],s:n[1],l:n[2]})}return this.fromHex(e)},fromRgb:function(e,n){return typeof e!="object"||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),n))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var n,r,i,s,o,u,a,f;return typeof e!="object"||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",u=e.h/360,a=e.s/100,f=e.l/100,a===0?n=r=i=f:(s=f<.5?f*(1+a):f+a-f*a,o=2*f-s,n=this.hue2rgb(o,s,u+1/3),r=this.hue2rgb(o,s,u),i=this.hue2rgb(o,s,u-1/3)),this.fromRgb({r:n*255,g:r*255,b:i*255},!0))},fromHsv:function(e){var n,r,i,s,o,u,a,f,l,c,h;if(typeof e!="object"||e.h===t||e.s===t||e.v===t)return this._error();this._hsv=e,this._hSpace="hsv",n=e.h/360,r=e.s/100,i=e.v/100,a=Math.floor(n*6),f=n*6-a,l=i*(1-r),c=i*(1-f*r),h=i*(1-(1-f)*r);switch(a%6){case 0:s=i,o=h,u=l;break;case 1:s=c,o=i,u=l;break;case 2:s=l,o=i,u=h;break;case 3:s=l,o=c,u=i;break;case 4:s=h,o=l,u=i;break;case 5:s=i,o=l,u=c}return this.fromRgb({r:s*255,g:o*255,b:u*255},!0)},fromInt:function(e,n){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),n===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},toString:function(){var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){e=e||"hex",t=parseFloat(t||this._alpha);switch(e){case"rgb":case"rgba":var n=this.toRgb();return t<1?"rgba( "+n.r+", "+n.g+", "+n.b+", "+t+" )":"rgb( "+n.r+", "+n.g+", "+n.b+" )";case"hsl":case"hsla":var r=this.toHsl();return t<1?"hsla( "+r.h+", "+r.s+"%, "+r.l+"%, "+t+" )":"hsl( "+r.h+", "+r.s+"%, "+r.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=(i+s)/2;if(i===s)o=u=0;else{var f=i-s;u=a>.5?f/(2-i-s):f/(i+s);switch(i){case t:o=(n-r)/f+(nr?(t+.05)/(r+.05):(r+.05)/(t+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new n(t)},getGrayscaleContrastingColor:function(e){if(!e)return this.getMaxContrastColor();var t=e<5?5:e,n=this.getMaxContrastColor();e=n.getDistanceLuminosityFrom(this);if(e<=t)return n;var r=0===n.toInt()?1:-1;while(e>t)n=n.incrementLightness(r),e=n.getDistanceLuminosityFrom(this);return n},getReadableContrastingColor:function(e,r){if(!e instanceof n)return this;var i=r===t?5:r,s=e.getDistanceLuminosityFrom(this),o=e.getMaxContrastColor(),u=o.getDistanceLuminosityFrom(e);if(u<=i)return o;if(s>=i)return this;var a=0===o.toInt()?-1:1;while(sn.range[1]?n.range[1]:r),s[e]=r,this._spaceFunc("from",n.space,s))}},_spaceFunc:function(e,t,n){var r=t||this._hSpace,i=e+r.charAt(0).toUpperCase()+r.substr(1);return this[i](n)}};var r={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var i in r)r.hasOwnProperty(i)&&(n.fn[i]=n.fn._partial(i));e.Color=n}(typeof exports=="object"&&exports||this); -------------------------------------------------------------------------------- /inc/js/media-uploader.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($){ 2 | 3 | var optionsframework_upload; 4 | var optionsframework_selector; 5 | 6 | function optionsframework_add_file(event, selector) { 7 | 8 | var upload = $(".uploaded-file"), frame; 9 | var $el = $(this); 10 | optionsframework_selector = selector; 11 | 12 | event.preventDefault(); 13 | 14 | // If the media frame already exists, reopen it. 15 | if ( optionsframework_upload ) { 16 | optionsframework_upload.open(); 17 | } else { 18 | // Create the media frame. 19 | optionsframework_upload = wp.media.frames.optionsframework_upload = wp.media({ 20 | // Set the title of the modal. 21 | title: $el.data('choose'), 22 | 23 | // Customize the submit button. 24 | button: { 25 | // Set the text of the button. 26 | text: $el.data('update'), 27 | // Tell the button not to close the modal, since we're 28 | // going to refresh the page when the image is selected. 29 | close: false 30 | } 31 | }); 32 | 33 | // When an image is selected, run a callback. 34 | optionsframework_upload.on( 'select', function() { 35 | // Grab the selected attachment. 36 | var attachment = optionsframework_upload.state().get('selection').first(); 37 | optionsframework_upload.close(); 38 | optionsframework_selector.find('.upload').val(attachment.attributes.url); 39 | if ( attachment.attributes.type == 'image' ) { 40 | optionsframework_selector.find('.screenshot').empty().hide().append('Remove').slideDown('fast'); 41 | } 42 | optionsframework_selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove); 43 | optionsframework_selector.find('.of-background-properties').slideDown(); 44 | optionsframework_selector.find('.remove-image, .remove-file').on('click', function() { 45 | optionsframework_remove_file( $(this).parents('.section') ); 46 | }); 47 | }); 48 | 49 | } 50 | 51 | // Finally, open the modal. 52 | optionsframework_upload.open(); 53 | } 54 | 55 | function optionsframework_remove_file(selector) { 56 | selector.find('.remove-image').hide(); 57 | selector.find('.upload').val(''); 58 | selector.find('.of-background-properties').hide(); 59 | selector.find('.screenshot').slideUp(); 60 | selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload); 61 | // We don't display the upload button if .upload-notice is present 62 | // This means the user doesn't have the WordPress 3.5 Media Library Support 63 | if ( $('.section-upload .upload-notice').length > 0 ) { 64 | $('.upload-button').remove(); 65 | } 66 | selector.find('.upload-button').on('click', function(event) { 67 | optionsframework_add_file(event, $(this).parents('.section')); 68 | }); 69 | } 70 | 71 | $('.remove-image, .remove-file').on('click', function() { 72 | optionsframework_remove_file( $(this).parents('.section') ); 73 | }); 74 | 75 | $('.upload-button').click( function( event ) { 76 | optionsframework_add_file(event, $(this).parents('.section')); 77 | }); 78 | 79 | }); -------------------------------------------------------------------------------- /inc/js/options-custom.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Prints out the inline javascript needed for the colorpicker and choosing 3 | * the tabs in the panel. 4 | */ 5 | 6 | jQuery(document).ready(function($) { 7 | 8 | // Fade out the save message 9 | $('.fade').delay(1000).fadeOut(1000); 10 | 11 | $('.of-color').wpColorPicker(); 12 | 13 | // Switches option sections 14 | $('.group').hide(); 15 | var active_tab = ''; 16 | if (typeof(localStorage) != 'undefined' ) { 17 | active_tab = localStorage.getItem("active_tab"); 18 | } 19 | if (active_tab != '' && $(active_tab).length ) { 20 | $(active_tab).fadeIn(); 21 | } else { 22 | $('.group:first').fadeIn(); 23 | } 24 | $('.group .collapsed').each(function(){ 25 | $(this).find('input:checked').parent().parent().parent().nextAll().each( 26 | function(){ 27 | if ($(this).hasClass('last')) { 28 | $(this).removeClass('hidden'); 29 | return false; 30 | } 31 | $(this).filter('.hidden').removeClass('hidden'); 32 | }); 33 | }); 34 | if (active_tab != '' && $(active_tab + '-tab').length ) { 35 | $(active_tab + '-tab').addClass('nav-tab-active'); 36 | } 37 | else { 38 | $('.nav-tab-wrapper a:first').addClass('nav-tab-active'); 39 | } 40 | 41 | $('.nav-tab-wrapper a').click(function(evt) { 42 | $('.nav-tab-wrapper a').removeClass('nav-tab-active'); 43 | $(this).addClass('nav-tab-active').blur(); 44 | var clicked_group = $(this).attr('href'); 45 | if (typeof(localStorage) != 'undefined' ) { 46 | localStorage.setItem("active_tab", $(this).attr('href')); 47 | } 48 | $('.group').hide(); 49 | $(clicked_group).fadeIn(); 50 | evt.preventDefault(); 51 | 52 | // Editor Height (needs improvement) 53 | $('.wp-editor-wrap').each(function() { 54 | var editor_iframe = $(this).find('iframe'); 55 | if ( editor_iframe.height() < 30 ) { 56 | editor_iframe.css({'height':'auto'}); 57 | } 58 | }); 59 | 60 | }); 61 | 62 | $('.group .collapsed input:checkbox').click(unhideHidden); 63 | 64 | function unhideHidden(){ 65 | if ($(this).attr('checked')) { 66 | $(this).parent().parent().parent().nextAll().removeClass('hidden'); 67 | } 68 | else { 69 | $(this).parent().parent().parent().nextAll().each( 70 | function(){ 71 | if ($(this).filter('.last').length) { 72 | $(this).addClass('hidden'); 73 | return false; 74 | } 75 | $(this).addClass('hidden'); 76 | }); 77 | 78 | } 79 | } 80 | 81 | // Image Options 82 | $('.of-radio-img-img').click(function(){ 83 | $(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected'); 84 | $(this).addClass('of-radio-img-selected'); 85 | }); 86 | 87 | $('.of-radio-img-label').hide(); 88 | $('.of-radio-img-img').show(); 89 | $('.of-radio-img-radio').hide(); 90 | 91 | }); -------------------------------------------------------------------------------- /inc/login.css: -------------------------------------------------------------------------------- 1 | /* clear float */ 2 | .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 3 | .clearfix { display: block; } 4 | 5 | /* common */ 6 | html { overflow:hidden; background-color: #000;} 7 | body { background:none !important; overflow:hidden;} 8 | 9 | #bg{ 10 | -webkit-filter: blur(2px); /* Chrome, Opera */ 11 | -moz-filter: blur(2px); 12 | -ms-filter: blur(2px); 13 | filter: blur(2px); 14 | } 15 | #bg img { opacity: 1 !important;; } 16 | 17 | .login #login_error, .login .message { 18 | position: absolute; 19 | top: -70px; 20 | } 21 | 22 | /* login */ 23 | #login { 24 | font:14px/1.4 "Helvetica Neue","HelveticaNeue",Helvetica,Arial,sans-serif; 25 | position:absolute; 26 | background: rgba(255, 255, 255, 0.45); 27 | border-radius: 6px; 28 | top:50%; 29 | left:50%; 30 | width:350px; 31 | padding:0px !important; 32 | margin:-235px 0px 0px -190px !important; 33 | background-position: center 48%; 34 | } 35 | 36 | #login h1 a { 37 | font-family:"Microsoft Yahei"; 38 | font-weight:bold; 39 | text-indent:0px; 40 | font-size:0px; 41 | height:64px; 42 | width: 100%; 43 | line-height:88px; 44 | line-height:180%; 45 | text-align:center; color:#FFF; 46 | text-shadow:1px 1px 0px #000; 47 | margin-bottom:10px; 48 | margin-top: 25px; 49 | background-image:url(../images/login.png); 50 | background-position: center bottom !important; 51 | background-size: contain; 52 | padding-top: 20px; 53 | box-shadow: none; 54 | } 55 | 56 | input:-webkit-autofill {-webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0) inset;; 57 | color: #676767 !important} 58 | 59 | #login form { 60 | padding:10px 0px; 61 | background: none; 62 | box-shadow: none; 63 | margin-top: 10px; 64 | } 65 | 66 | #login form p { 67 | font-family:"Microsoft Yahei"; 68 | position:relative; 69 | padding:0px 35px; 70 | } 71 | 72 | #login a { 73 | text-shadow:1px 1px 0px #000; 74 | color:#FFF !important; 75 | font-family:"Microsoft Yahei"; 76 | } 77 | #login_error a { 78 | color:#000 !important; 79 | text-shadow:1px 1px 0px #FFF; 80 | } 81 | 82 | #login form label { 83 | color:#333; 84 | color: #585858; 85 | } 86 | 87 | #login form .input { 88 | border:1px solid #EAEAEA; 89 | border-radius:0px; 90 | background:none; 91 | padding:5px 10px; 92 | color:#444; 93 | font-weight:normal; 94 | font-size:14px; 95 | background:#FFF; 96 | font-family:"Microsoft Yahei"; 97 | box-shadow: 0 0 0px 1000px white inset; 98 | height: 50px; 99 | border-radius: 3px; 100 | margin-top: 10px; 101 | } 102 | 103 | #login form .input:active { 104 | box-shadow:0 0 0px 1000px white inset; 105 | color: #676767 !important; 106 | } 107 | 108 | #login form .input:focus { 109 | box-shadow:0 0 0px 1000px white inset; 110 | color: #676767 !important; 111 | } 112 | 113 | #login .form-send .bot { 114 | width:100%; 115 | border-bottom:1px solid #ccc; 116 | } 117 | 118 | #login form .forgetmenot { 119 | float:none; 120 | } 121 | 122 | #login form p.submit { 123 | padding:0px 35px !important; 124 | } 125 | 126 | #login .submit .button { 127 | width:100%; 128 | margin: 20px auto 40px; 129 | border:none; 130 | float:none; 131 | border-radius:30px; 132 | height:50px; 133 | font-size:14px; 134 | text-align:center; 135 | color:#FFF; 136 | background:#FF5656; 137 | font-weight:normal; 138 | cursor:pointer; 139 | box-shadow: none; 140 | text-shadow: none; 141 | letter-spacing:2px 142 | } 143 | 144 | .login #nav , #backtoblog { 145 | /*display:none*/ 146 | color: #585858 !important; 147 | } 148 | 149 | .login #nav { 150 | margin: 0; 151 | } 152 | 153 | .login .ds-login{ 154 | margin-left: 38px; 155 | } 156 | 157 | .login form input[type=checkbox] { 158 | background: #FFFFFF; 159 | box-shadow: none; 160 | width:20px; 161 | height:20px; 162 | border-radius: 2px; 163 | } 164 | 165 | input[type=checkbox]:checked:before { 166 | content: "\f147"; 167 | margin: -2px 0 0 -2px; 168 | color: #FF5656; 169 | } 170 | 171 | /* loading */ 172 | .loading { position:absolute; top:0px; left:0px; width:100%; height:100%; z-index:99; overflow:hidden; background:#000; } 173 | .loading img { position:absolute; top:50%; left:50%; width:58px; height:10px; margin:-5px 0px 0px -29px; } -------------------------------------------------------------------------------- /inc/options-framework.php: -------------------------------------------------------------------------------- 1 | __( '主题设置', 'optionsframework'), 183 | 'menu_title' => __('主题设置', 'optionsframework'), 184 | 'capability' => 'edit_theme_options', 185 | 'menu_slug' => 'options-framework', 186 | 'callback' => 'optionsframework_page' 187 | ); 188 | 189 | return apply_filters( 'optionsframework_menu', $menu ); 190 | } 191 | 192 | /* Add a subpage called "Theme Options" to the appearance menu. */ 193 | 194 | function optionsframework_add_page() { 195 | 196 | $menu = optionsframework_menu_settings(); 197 | $of_page = add_theme_page( $menu['page_title'], $menu['menu_title'], $menu['capability'], $menu['menu_slug'], $menu['callback'] ); 198 | 199 | // Load the required CSS and javscript 200 | add_action( 'admin_enqueue_scripts', 'optionsframework_load_scripts' ); 201 | add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' ); 202 | } 203 | 204 | /* Loads the CSS */ 205 | 206 | function optionsframework_load_styles() { 207 | wp_enqueue_style( 'optionsframework', OPTIONS_FRAMEWORK_DIRECTORY.'css/optionsframework.css' ); 208 | if ( !wp_style_is( 'wp-color-picker','registered' ) ) { 209 | wp_register_style( 'wp-color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'css/color-picker.min.css' ); 210 | } 211 | wp_enqueue_style( 'wp-color-picker' ); 212 | } 213 | 214 | /* Loads the javascript */ 215 | 216 | function optionsframework_load_scripts( $hook ) { 217 | 218 | $menu = optionsframework_menu_settings(); 219 | 220 | if ( 'appearance_page_' . $menu['menu_slug'] != $hook ) 221 | return; 222 | 223 | // Enqueue colorpicker scripts for versions below 3.5 for compatibility 224 | if ( !wp_script_is( 'wp-color-picker', 'registered' ) ) { 225 | wp_register_script( 'iris', OPTIONS_FRAMEWORK_DIRECTORY . 'js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); 226 | wp_register_script( 'wp-color-picker', OPTIONS_FRAMEWORK_DIRECTORY . 'js/color-picker.min.js', array( 'jquery', 'iris' ) ); 227 | $colorpicker_l10n = array( 228 | 'clear' => __( 'Clear','options_framework_theme' ), 229 | 'defaultString' => __( 'Default', 'options_framework_theme' ), 230 | 'pick' => __( 'Select Color', 'options_framework_theme' ) 231 | ); 232 | wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n ); 233 | } 234 | 235 | // Enqueue custom option panel JS 236 | wp_enqueue_script( 'options-custom', OPTIONS_FRAMEWORK_DIRECTORY . 'js/options-custom.js', array( 'jquery','wp-color-picker' ) ); 237 | 238 | // Inline scripts from options-interface.php 239 | add_action( 'admin_head', 'of_admin_head' ); 240 | } 241 | 242 | function of_admin_head() { 243 | // Hook to add custom scripts 244 | do_action( 'optionsframework_custom_scripts' ); 245 | } 246 | 247 | /* 248 | * Builds out the options panel. 249 | * 250 | * If we were using the Settings API as it was likely intended we would use 251 | * do_settings_sections here. But as we don't want the settings wrapped in a table, 252 | * we'll call our own custom optionsframework_fields. See options-interface.php 253 | * for specifics on how each individual field is generated. 254 | * 255 | * Nonces are provided using the settings_fields() 256 | * 257 | */ 258 | 259 | if ( !function_exists( 'optionsframework_page' ) ) : 260 | function optionsframework_page() { ?> 261 | 262 |
263 | 264 | 267 | 268 | 269 | 270 |
271 |
272 |
273 | 274 | 275 |
276 | 277 | 278 |
279 |
280 |
281 |
282 |
283 | 284 |
285 | 286 | $value ) { 342 | $input[$id][$key] = false; 343 | } 344 | } 345 | 346 | // For a value to be submitted to database it must pass through a sanitization filter 347 | if ( has_filter( 'of_sanitize_' . $option['type'] ) ) { 348 | $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option ); 349 | } 350 | } 351 | 352 | // Hook to run after validation 353 | do_action( 'optionsframework_after_validate', $clean ); 354 | 355 | return $clean; 356 | } 357 | 358 | /** 359 | * Display message when options have been saved 360 | */ 361 | 362 | function optionsframework_save_options_notice() { 363 | add_settings_error( 'options-framework', 'save_options', __( 'Options saved.', 'options_framework_theme' ), 'updated fade' ); 364 | } 365 | 366 | add_action( 'optionsframework_after_validate', 'optionsframework_save_options_notice' ); 367 | 368 | /** 369 | * Format Configuration Array. 370 | * 371 | * Get an array of all default values as set in 372 | * options.php. The 'id','std' and 'type' keys need 373 | * to be defined in the configuration array. In the 374 | * event that these keys are not present the option 375 | * will not be included in this function's output. 376 | * 377 | * @return array Rey-keyed options configuration array. 378 | * 379 | * @access private 380 | */ 381 | 382 | function of_get_default_values() { 383 | $output = array(); 384 | $config =& _optionsframework_options(); 385 | foreach ( (array) $config as $option ) { 386 | if ( ! isset( $option['id'] ) ) { 387 | continue; 388 | } 389 | if ( ! isset( $option['std'] ) ) { 390 | continue; 391 | } 392 | if ( ! isset( $option['type'] ) ) { 393 | continue; 394 | } 395 | if ( has_filter( 'of_sanitize_' . $option['type'] ) ) { 396 | $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option ); 397 | } 398 | } 399 | return $output; 400 | } 401 | 402 | /** 403 | * Add Theme Options menu item to Admin Bar. 404 | */ 405 | 406 | function optionsframework_adminbar() { 407 | 408 | global $wp_admin_bar; 409 | 410 | $wp_admin_bar->add_menu( array( 411 | 'parent' => 'appearance', 412 | 'id' => 'of_theme_options', 413 | 'title' => __( '主题设置', 'options_framework_theme' ), 414 | 'href' => admin_url( 'themes.php?page=options-framework' ) 415 | )); 416 | } 417 | 418 | /** 419 | * Wrapper for optionsframework_options() 420 | * 421 | * Allows for manipulating or setting options via 'of_options' filter 422 | * For example: 423 | * 424 | * 425 | * add_filter('of_options', function($options) { 426 | * $options[] = array( 427 | * 'name' => 'Input Text Mini', 428 | * 'desc' => 'A mini text input field.', 429 | * 'id' => 'example_text_mini', 430 | * 'std' => 'Default', 431 | * 'class' => 'mini', 432 | * 'type' => 'text' 433 | * ); 434 | * 435 | * return $options; 436 | * }); 437 | * 438 | * 439 | * Also allows for setting options via a return statement in the 440 | * options.php file. For example (in options.php): 441 | * 442 | * 443 | * return array(...); 444 | * 445 | * 446 | * @return array (by reference) 447 | */ 448 | function &_optionsframework_options() { 449 | static $options = null; 450 | 451 | if ( !$options ) { 452 | // Load options from options.php file (if it exists) 453 | $location = apply_filters( 'options_framework_location', array('options.php') ); 454 | if ( $optionsfile = locate_template( $location ) ) { 455 | $maybe_options = require_once $optionsfile; 456 | if ( is_array($maybe_options) ) { 457 | $options = $maybe_options; 458 | } else if ( function_exists( 'optionsframework_options' ) ) { 459 | $options = optionsframework_options(); 460 | } 461 | } 462 | 463 | // Allow setting/manipulating options via filters 464 | $options = apply_filters('of_options', $options); 465 | } 466 | 467 | return $options; 468 | } 469 | 470 | /** 471 | * Get Option. 472 | * 473 | * Helper function to return the theme option value. 474 | * If no value has been saved, it returns $default. 475 | * Needed because options are saved as serialized strings. 476 | */ 477 | 478 | if ( ! function_exists( 'akina_option' ) ) { 479 | 480 | function akina_option( $name, $default = false ) { 481 | $config = get_option( 'optionsframework' ); 482 | 483 | if ( ! isset( $config['id'] ) ) { 484 | return $default; 485 | } 486 | 487 | $options = get_option( $config['id'] ); 488 | 489 | if ( isset( $options[$name] ) ) { 490 | return $options[$name]; 491 | } 492 | 493 | return $default; 494 | } 495 | } -------------------------------------------------------------------------------- /inc/options-interface.php: -------------------------------------------------------------------------------- 1 | ' . esc_html( $value['name'] ) . ''; 20 | } 21 | } 22 | 23 | return $menu; 24 | } 25 | 26 | /** 27 | * Generates the options fields that are used in the form. 28 | */ 29 | 30 | function optionsframework_fields() { 31 | 32 | global $allowedtags; 33 | $optionsframework_settings = get_option( 'optionsframework' ); 34 | 35 | // Gets the unique option id 36 | if ( isset( $optionsframework_settings['id'] ) ) { 37 | $option_name = $optionsframework_settings['id']; 38 | } 39 | else { 40 | $option_name = 'options_framework_theme'; 41 | }; 42 | 43 | $settings = get_option($option_name); 44 | $options =& _optionsframework_options(); 45 | 46 | $counter = 0; 47 | $menu = ''; 48 | 49 | foreach ( $options as $value ) { 50 | 51 | $val = ''; 52 | $select_value = ''; 53 | $output = ''; 54 | 55 | // Wrap all options 56 | if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) { 57 | 58 | // Keep all ids lowercase with no spaces 59 | $value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower( $value['id'] ) ); 60 | 61 | $id = 'section-' . $value['id']; 62 | 63 | $class = 'section'; 64 | if ( isset( $value['type'] ) ) { 65 | $class .= ' section-' . $value['type']; 66 | } 67 | if ( isset( $value['class'] ) ) { 68 | $class .= ' ' . $value['class']; 69 | } 70 | 71 | $output .= '
'."\n"; 72 | if ( isset( $value['name'] ) ) { 73 | $output .= '

' . esc_html( $value['name'] ) . '

' . "\n"; 74 | } 75 | if ( $value['type'] != 'editor' ) { 76 | $output .= '
' . "\n" . '
' . "\n"; 77 | } 78 | else { 79 | $output .= '
' . "\n" . '
' . "\n"; 80 | } 81 | } 82 | 83 | // Set default value to $val 84 | if ( isset( $value['std'] ) ) { 85 | $val = $value['std']; 86 | } 87 | 88 | // If the option is already saved, ovveride $val 89 | if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') ) { 90 | if ( isset( $settings[($value['id'])]) ) { 91 | $val = $settings[($value['id'])]; 92 | // Striping slashes of non-array options 93 | if ( !is_array($val) ) { 94 | $val = stripslashes( $val ); 95 | } 96 | } 97 | } 98 | 99 | // If there is a description save it for labels 100 | $explain_value = ''; 101 | if ( isset( $value['desc'] ) ) { 102 | $explain_value = $value['desc']; 103 | } 104 | 105 | switch ( $value['type'] ) { 106 | 107 | // Basic text input 108 | case 'text': 109 | $output .= ''; 110 | break; 111 | 112 | // Password input 113 | case 'password': 114 | $output .= ''; 115 | break; 116 | 117 | // Textarea 118 | case 'textarea': 119 | $rows = '8'; 120 | 121 | if ( isset( $value['settings']['rows'] ) ) { 122 | $custom_rows = $value['settings']['rows']; 123 | if ( is_numeric( $custom_rows ) ) { 124 | $rows = $custom_rows; 125 | } 126 | } 127 | 128 | $val = stripslashes( $val ); 129 | $output .= ''; 130 | break; 131 | 132 | // Select Box 133 | case 'select': 134 | $output .= ''; 140 | break; 141 | 142 | 143 | // Radio Box 144 | case "radio": 145 | $name = $option_name .'['. $value['id'] .']'; 146 | foreach ($value['options'] as $key => $option) { 147 | $id = $option_name . '-' . $value['id'] .'-'. $key; 148 | $output .= ''; 149 | } 150 | break; 151 | 152 | // Image Selectors 153 | case "images": 154 | $name = $option_name .'['. $value['id'] .']'; 155 | foreach ( $value['options'] as $key => $option ) { 156 | $selected = ''; 157 | if ( $val != '' && ($val == $key) ) { 158 | $selected = ' of-radio-img-selected'; 159 | } 160 | $output .= ''; 161 | $output .= '
' . esc_html( $key ) . '
'; 162 | $output .= '' . $option .''; 163 | } 164 | break; 165 | 166 | // colorradio Selectors 167 | case "colorradio": 168 | $name = $option_name .'['. $value['id'] .']'; 169 | foreach ( $value['options'] as $key=>$key ) { 170 | $selected = ''; 171 | $checked = ''; 172 | if ( $val != '' ) { 173 | if ( $val == $key ) { 174 | $selected = ' of-radio-img-selected'; 175 | $checked = ' checked="checked"'; 176 | } 177 | } 178 | $output .= ''; 179 | $output .= '
' . esc_html( $key ) . '
'; 180 | $output .= ''; 181 | // $output .= '' . $option .''; 182 | } 183 | break; 184 | 185 | // Checkbox 186 | case "checkbox": 187 | $output .= ''; 188 | $output .= ''; 189 | break; 190 | 191 | // Multicheck 192 | case "multicheck": 193 | foreach ($value['options'] as $key => $option) { 194 | $checked = ''; 195 | $label = $option; 196 | $option = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($key)); 197 | 198 | $id = $option_name . '-' . $value['id'] . '-'. $option; 199 | $name = $option_name . '[' . $value['id'] . '][' . $option .']'; 200 | 201 | if ( isset($val[$option]) ) { 202 | $checked = checked($val[$option], 1, false); 203 | } 204 | 205 | $output .= ''; 206 | } 207 | break; 208 | 209 | // Color picker 210 | case "color": 211 | $default_color = ''; 212 | if ( isset($value['std']) ) { 213 | if ( $val != $value['std'] ) 214 | $default_color = ' data-default-color="' .$value['std'] . '" '; 215 | } 216 | $output .= ''; 217 | 218 | break; 219 | 220 | // Uploader 221 | case "upload": 222 | $output .= optionsframework_uploader( $value['id'], $val, null ); 223 | 224 | break; 225 | 226 | // Typography 227 | case 'typography': 228 | 229 | unset( $font_size, $font_style, $font_face, $font_color ); 230 | 231 | $typography_defaults = array( 232 | 'size' => '', 233 | 'face' => '', 234 | 'style' => '', 235 | 'color' => '' 236 | ); 237 | 238 | $typography_stored = wp_parse_args( $val, $typography_defaults ); 239 | 240 | $typography_options = array( 241 | 'sizes' => of_recognized_font_sizes(), 242 | 'faces' => of_recognized_font_faces(), 243 | 'styles' => of_recognized_font_styles(), 244 | 'color' => true 245 | ); 246 | 247 | if ( isset( $value['options'] ) ) { 248 | $typography_options = wp_parse_args( $value['options'], $typography_options ); 249 | } 250 | 251 | // Font Size 252 | if ( $typography_options['sizes'] ) { 253 | $font_size = ''; 260 | } 261 | 262 | // Font Face 263 | if ( $typography_options['faces'] ) { 264 | $font_face = ''; 270 | } 271 | 272 | // Font Styles 273 | if ( $typography_options['styles'] ) { 274 | $font_style = ''; 280 | } 281 | 282 | // Font Color 283 | if ( $typography_options['color'] ) { 284 | $default_color = ''; 285 | if ( isset( $value['std']['color'] ) ) { 286 | if ( $val != $value['std']['color'] ) 287 | $default_color = ' data-default-color="' .$value['std']['color'] . '" '; 288 | } 289 | $font_color = ''; 290 | } 291 | 292 | // Allow modification/injection of typography fields 293 | $typography_fields = compact( 'font_size', 'font_face', 'font_style', 'font_color' ); 294 | $typography_fields = apply_filters( 'of_typography_fields', $typography_fields, $typography_stored, $option_name, $value ); 295 | $output .= implode( '', $typography_fields ); 296 | 297 | break; 298 | 299 | // Background 300 | case 'background': 301 | 302 | $background = $val; 303 | 304 | // Background Color 305 | $default_color = ''; 306 | if ( isset( $value['std']['color'] ) ) { 307 | if ( $val != $value['std']['color'] ) 308 | $default_color = ' data-default-color="' .$value['std']['color'] . '" '; 309 | } 310 | $output .= ''; 311 | 312 | // Background Image 313 | if (!isset($background['image'])) { 314 | $background['image'] = ''; 315 | } 316 | 317 | $output .= optionsframework_uploader( $value['id'], $background['image'], null, esc_attr( $option_name . '[' . $value['id'] . '][image]' ) ); 318 | 319 | $class = 'of-background-properties'; 320 | if ( '' == $background['image'] ) { 321 | $class .= ' hide'; 322 | } 323 | $output .= '
'; 324 | 325 | // Background Repeat 326 | $output .= ''; 333 | 334 | // Background Position 335 | $output .= ''; 342 | 343 | // Background Attachment 344 | $output .= ''; 351 | $output .= '
'; 352 | 353 | break; 354 | 355 | // Editor 356 | case 'editor': 357 | $output .= '
' . wp_kses( $explain_value, $allowedtags ) . '
'."\n"; 358 | echo $output; 359 | $textarea_name = esc_attr( $option_name . '[' . $value['id'] . ']' ); 360 | $default_editor_settings = array( 361 | 'textarea_name' => $textarea_name, 362 | 'media_buttons' => false, 363 | 'tinymce' => array( 'plugins' => 'wordpress' ) 364 | ); 365 | $editor_settings = array(); 366 | if ( isset( $value['settings'] ) ) { 367 | $editor_settings = $value['settings']; 368 | } 369 | $editor_settings = array_merge( $default_editor_settings, $editor_settings ); 370 | wp_editor( $val, $value['id'], $editor_settings ); 371 | $output = ''; 372 | break; 373 | 374 | // Info 375 | case "info": 376 | $id = ''; 377 | $class = 'section'; 378 | if ( isset( $value['id'] ) ) { 379 | $id = 'id="' . esc_attr( $value['id'] ) . '" '; 380 | } 381 | if ( isset( $value['type'] ) ) { 382 | $class .= ' section-' . $value['type']; 383 | } 384 | if ( isset( $value['class'] ) ) { 385 | $class .= ' ' . $value['class']; 386 | } 387 | 388 | $output .= '
' . "\n"; 389 | if ( isset($value['name']) ) { 390 | $output .= '

' . esc_html( $value['name'] ) . '

' . "\n"; 391 | } 392 | if ( $value['desc'] ) { 393 | $output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n"; 394 | } 395 | $output .= '
' . "\n"; 396 | break; 397 | 398 | // Heading for Navigation 399 | case "heading": 400 | $counter++; 401 | if ($counter >= 2) { 402 | $output .= '
'."\n"; 403 | } 404 | $class = ''; 405 | $class = ! empty( $value['id'] ) ? $value['id'] : $value['name']; 406 | $class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class) ); 407 | $output .= '
'; 408 | $output .= '

' . esc_html( $value['name'] ) . '

' . "\n"; 409 | break; 410 | } 411 | 412 | if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) { 413 | $output .= '
'; 414 | if ( ( $value['type'] != "checkbox" ) && ( $value['type'] != "editor" ) ) { 415 | $output .= '
' . wp_kses( $explain_value, $allowedtags ) . '
'."\n"; 416 | } 417 | $output .= '
'."\n"; 418 | } 419 | 420 | echo $output; 421 | } 422 | echo '
'; 423 | } -------------------------------------------------------------------------------- /inc/options-media-uploader.php: -------------------------------------------------------------------------------- 1 | ' . "\n"; 52 | if ( function_exists( 'wp_enqueue_media' ) ) { 53 | if ( ( $value == '' ) ) { 54 | $output .= '' . "\n"; 55 | } else { 56 | $output .= '' . "\n"; 57 | } 58 | } else { 59 | $output .= '

' . __( 'Upgrade your version of WordPress for full media support.', 'options_framework_theme' ) . '

'; 60 | } 61 | 62 | if ( $_desc != '' ) { 63 | $output .= '' . $_desc . '' . "\n"; 64 | } 65 | 66 | $output .= '
' . "\n"; 67 | 68 | if ( $value != '' ) { 69 | $remove = 'Remove'; 70 | $image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value ); 71 | if ( $image ) { 72 | $output .= ''.$remove.''; 73 | } else { 74 | $parts = explode( "/", $value ); 75 | for( $i = 0; $i < sizeof( $parts ); ++$i ) { 76 | $title = $parts[$i]; 77 | } 78 | 79 | // No output preview if it's not an image. 80 | $output .= ''; 81 | 82 | // Standard generic output if it's not an image. 83 | $title = __( 'View File', 'options_framework_theme' ); 84 | $output .= ''; 85 | } 86 | } 87 | $output .= '
' . "\n"; 88 | return $output; 89 | } 90 | 91 | endif; 92 | 93 | /** 94 | * Enqueue scripts for file uploader 95 | */ 96 | 97 | if ( ! function_exists( 'optionsframework_media_scripts' ) ) : 98 | 99 | add_action( 'admin_enqueue_scripts', 'optionsframework_media_scripts' ); 100 | 101 | function optionsframework_media_scripts( $hook ) { 102 | 103 | $menu = optionsframework_menu_settings(); 104 | 105 | if ( 'appearance_page_' . $menu['menu_slug'] != $hook ) 106 | return; 107 | 108 | if ( function_exists( 'wp_enqueue_media' ) ) 109 | wp_enqueue_media(); 110 | wp_register_script( 'of-media-uploader', OPTIONS_FRAMEWORK_DIRECTORY .'js/media-uploader.js', array( 'jquery' ) ); 111 | wp_enqueue_script( 'of-media-uploader' ); 112 | wp_localize_script( 'of-media-uploader', 'optionsframework_l10n', array( 113 | 'upload' => __( '上传', 'options_framework_theme' ), 114 | 'remove' => __( '移除', 'options_framework_theme' ) 115 | ) ); 116 | } 117 | 118 | endif; 119 | -------------------------------------------------------------------------------- /inc/options-sanitize.php: -------------------------------------------------------------------------------- 1 | $value ) { 26 | $output[$key] = "0"; 27 | } 28 | foreach( $input as $key => $value ) { 29 | if ( array_key_exists( $key, $option['options'] ) && $value ) { 30 | $output[$key] = "1"; 31 | } 32 | } 33 | } 34 | return $output; 35 | } 36 | add_filter( 'of_sanitize_multicheck', 'of_sanitize_multicheck', 10, 2 ); 37 | add_filter( 'of_sanitize_color', 'of_sanitize_hex' ); 38 | function of_sanitize_upload( $input ) { 39 | $output = ''; 40 | $filetype = wp_check_filetype($input); 41 | if ( $filetype["ext"] ) { 42 | $output = $input; 43 | } 44 | return $output; 45 | } 46 | add_filter( 'of_sanitize_upload', 'of_sanitize_upload' ); 47 | function of_sanitize_editor($input) { 48 | if ( current_user_can( 'unfiltered_html' ) ) { 49 | $output = $input; 50 | } 51 | else { 52 | global $allowedtags; 53 | $output = wpautop(wp_kses( $input, $allowedtags)); 54 | } 55 | return $output; 56 | } 57 | add_filter( 'of_sanitize_editor', 'of_sanitize_editor' ); 58 | function of_sanitize_allowedtags($input) { 59 | global $allowedtags; 60 | $output = wpautop(wp_kses( $input, $allowedtags)); 61 | return $output; 62 | } 63 | function of_sanitize_allowedposttags($input) { 64 | global $allowedposttags; 65 | $output = wpautop(wp_kses( $input, $allowedposttags)); 66 | return $output; 67 | } 68 | 69 | add_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' ); 70 | function of_sanitize_enum( $input, $option ) { 71 | $output = ''; 72 | if ( array_key_exists( $input, $option['options'] ) ) { 73 | $output = $input; 74 | } 75 | return $output; 76 | } 77 | function of_sanitize_background( $input ) { 78 | $output = wp_parse_args( $input, array( 79 | 'color' => '', 80 | 'image' => '', 81 | 'repeat' => 'repeat', 82 | 'position' => 'top center', 83 | 'attachment' => 'scroll' 84 | ) ); 85 | 86 | $output['color'] = apply_filters( 'of_sanitize_hex', $input['color'] ); 87 | $output['image'] = apply_filters( 'of_sanitize_upload', $input['image'] ); 88 | $output['repeat'] = apply_filters( 'of_background_repeat', $input['repeat'] ); 89 | $output['position'] = apply_filters( 'of_background_position', $input['position'] ); 90 | $output['attachment'] = apply_filters( 'of_background_attachment', $input['attachment'] ); 91 | 92 | return $output; 93 | } 94 | add_filter( 'of_sanitize_background', 'of_sanitize_background' ); 95 | function of_sanitize_background_repeat( $value ) { 96 | $recognized = of_recognized_background_repeat(); 97 | if ( array_key_exists( $value, $recognized ) ) { 98 | return $value; 99 | } 100 | return apply_filters( 'of_default_background_repeat', current( $recognized ) ); 101 | } 102 | add_filter( 'of_background_repeat', 'of_sanitize_background_repeat' ); 103 | 104 | function of_sanitize_background_position( $value ) { 105 | $recognized = of_recognized_background_position(); 106 | if ( array_key_exists( $value, $recognized ) ) { 107 | return $value; 108 | } 109 | return apply_filters( 'of_default_background_position', current( $recognized ) ); 110 | } 111 | add_filter( 'of_background_position', 'of_sanitize_background_position' ); 112 | 113 | function of_sanitize_background_attachment( $value ) { 114 | $recognized = of_recognized_background_attachment(); 115 | if ( array_key_exists( $value, $recognized ) ) { 116 | return $value; 117 | } 118 | return apply_filters( 'of_default_background_attachment', current( $recognized ) ); 119 | } 120 | add_filter( 'of_background_attachment', 'of_sanitize_background_attachment' ); 121 | function of_sanitize_typography( $input, $option ) { 122 | 123 | $output = wp_parse_args( $input, array( 124 | 'size' => '', 125 | 'face' => '', 126 | 'style' => '', 127 | 'color' => '' 128 | ) ); 129 | 130 | if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) { 131 | if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) { 132 | $output['face'] = ''; 133 | } 134 | } 135 | else { 136 | $output['face'] = apply_filters( 'of_font_face', $output['face'] ); 137 | } 138 | 139 | $output['size'] = apply_filters( 'of_font_size', $output['size'] ); 140 | $output['style'] = apply_filters( 'of_font_style', $output['style'] ); 141 | $output['color'] = apply_filters( 'of_sanitize_color', $output['color'] ); 142 | return $output; 143 | } 144 | add_filter( 'of_sanitize_typography', 'of_sanitize_typography', 10, 2 ); 145 | function of_sanitize_font_size( $value ) { 146 | $recognized = of_recognized_font_sizes(); 147 | $value_check = preg_replace('/px/','', $value); 148 | if ( in_array( (int) $value_check, $recognized ) ) { 149 | return $value; 150 | } 151 | return apply_filters( 'of_default_font_size', $recognized ); 152 | } 153 | add_filter( 'of_font_size', 'of_sanitize_font_size' ); 154 | function of_sanitize_font_style( $value ) { 155 | $recognized = of_recognized_font_styles(); 156 | if ( array_key_exists( $value, $recognized ) ) { 157 | return $value; 158 | } 159 | return apply_filters( 'of_default_font_style', current( $recognized ) ); 160 | } 161 | add_filter( 'of_font_style', 'of_sanitize_font_style' ); 162 | function of_sanitize_font_face( $value ) { 163 | $recognized = of_recognized_font_faces(); 164 | if ( array_key_exists( $value, $recognized ) ) { 165 | return $value; 166 | } 167 | return apply_filters( 'of_default_font_face', current( $recognized ) ); 168 | } 169 | add_filter( 'of_font_face', 'of_sanitize_font_face' ); 170 | function of_recognized_background_repeat() { 171 | $default = array( 172 | 'no-repeat' =>'不重复填充', 173 | 'repeat-x' =>'水平重复填充', 174 | 'repeat-y' =>'垂直重复填充', 175 | 'repeat' =>'重复填充' 176 | ); 177 | return apply_filters( 'of_recognized_background_repeat', $default ); 178 | } 179 | function of_recognized_background_position() { 180 | $default = array( 181 | 'top left' =>'上左对齐', 182 | 'top center' =>'上中对齐', 183 | 'top right' =>'上右对齐', 184 | 'center left' =>'中左对齐', 185 | 'center center' =>'中中对齐', 186 | 'center right' =>'中右对齐', 187 | 'bottom left' =>'下左对齐', 188 | 'bottom center' =>'下中对齐', 189 | 'bottom right' =>'下右对齐' 190 | ); 191 | return apply_filters( 'of_recognized_background_position', $default ); 192 | } 193 | function of_recognized_background_attachment() { 194 | $default = array( 195 | 'scroll' =>'固定', 196 | 'fixed' => '滚动' 197 | ); 198 | return apply_filters( 'of_recognized_background_attachment', $default ); 199 | } 200 | function of_sanitize_hex( $hex, $default = '' ) { 201 | if ( of_validate_hex( $hex ) ) { 202 | return $hex; 203 | } 204 | return $default; 205 | } 206 | function of_recognized_font_sizes() { 207 | $sizes = range( 12,24,2); 208 | $sizes = apply_filters( 'of_recognized_font_sizes', $sizes ); 209 | $sizes = array_map( 'absint', $sizes ); 210 | return $sizes; 211 | } 212 | function of_recognized_font_faces() { 213 | $default = array( 214 | 'arial' => 'Arial', 215 | 'verdana' => 'Verdana, Geneva', 216 | 'trebuchet' => 'Trebuchet', 217 | 'georgia' => 'Georgia', 218 | 'times' => 'Times New Roman', 219 | 'tahoma' => 'Tahoma, Geneva', 220 | 'palatino' => 'Palatino', 221 | 'helvetica' => 'Helvetica*' 222 | ); 223 | return apply_filters( 'of_recognized_font_faces', $default ); 224 | } 225 | function of_recognized_font_styles() { 226 | $default = array( 227 | 'normal' => '普通', 228 | 'italic' => '斜体', 229 | 'bold' => '粗体', 230 | 'bold italic' => '斜体+粗体' 231 | ); 232 | return apply_filters( 'of_recognized_font_styles', $default ); 233 | } 234 | function of_validate_hex( $hex ) { 235 | $hex = trim( $hex ); 236 | if ( 0 === strpos( $hex, '#' ) ) { 237 | $hex = substr( $hex, 1 ); 238 | } 239 | elseif ( 0 === strpos( $hex, '%23' ) ) { 240 | $hex = substr( $hex, 3 ); 241 | } 242 | if ( 0 === preg_match( '/^[0-9a-fA-F]{6}$/', $hex ) ) { 243 | return false; 244 | } 245 | else { 246 | return true; 247 | } 248 | } -------------------------------------------------------------------------------- /inc/template-tags.php: -------------------------------------------------------------------------------- 1 | %2$s'; 16 | if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 17 | $time_string = ''; 18 | } 19 | 20 | $time_string = sprintf( $time_string, 21 | esc_attr( get_the_date( 'c' ) ), 22 | esc_html( get_the_date() ), 23 | esc_attr( get_the_modified_date( 'c' ) ), 24 | esc_html( get_the_modified_date() ) 25 | ); 26 | 27 | $posted_on = sprintf( 28 | esc_html_x( 'Posted on %s', 'post date', 'akina' ), 29 | '' . $time_string . '' 30 | ); 31 | 32 | $byline = sprintf( 33 | esc_html_x( 'by %s', 'post author', 'akina' ), 34 | '' . esc_html( get_the_author() ) . '' 35 | ); 36 | 37 | echo '' . $posted_on . ''; // WPCS: XSS OK. 38 | 39 | } 40 | endif; 41 | 42 | if ( ! function_exists( 'akina_entry_footer' ) ) : 43 | /** 44 | * Prints HTML with meta information for the categories, tags and comments. 45 | */ 46 | function akina_entry_footer() { 47 | // Hide category and tag text for pages. 48 | if ( 'post' === get_post_type() ) { 49 | /* translators: used between list items, there is a space after the comma */ 50 | $categories_list = get_the_category_list( esc_html__( ', ', 'akina' ) ); 51 | if ( $categories_list && akina_categorized_blog() ) { 52 | printf( '' . esc_html__( 'Posted in %1$s', 'akina' ) . '', $categories_list ); // WPCS: XSS OK. 53 | } 54 | 55 | /* translators: used between list items, there is a space after the comma */ 56 | $tags_list = get_the_tag_list( '', esc_html__( ', ', 'akina' ) ); 57 | if ( $tags_list ) { 58 | printf( '' . esc_html__( 'Tagged %1$s', 'akina' ) . '', $tags_list ); // WPCS: XSS OK. 59 | } 60 | } 61 | 62 | if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 63 | echo ''; 64 | /* translators: %s: post title */ 65 | comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'akina' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) ); 66 | echo ''; 67 | } 68 | 69 | edit_post_link( 70 | sprintf( 71 | /* translators: %s: Name of current post */ 72 | esc_html__( 'Edit %s', 'akina' ), 73 | the_title( '"', '"', false ) 74 | ), 75 | '', 76 | '' 77 | ); 78 | } 79 | endif; 80 | 81 | /** 82 | * Returns true if a blog has more than 1 category. 83 | * 84 | * @return bool 85 | */ 86 | function akina_categorized_blog() { 87 | if ( false === ( $all_the_cool_cats = get_transient( 'akina_categories' ) ) ) { 88 | // Create an array of all the categories that are attached to posts. 89 | $all_the_cool_cats = get_categories( array( 90 | 'fields' => 'ids', 91 | 'hide_empty' => 1, 92 | // We only need to know if there is more than one category. 93 | 'number' => 2, 94 | ) ); 95 | 96 | // Count the number of categories that are attached to the posts. 97 | $all_the_cool_cats = count( $all_the_cool_cats ); 98 | 99 | set_transient( 'akina_categories', $all_the_cool_cats ); 100 | } 101 | 102 | if ( $all_the_cool_cats > 1 ) { 103 | // This blog has more than 1 category so akina_categorized_blog should return true. 104 | return true; 105 | } else { 106 | // This blog has only 1 category so akina_categorized_blog should return false. 107 | return false; 108 | } 109 | } 110 | 111 | /** 112 | * Flush out the transients used in akina_categorized_blog. 113 | */ 114 | function akina_category_transient_flusher() { 115 | if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { 116 | return; 117 | } 118 | // Like, beat it. Dig? 119 | delete_transient( 'akina_categories' ); 120 | } 121 | add_action( 'edit_category', 'akina_category_transient_flusher' ); 122 | add_action( 'save_post', 'akina_category_transient_flusher' ); 123 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 |
21 | 22 | 142 && !wp_is_mobile()){ ?> 23 | 24 |
25 |
26 | 27 |
28 | 29 |
30 | 31 | 32 | 37 | 38 |
39 |
40 |

Posts

41 | 45 |
46 |

47 |
48 | 49 | 60 | 61 |
62 | 63 | 64 | 65 | 68 | 69 |
70 | 0.5?-1:1);var r=o*(Math.random()>0.5?-1:1);document.body.style.marginLeft=q+"px";document.body.style.marginTop=r+"px";setTimeout(function(){document.body.style.marginLeft="";document.body.style.marginTop=""},75)}}m.colorful=false;function i(){requestAnimationFrame(i);c.clearRect(0,0,b.width,b.height);for(var n=0;nparseInt(f.height)){o.overflowY="scroll"}}else{o.overflow="hidden"}i.textContent=k.value.substring(0,m);if(k.nodeName==="INPUT"){i.textContent=i.textContent.replace(/\s/g,"\u00a0")}var n=document.createElement("span");n.textContent=k.value.substring(m)||".";i.appendChild(n);var g={top:n.offsetTop+parseInt(f.borderTopWidth),left:n.offsetLeft+parseInt(f.borderLeftWidth)};if(h){n.style.backgroundColor="#aaa"}else{document.body.removeChild(i)}return g}if(typeof b!="undefined"&&typeof b.exports!="undefined"){b.exports=c}else{window.getCaretCoordinates=c}}())}])}); -------------------------------------------------------------------------------- /js/login.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Resize Image 3 | */ 4 | function resizeImage(id) { 5 | jQuery('#' + id).css({ 6 | 'position': 'absolute', 7 | 'top': '0px', 8 | 'left': '0px', 9 | 'width': '100%', 10 | 'height': '100%', 11 | 'z-index': -1, 12 | 'overflow': 'hidden' 13 | }); 14 | var w = jQuery(window).width(), 15 | h = jQuery(window).height(), 16 | o = jQuery('#' + id).children('img'), 17 | iW = o.width(), 18 | iH = o.height(); 19 | o.css({ 20 | 'display': 'block', 21 | 'opacity': 0 22 | }); 23 | if (w > h) { 24 | if (iW > iH) { 25 | o.css({ 26 | 'width': w 27 | }); 28 | o.css({ 29 | 'height': Math.round((iH / iW) * w) 30 | }); 31 | var newIh = Math.round((iH / iW) * w); 32 | if (newIh < h) { 33 | o.css({ 34 | 'height': h 35 | }); 36 | o.css({ 37 | 'width': Math.round((iW / iH) * h) 38 | }) 39 | } 40 | } else { 41 | o.css({ 42 | 'height': h 43 | }); 44 | o.css({ 45 | 'width': Math.round((iW / iH) * h) 46 | }) 47 | } 48 | } else { 49 | o.css({ 50 | 'height': h 51 | }); 52 | o.css({ 53 | 'width': Math.round((iW / iH) * h) 54 | }) 55 | } 56 | var newIW = o.width(), 57 | newIH = o.height(); 58 | if (newIW > w) { 59 | var l = (newIW - w) / 2; 60 | o.css('margin-left', -l) 61 | } else { 62 | o.css('margin-left', 0) 63 | } 64 | if (newIH > h) { 65 | var t = (newIH - h) / 2; 66 | o.css('margin-top', -t) 67 | } else { 68 | o.css('margin-top', 0) 69 | } 70 | o.css({ 71 | 'opacity': '1' 72 | }) 73 | } -------------------------------------------------------------------------------- /layouts/authorprofile.php: -------------------------------------------------------------------------------- 1 | 7 |
8 | 17 |
18 |

19 |
20 | 21 | -------------------------------------------------------------------------------- /layouts/duoshuo.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 |
18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /layouts/feature.php: -------------------------------------------------------------------------------- 1 | 8 |
9 |

10 |
11 |
  • 12 |
    13 |
  • 14 |
  • 15 |
    16 |
  • 17 |
  • 18 |
    19 |
  • 20 |
    21 |
    -------------------------------------------------------------------------------- /layouts/imgbox.php: -------------------------------------------------------------------------------- 1 | 5 |
    6 | 7 |
    8 | 9 |
    10 | 11 |
    12 | 13 |

    14 |
    15 | 16 |
  • 17 |
    18 | 微信公众号 19 |
    20 |
  • 21 | 22 | 23 |
  • 24 | 25 | 26 |
  • 27 | 28 | 29 |
  • 30 | 31 | 32 |
  • 33 | 34 | 35 |
  • 36 | 37 | 38 |
  • 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 | 9 |
    10 | Previous Post

    %title


    ') ?> 12 |
    13 | Next Post

    %title


    ') ?> 15 |
    16 |
    17 | -------------------------------------------------------------------------------- /layouts/sharelike.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 |
    11 | 12 | 13 | 18 | 19 |
    20 | 21 | 22 |
    23 | 29 | 30 |
    31 | -------------------------------------------------------------------------------- /page-archive.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 |
    > 14 | 15 |
    16 | 17 |

    18 | 19 |
    20 | have_posts() ) : $the_query->the_post(); 26 | $year_tmp = get_the_time('Y'); 27 | $mon_tmp = get_the_time('n'); 28 | $y=$year; $m=$mon; 29 | if ($mon != $mon_tmp && $mon > 0) $output .= '
    '; 30 | if ($year != $year_tmp) { // 输出年份 31 | $year = $year_tmp; 32 | $all[$year] = array(); 33 | } 34 | if ($mon != $mon_tmp) { // 输出月份 35 | $mon = $mon_tmp; 36 | array_push($all[$year], $mon); 37 | $output .= "

    $year-$mon

    "; 38 | } 39 | $output .= '
    '; 40 | endwhile; 41 | wp_reset_postdata(); 42 | $output .= '
    '; 43 | echo $output; 44 | ?> 45 |
    46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /page-links.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 |
    > 15 | 16 | 19 |
    20 | 21 | 16 | 17 |
    18 |
    19 | 20 | 27 | 28 |
    29 |
    30 | 31 | 11 | 12 |
    13 |
    14 | 15 | 17 | 18 | 21 | 22 | 38 | 46 | 50 | 51 |
    52 |
    53 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 11 |
    12 |
    13 | 20 |
    21 |
    22 | 11 | 12 |
    13 |
    14 |
    15 |
    16 | 17 | 18 | 19 | 20 | 21 |
    22 | 23 |
    24 |

    25 |
    26 | post_date_gmt));//the_time('Y-m-d');?> 27 |
    28 |
    29 |
    30 | 31 |
    32 |
    33 | 34 |
    35 |
    36 | 37 |
    38 | 39 |
    40 |
    41 | 42 |
    43 | -------------------------------------------------------------------------------- /tpl/content-image.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    13 |
    14 |
    15 | 16 |
    17 | 18 |
    19 | 20 |
    21 |

    22 |
    23 | 24 | 25 | 26 | post_date_gmt));//the_time('Y-m-d');?> 27 |
    28 |

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

    29 |
    30 |
    31 | 32 |
    33 |
    34 |
    35 | 36 |
    37 |
    38 | 热度 39 |
    40 |
    41 |
    42 |
    43 |
    44 |
    45 | 46 | -------------------------------------------------------------------------------- /tpl/content-none.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    13 | 16 | 17 |
    18 | 20 | 21 |

    点击这里开始.', 'akina' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

    22 | 23 | 24 |
    25 |

    26 |
    27 |
      28 | get_results("SELECT ID,post_title FROM $wpdb->posts where post_status='publish' and post_type='post' ORDER BY ID DESC LIMIT 0 , 20"); 30 | foreach ($result as $post) { 31 | setup_postdata($post); 32 | $postid = $post->ID; 33 | $title = $post->post_title; 34 | ?> 35 |
    • 36 | 37 |
    38 |
    39 |
    40 | 41 | 42 | 43 |

    44 | 47 |
    48 |
    49 | -------------------------------------------------------------------------------- /tpl/content-page.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    > 13 | 14 |
    15 | ', '' ); ?> 16 |
    17 | 18 |
    19 | '', 25 | ) ); 26 | ?> 27 |
    28 | 29 |
    30 | "', '"', false ) 36 | ), 37 | '', 38 | '' 39 | ); 40 | ?> 41 |
    42 |
    43 | -------------------------------------------------------------------------------- /tpl/content-search.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    > 13 |
    14 | ', esc_url( get_permalink() ) ), '' ); ?> 15 | 16 | 17 | 20 | 21 |
    22 | 23 |
    24 | 25 |
    26 | 27 |
    28 | 29 |
    30 |
    31 | -------------------------------------------------------------------------------- /tpl/content-single.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    > 13 | 14 |
    15 |

    16 |

    post_date_gmt)); ?>   次阅读

    17 |
    18 |
    19 | 20 |
    21 | 22 | '', 26 | ) ); 27 | ?> 28 |
    29 | 30 | 37 |
    38 | -------------------------------------------------------------------------------- /tpl/content-status.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    13 |
    14 |
    15 | 16 | <?php the_author(); ?> 17 | 18 |
    19 |
    20 |

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

    21 |
    22 | 23 | 24 | 25 | post_date_gmt));//the_time('Y-m-d');?> 26 |
    27 |
    28 |
    29 |
    30 |
    31 | 32 |
    33 |
    34 | 热度 35 |
    36 |
    37 |
    38 |
    39 |
    40 |
    41 | 42 | -------------------------------------------------------------------------------- /tpl/content-thumb.php: -------------------------------------------------------------------------------- 1 | ID), 'large'); 14 | $post_img = $large_image_url[0]; 15 | }else{ 16 | $post_img = get_bloginfo('template_url') . '/images/temp.jpg'; 17 | } 18 | $the_cat = get_the_category(); 19 | ?> 20 |
    21 |
    22 | 23 |
    24 |
    25 |
    26 | 32 |

    33 | 39 |
    40 | 41 |
    42 | 43 |
    44 |
    45 |
    46 |
    47 |
    48 | 11 |
    12 |
    13 |
    14 | 15 |
    16 | 17 |
    18 | 19 |
    20 |

    21 |
    22 | 23 | 24 | 25 | post_date_gmt)); ?> 26 |
    27 | 28 |
    29 |
    30 | 31 |
    32 |
    33 |
    34 | 35 |
    36 |
    37 | 热度 38 |
    39 |
    40 |
    41 |
    42 |
    43 |
    -------------------------------------------------------------------------------- /tpl/single-image.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
    > 13 | 14 |
    15 | 16 |
    17 |

    18 |

    post_date_gmt)); ?>   次阅读

    19 |
    20 |
    21 |
    22 | 23 | 24 |
    25 | 26 | '', 30 | ) ); 31 | ?> 32 |
    33 | 34 |
    35 | 38 | 39 |
    40 |
    41 | -------------------------------------------------------------------------------- /user/page-login.php: -------------------------------------------------------------------------------- 1 | 8 |
    9 |
    10 | 11 | 23 | 24 |
    25 |
    26 | 错误:请输入用户名。
    '; 15 | } elseif ( ! validate_username( $sanitized_user_login ) ) { 16 | $error .= '错误:此用户名包含无效字符,请输入有效的用户名。
    '; 17 | $sanitized_user_login = ''; 18 | } elseif ( username_exists( $sanitized_user_login ) ) { 19 | $error .= '错误:该用户名已被注册。
    '; 20 | } 21 | 22 | // Check the e-mail address 23 | if ( $user_email == '' ) { 24 | $error .= '错误:请填写电子邮件地址。
    '; 25 | } elseif ( ! is_email( $user_email ) ) { 26 | $error .= '错误:电子邮件地址不正确。
    '; 27 | $user_email = ''; 28 | } elseif ( email_exists( $user_email ) ) { 29 | $error .= '错误:该电子邮件地址已经被注册。
    '; 30 | } 31 | 32 | // Check the password 33 | if(strlen($_POST['user_pass']) < 6){ 34 | $error .= '错误:密码长度至少6位。
    '; 35 | }elseif($_POST['user_pass'] != $_POST['user_pass2']){ 36 | $error .= '错误:两次输入的密码不一致。
    '; 37 | } 38 | 39 | // verification 40 | if(akina_option('login_validate') && strlen($_POST['verification']) > 0 ){ 41 | $error .= '错误:请拖动滑块验证身份
    '; 42 | } 43 | 44 | if($error == '') { 45 | $user_id = wp_create_user( $sanitized_user_login, $_POST['user_pass'], $user_email ); 46 | if ( !$user_id ) { 47 | $error .= sprintf( '错误:无法完成注册请求... 请联系管理员
    ', get_option( 'admin_email' ) ); 48 | }else if (!is_user_logged_in()) { 49 | $user = get_userdatabylogin($sanitized_user_login); 50 | $user_id = $user->ID; 51 | // 自动登录 52 | wp_set_current_user($user_id, $user_login); 53 | wp_set_auth_cookie($user_id); 54 | do_action('wp_login', $user_login); 55 | } 56 | } 57 | } 58 | ?> 59 |
    60 |
    61 | 62 | 63 |
    64 |
    65 |

    New Account

    66 |
    67 |
    " method="post"> 68 |

    69 |

    70 |

    71 |

    72 | 73 |
    74 |
    75 |
    76 | »拖动滑块验证 77 |
    78 | 79 |
    80 | 81 | 82 | '.$error.'

    '; } ?> 83 | 84 |
    85 |
    86 | 89 | 90 | 91 | 92 |

    暂未开放注册。

    93 | 94 |
    95 |
    96 | 157 | 158 | 161 | 197 | -------------------------------------------------------------------------------- /user/verification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery plugin -- jquery.slideunlock.js 3 | * www.sucaijiayuan.com 4 | * created: March 27, 2016 5 | */ 6 | 7 | ;(function ($,window,document,undefined) { 8 | function SliderUnlock(elm, options, success){ 9 | var me = this; 10 | var $elm = me.checkElm(elm) ? $(elm) : $; 11 | success = me.checkFn(success) ? success : function(){}; 12 | 13 | var opts = { 14 | successLabelTip: "Successfully Verified", 15 | duration: 200, 16 | swipestart: false, 17 | min: 0, 18 | max: $elm.width(), 19 | index: 0, 20 | IsOk: false, 21 | lableIndex: 0 22 | }; 23 | 24 | opts = $.extend(opts, options||{}); 25 | 26 | //$elm 27 | me.elm = $elm; 28 | //opts 29 | me.opts = opts; 30 | //是否开始滑动 31 | me.swipestart = opts.swipestart; 32 | //最小值 33 | me.min = opts.min; 34 | //最大值 35 | me.max = opts.max; 36 | //当前滑动条所处的位置 37 | me.index = opts.index; 38 | //是否滑动成功 39 | me.isOk = opts.isOk; 40 | //滑块宽度 41 | me.labelWidth = me.elm.find('#label').width(); 42 | //滑块背景 43 | me.sliderBg = me.elm.find('#slider_bg'); 44 | //鼠标在滑动按钮的位置 45 | me.lableIndex = opts.lableIndex; 46 | //success 47 | me.success = success; 48 | } 49 | 50 | SliderUnlock.prototype.init = function () { 51 | var me = this; 52 | 53 | me.updateView(); 54 | me.elm.find("#label").on("mousedown", function (event) { 55 | var e = event || window.event; 56 | me.lableIndex = e.clientX - this.offsetLeft; 57 | me.handerIn(); 58 | }).on("mousemove", function (event) { 59 | me.handerMove(event); 60 | }).on("mouseup", function (event) { 61 | me.handerOut(); 62 | }).on("mouseout", function (event) { 63 | me.handerOut(); 64 | }).on("touchstart", function (event) { 65 | var e = event || window.event; 66 | me.lableIndex = e.originalEvent.touches[0].pageX - this.offsetLeft; 67 | me.handerIn(); 68 | }).on("touchmove", function (event) { 69 | me.handerMove(event, "mobile"); 70 | }).on("touchend", function (event) { 71 | me.handerOut(); 72 | }); 73 | }; 74 | 75 | /** 76 | * 鼠标/手指接触滑动按钮 77 | */ 78 | SliderUnlock.prototype.handerIn = function () { 79 | var me = this; 80 | me.swipestart = true; 81 | 82 | var myDate = new Date(); 83 | var H = myDate.getHours();//获取小时 84 | var M = myDate.getMinutes(); //获取分钟 85 | var S = myDate.getSeconds();//获取秒 86 | var MS = myDate.getMilliseconds();//获取毫秒 87 | var milliSeconds = H * 3600 * 1000 + M * 60 * 1000 + S * 1000 + MS; 88 | 89 | startTime = milliSeconds; 90 | 91 | 92 | me.min = 0; 93 | me.max = me.elm.width(); 94 | }; 95 | 96 | /** 97 | * 鼠标/手指移出 98 | */ 99 | SliderUnlock.prototype.handerOut = function () { 100 | var me = this; 101 | //停止 102 | me.swipestart = false; 103 | 104 | weizhi = me.labelWidth; 105 | 106 | //me.move(); 107 | if (me.index < me.max) { 108 | me.reset(); 109 | } 110 | }; 111 | 112 | /** 113 | * 鼠标/手指移动 114 | * @param event 115 | * @param type 116 | */ 117 | SliderUnlock.prototype.handerMove = function (event, type) { 118 | var me = this; 119 | if (me.swipestart) { 120 | event.preventDefault(); 121 | event = event || window.event; 122 | if (type == "mobile") { 123 | me.index = event.originalEvent.touches[0].pageX - me.lableIndex; 124 | } else { 125 | me.index = event.clientX - me.lableIndex; 126 | } 127 | me.move(); 128 | } 129 | }; 130 | 131 | /** 132 | * 鼠标/手指移动过程 133 | */ 134 | SliderUnlock.prototype.move = function () { 135 | var me = this; 136 | if ((me.index + me.labelWidth) >= me.max) { 137 | me.index = me.max - me.labelWidth -2; 138 | //停止 139 | me.swipestart = false; 140 | //解锁 141 | me.isOk = true; 142 | } 143 | if (me.index < 0) { 144 | me.index = me.min; 145 | //未解锁 146 | me.isOk = false; 147 | } 148 | if (me.index+me.labelWidth+2 == me.max && me.max > 0 && me.isOk) { 149 | //解锁默认操作 150 | $('#label').unbind().next('#labelTip'). 151 | text(me.opts.successLabelTip).css({'color': '#fff'}); 152 | 153 | me.success(); 154 | } 155 | me.updateView(); 156 | }; 157 | 158 | 159 | /** 160 | * 更新视图 161 | */ 162 | SliderUnlock.prototype.updateView = function () { 163 | var me = this; 164 | 165 | me.sliderBg.css('width', me.index); 166 | me.elm.find("#label").css("left", me.index + "px") 167 | }; 168 | 169 | /** 170 | * 重置slide的起点 171 | */ 172 | SliderUnlock.prototype.reset = function () { 173 | var me = this; 174 | 175 | startTime = 0; 176 | 177 | me.index = 0; 178 | me.sliderBg .animate({'width':0},me.opts.duration); 179 | me.elm.find("#label").animate({left: me.index}, me.opts.duration) 180 | .next("#lableTip").animate({opacity: 1}, me.opts.duration); 181 | me.updateView(); 182 | }; 183 | 184 | /** 185 | * 检测元素是否存在 186 | * @param elm 187 | * @returns {boolean} 188 | */ 189 | SliderUnlock.prototype.checkElm = function (elm) { 190 | if($(elm).length > 0){ 191 | return true; 192 | }else{ 193 | throw "this element does not exist."; 194 | } 195 | }; 196 | 197 | /** 198 | * 检测传入参数是否是function 199 | * @param fn 200 | * @returns {boolean} 201 | */ 202 | SliderUnlock.prototype.checkFn = function (fn) { 203 | if(typeof fn === "function"){ 204 | return true; 205 | }else{ 206 | throw "the param is not a function."; 207 | } 208 | }; 209 | 210 | 211 | window['SliderUnlock'] = SliderUnlock; 212 | })(jQuery, window, document); --------------------------------------------------------------------------------