├── 404.php ├── screenshot.png ├── languages └── zh_CN.mo ├── static ├── images │ ├── visitor.png │ └── default-pic.png ├── iconfont │ ├── iconfont.ttf │ ├── iconfont.woff │ ├── iconfont.woff2 │ ├── iconfont.css │ ├── iconfont.json │ └── demo.css ├── fonts │ ├── Poppins-Bold.woff2 │ ├── Poppins-Light.woff2 │ └── Poppins-Regular.woff2 ├── strawberry │ ├── fonts │ │ ├── StrawberryIcon-Free.eot │ │ ├── StrawberryIcon-Free.ttf │ │ └── StrawberryIcon-Free.woff │ ├── Read Me.txt │ └── variables.scss ├── css │ ├── footer.css │ ├── author.css │ ├── init.css │ ├── searchform.css │ ├── single.css │ ├── home.css │ ├── text.css │ ├── main.css │ └── header.css └── js │ ├── main.js │ └── headroom.min.js ├── admin ├── avatar │ ├── languages │ │ ├── zh_CN.mo │ │ ├── wp-user-profile-avatar.pot │ │ └── zh_CN.po │ ├── assets │ │ ├── images │ │ │ ├── wp-user-admin.png │ │ │ ├── wp-user-avatar.png │ │ │ ├── wp-user-medium.png │ │ │ ├── wp-user-original.png │ │ │ └── wp-user-thumbnail.png │ │ ├── css │ │ │ ├── backend.min.css │ │ │ ├── backend.css │ │ │ ├── frontend.min.css │ │ │ └── frontend.css │ │ └── js │ │ │ ├── frontend-avatar.min.js │ │ │ ├── admin-avatar.min.js │ │ │ ├── frontend-avatar.js │ │ │ └── admin-avatar.js │ ├── README.md │ ├── uninstall.php │ ├── templates │ │ ├── wp-user-avatar.php │ │ └── wp-avatar-upload.php │ ├── includes │ │ ├── wp-user-profile-avatar-install.php │ │ └── wp-user-profile-avatar-user.php │ ├── admin │ │ ├── templates │ │ │ └── shortcode-popup.php │ │ ├── wp-user-profile-avatar-settings.php │ │ └── wp-user-profile-avatar-admin.php │ ├── wp-user-profile-avatar.php │ └── shortcodes │ │ └── wp-user-profile-avatar-shortcodes.php └── option.php ├── style.css ├── inc ├── foot.php ├── time-prompt.php ├── head.php ├── pagination-ajax.php ├── recommend.php └── main.php ├── footer.php ├── search.php ├── category.php ├── index.php ├── searchform.php ├── README.md ├── author.php ├── LICENSE ├── single.php ├── functions └── remove-category.php ├── header.php └── functions.php /404.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/screenshot.png -------------------------------------------------------------------------------- /languages/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/languages/zh_CN.mo -------------------------------------------------------------------------------- /static/images/visitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/images/visitor.png -------------------------------------------------------------------------------- /static/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /static/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/iconfont/iconfont.woff -------------------------------------------------------------------------------- /static/images/default-pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/images/default-pic.png -------------------------------------------------------------------------------- /admin/avatar/languages/zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/languages/zh_CN.mo -------------------------------------------------------------------------------- /static/fonts/Poppins-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/fonts/Poppins-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/Poppins-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/fonts/Poppins-Light.woff2 -------------------------------------------------------------------------------- /static/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /static/fonts/Poppins-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/fonts/Poppins-Regular.woff2 -------------------------------------------------------------------------------- /admin/avatar/assets/images/wp-user-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/assets/images/wp-user-admin.png -------------------------------------------------------------------------------- /admin/avatar/assets/images/wp-user-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/assets/images/wp-user-avatar.png -------------------------------------------------------------------------------- /admin/avatar/assets/images/wp-user-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/assets/images/wp-user-medium.png -------------------------------------------------------------------------------- /admin/avatar/assets/images/wp-user-original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/assets/images/wp-user-original.png -------------------------------------------------------------------------------- /static/strawberry/fonts/StrawberryIcon-Free.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/strawberry/fonts/StrawberryIcon-Free.eot -------------------------------------------------------------------------------- /static/strawberry/fonts/StrawberryIcon-Free.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/strawberry/fonts/StrawberryIcon-Free.ttf -------------------------------------------------------------------------------- /admin/avatar/assets/images/wp-user-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/admin/avatar/assets/images/wp-user-thumbnail.png -------------------------------------------------------------------------------- /static/strawberry/fonts/StrawberryIcon-Free.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kannafay/iPop/HEAD/static/strawberry/fonts/StrawberryIcon-Free.woff -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: iPop 3 | Theme URI: https://ipop.onll.cn 4 | Author: 神秘布偶猫 5 | Author URI: https://www.ihcat.com 6 | Description: 高级感设计WordPress主题(Advanced design WordPress blog theme) 7 | Version: 0.1.1 8 | Tags: iPop, iPop主题 9 | */ -------------------------------------------------------------------------------- /admin/avatar/README.md: -------------------------------------------------------------------------------- 1 | # wp-user-profile-avatar 2 | WP User Profile Avatar allow you to change default WordPress avatar or User profile picture. You can use any photos uploaded into your Media Library or use custom photo url as an avatar instead of using Gravatar. 3 | 4 | 5 | -------------------------------------------------------------------------------- /inc/foot.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/strawberry/Read Me.txt: -------------------------------------------------------------------------------- 1 | 草莓图标 V2.0.0 (开源免费版本) 2 | http://chuangzaoshi.com/icon/ 3 | 4 | 使用文档 5 | https://github.com/xiangsudian/caomei 6 | 7 | License 8 | 草莓图标库中的字体遵循 SIL OFL 1.1 协议 9 | 草莓图标库中的 css 遵循 MIT 协议 10 | 草莓图标库中的文档遵循 CC BY 3.0 协议 11 | 12 | 品牌图标 13 | 草莓图标库中的所有品牌标志均为其各自所有者的商标。 请勿将品牌图标用于除了代表该品牌或服务之外的目的。如果侵犯你的权利,请联系我们hi@chuangzaoshi.com -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/css/footer.css: -------------------------------------------------------------------------------- 1 | .footer { 2 | margin-top: auto; 3 | } 4 | .footer .footer-box { 5 | padding: 30px 0; 6 | text-align: center; 7 | } 8 | .footer .footer-box > * { 9 | line-height: 2; 10 | } 11 | .footer .footer-box, 12 | .footer .footer-box a { 13 | color: var(--text-sub); 14 | transition: var(--tr3); 15 | } 16 | .footer .footer-box a:hover { 17 | color: var(--theme); 18 | } -------------------------------------------------------------------------------- /admin/avatar/uninstall.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 | <?php echo $content; ?> 10 | 11 |

12 |
-------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 11 | 12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /category.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
-
8 | 9 | 10 |
11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 | 8 |
9 | 10 | 11 |
12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /searchform.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /admin/avatar/includes/wp-user-profile-avatar-install.php: -------------------------------------------------------------------------------- 1 | The theme is inspired by foreign app design works. Thank their designers for their exquisite creation. A simple, elegant and fashionable wordpress blog theme. The theme is internationalized. It supports both Chinese and English, and the corresponding language can be set in the background. 6 | 7 | ## 演示网站 Demo Site 8 | 9 | [预览](https://ipop.onll.cn) 10 | 11 | > [Preview](https://ipop.onll.cn) 12 | 13 | ## 温馨提示 Warm Prompt 14 | 15 | 当前主题处于Beta版本,后续将开放更多功能! 16 | 17 | > The current theme is in beta version, more features will be updated in the future! 18 | 19 | 本项目支持MIT开源协议。 20 | 21 | > This project supports MIT open source protocol. -------------------------------------------------------------------------------- /author.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 |
9 | 16 |
17 |
18 | 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /static/css/author.css: -------------------------------------------------------------------------------- 1 | .author .author-box { 2 | width: 100%; 3 | height: auto; 4 | padding: 30px; 5 | background-color: var(--bgc-sub); 6 | border-radius: var(--radius); 7 | display: flex; 8 | } 9 | .author .author-box .avatar { 10 | width: 100px; 11 | height: 100px; 12 | border-radius: 50%; 13 | overflow: hidden; 14 | margin-right: 20px; 15 | } 16 | .author .author-box .avatar img { 17 | width: 100%; 18 | height: 100%; 19 | vertical-align: middle; 20 | } 21 | .author .author-box .user-info { 22 | width: calc(100% - 126px); 23 | display: flex; 24 | flex-direction: column; 25 | justify-content: center; 26 | } 27 | .author .author-box .user-info .top .name { 28 | font-size: 20px; 29 | font-weight: 700; 30 | color: var(--text); 31 | margin-bottom: 10px; 32 | } 33 | .author .author-box .user-info .top .description { 34 | font-size: 14px; 35 | font-weight: 300; 36 | color: var(--text-sub); 37 | word-break: break-all; 38 | word-wrap: break-word; 39 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 神秘布偶猫 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /inc/time-prompt.php: -------------------------------------------------------------------------------- 1 |

2 | 3 | -------------------------------------------------------------------------------- /static/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 3557637 */ 3 | src: url('iconfont.woff2?t=1661736282930') format('woff2'), 4 | url('iconfont.woff?t=1661736282930') format('woff'), 5 | url('iconfont.ttf?t=1661736282930') format('truetype'); 6 | } 7 | 8 | .iconfont { 9 | font-family: "iconfont" !important; 10 | font-size: 16px; 11 | font-style: normal; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | .icon-arrow-down:before { 17 | content: "\e666"; 18 | } 19 | 20 | .icon-arrow-right:before { 21 | content: "\e665"; 22 | } 23 | 24 | .icon-login1:before { 25 | content: "\e624"; 26 | } 27 | 28 | .icon-a-cloudyatnight:before { 29 | content: "\e754"; 30 | } 31 | 32 | .icon-moon:before { 33 | content: "\e758"; 34 | } 35 | 36 | .icon-a-partlycloudy_01:before { 37 | content: "\e759"; 38 | } 39 | 40 | .icon-sunny:before { 41 | content: "\e75b"; 42 | } 43 | 44 | .icon-sousuo1:before { 45 | content: "\e692"; 46 | } 47 | 48 | .icon-up-circle:before { 49 | content: "\e785"; 50 | } 51 | 52 | .icon-time-circle:before { 53 | content: "\e784"; 54 | } 55 | 56 | .icon-message:before { 57 | content: "\e78a"; 58 | } 59 | 60 | .icon-poweroff:before { 61 | content: "\e78c"; 62 | } 63 | 64 | .icon-setting:before { 65 | content: "\e78e"; 66 | } 67 | 68 | .icon-eye:before { 69 | content: "\e78f"; 70 | } 71 | 72 | .icon-right:before { 73 | content: "\e7eb"; 74 | } 75 | 76 | .icon-left:before { 77 | content: "\e7ec"; 78 | } 79 | 80 | .icon-doubleleft:before { 81 | content: "\e7ed"; 82 | } 83 | 84 | .icon-menu:before { 85 | content: "\e7f4"; 86 | } 87 | 88 | .icon-ellipsis:before { 89 | content: "\e7fc"; 90 | } 91 | 92 | -------------------------------------------------------------------------------- /static/css/init.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Ipop'; 3 | src: url('../fonts/Ipop-Light.woff2'); 4 | font-style: normal; 5 | font-weight: 300; 6 | } 7 | @font-face { 8 | font-family: 'Ipop'; 9 | src: url('../fonts/Ipop-Regular.woff2'); 10 | font-style: normal; 11 | font-weight: 400; 12 | } 13 | @font-face { 14 | font-family: 'Ipop'; 15 | src: url('../fonts/Ipop-Bold.woff2'); 16 | font-style: normal; 17 | font-weight: 700; 18 | } 19 | :root { 20 | --theme: #8183FF; 21 | --theme-sub: #A1A1F7; 22 | --theme-sub-text: #EDE9FE; 23 | --code: #8183FF1A; 24 | --text: #3D3D3D; 25 | --text-sub: #5D5D5D; 26 | --text-info: #999999; 27 | --text-box: #F5F5F5; 28 | --border: #EEEEEE; 29 | --danger: #FA5151; 30 | --bgc: #FFFFFF; 31 | --bgc-sub: #F5F5F5; 32 | --bgc-0: #FFFFFF00; 33 | --bgc-filter: rgba(255 255 255 / .8); 34 | --box: 0 0 10px rgba(0 0 0 / .1); 35 | --box-hover: 0 2px 8px rgb(28 31 35 / 3%), 0 16px 48px 8px rgb(28 31 35 / 12%); 36 | --radius-large: 20px; 37 | --radius: 10px; 38 | --radius-sub: 6px; 39 | --tr1: all .1s; 40 | --tr3: all .3s; 41 | --tr6: all .6s cubic-bezier(.28,.9,.34,.99); 42 | } 43 | * { 44 | margin: 0; 45 | padding: 0; 46 | box-sizing: border-box; 47 | font-family: 'Ipop'; 48 | -webkit-tap-highlight-color:rgba(0 0 0 / 0) ; 49 | } 50 | html, body { 51 | height: 100%; 52 | } 53 | .ipop-box { 54 | min-height: 100%; 55 | display: flex; 56 | flex-direction: column; 57 | } 58 | .container { 59 | width: 1200px; 60 | margin: 0 auto; 61 | } 62 | li { 63 | list-style: none; 64 | } 65 | a { 66 | text-decoration: none; 67 | } 68 | .icon { 69 | width: 1em; 70 | height: 1em; 71 | vertical-align: -0.15em; 72 | fill: currentColor; 73 | overflow: hidden; 74 | } -------------------------------------------------------------------------------- /admin/avatar/assets/css/backend.min.css: -------------------------------------------------------------------------------- 1 | #wp-user-profile-avatar-errors,#wp-user-profile-avatar-readable-size-error,.wp-user-profile-avatar-error{color:#c00!important;font-weight:700!important}#wp-user-profile-avatar-readable-size-error,#wp_user_profile_avatar_undo_button{display:none}#wp_user_profile_avatar_preview,#wp_user_profile_avatar_preview-existing{margin-right:10px}#wp_user_profile_avatar_preview,#wp_user_profile_avatar_preview-existing,#wp_user_profile_avatar_thumbnail,#wp_user_profile_avatar_thumbnail-existing{display:inline-block;text-align:center;vertical-align:top}#wp_user_profile_avatar_preview img,#wp_user_profile_avatar_preview-existing img,#wp_user_profile_avatar_thumbnail img,#wp_user_profile_avatar_thumbnail-existing img{max-height:96px;border:1px solid #dfdfdf;display:block}.widget_wp_user_profile_avatar #wp_user_profile_avatar_preview img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_preview-existing img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail-existing img{max-height:64px}.defaultavatarpicker #wp_user_profile_avatar_preview,.defaultavatarpicker #wp_user_profile_avatar_preview-existing{width:32px;height:32px;margin-right:0;display:inline-block;overflow:hidden;vertical-align:middle}.defaultavatarpicker #wp_user_profile_avatar_preview img,.defaultavatarpicker #wp_user_profile_avatar_preview-existing img{width:32px;height:auto;border:0}#wp-user-profile-avatar-edit #wp_user_profile_avatar_remove,#wp-user-profile-avatar-edit #wp_user_profile_avatar_undo,#wp-user-profile-avatar-edit-attachment{margin-left:10px!important}#wp-user-profile-avatar-slider{width:22.75em}#wp-user-profile-avatar-upload-messages span{display:block}.wp-user-profile-avatar-hide{display:none!important}.wp-user-profile-avatar-no-avatars{display:none}#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left{width:100%}#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left #settings_upload_avatar{display:none} -------------------------------------------------------------------------------- /inc/head.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <?php if(function_exists('show_wp_title')){show_wp_title();} ?> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /inc/pagination-ajax.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /static/css/searchform.css: -------------------------------------------------------------------------------- 1 | .searchform { 2 | position: fixed; 3 | top: 0; 4 | left: 0; 5 | width: 100%; 6 | height: 100%; 7 | background-color: var(--bgc-filter); 8 | -webkit-backdrop-filter: blur(20px); 9 | backdrop-filter: blur(20px); 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | visibility: hidden; 14 | opacity: 0; 15 | transition: var(--tr3); 16 | z-index: 999; 17 | } 18 | .searchform-o { 19 | visibility: visible; 20 | opacity: 1; 21 | } 22 | .searchform .searchform-mask { 23 | position: absolute; 24 | top: 0; 25 | left: 0; 26 | width: 100%; 27 | height: 100%; 28 | } 29 | .searchform .search { 30 | position: absolute; 31 | width: 800px; 32 | height: auto; 33 | background-color: var(--bgc); 34 | border-radius: var(--radius-large); 35 | box-shadow: var(--box); 36 | display: flex; 37 | flex-direction: column; 38 | align-items: center; 39 | padding: 40px 60px; 40 | } 41 | .searchform .search .title { 42 | font-size: 34px; 43 | font-weight: 700; 44 | color: var(--text); 45 | margin-bottom: 20px; 46 | } 47 | .searchform .search .title span { 48 | font-size: 32px; 49 | margin-right: 10px; 50 | } 51 | 52 | .searchform .search .form-box { 53 | height: 50px; 54 | width: 50px; 55 | margin-bottom: 50px; 56 | visibility: hidden; 57 | opacity: 0; 58 | transition: var(--tr6); 59 | } 60 | .searchform .search .form-box-o { 61 | width: 100%; 62 | visibility: visible; 63 | opacity: 1; 64 | } 65 | 66 | .searchform .search .form-box input { 67 | width: 100%; 68 | height: 100%; 69 | background-color: var(--bgc-sub); 70 | border-radius: 25px; 71 | border: 0; 72 | padding: 0 20px; 73 | outline: none; 74 | text-align: center; 75 | font-size: 16px; 76 | color: var(--text); 77 | } 78 | .searchform .search .btn { 79 | padding: 6px 20px; 80 | border-radius: var(--radius-sub); 81 | background-color: var(--bgc-sub); 82 | color: var(--text-sub); 83 | font-size: 14px; 84 | cursor: pointer; 85 | transition: var(--tr3); 86 | } 87 | .searchform .search .btn:hover { 88 | color: var(--theme); 89 | } -------------------------------------------------------------------------------- /admin/avatar/assets/css/backend.css: -------------------------------------------------------------------------------- 1 | #wp-user-profile-avatar-errors, #wp-user-profile-avatar-readable-size-error, .wp-user-profile-avatar-error { color: #c00 !important; font-weight: 700 !important; } 2 | #wp-user-profile-avatar-readable-size-error, #wp_user_profile_avatar_undo_button { display: none; } 3 | #wp_user_profile_avatar_preview, #wp_user_profile_avatar_preview-existing { margin-right: 10px; } 4 | #wp_user_profile_avatar_preview, #wp_user_profile_avatar_preview-existing, #wp_user_profile_avatar_thumbnail, #wp_user_profile_avatar_thumbnail-existing { display: inline-block; text-align: center; vertical-align: top; } 5 | #wp_user_profile_avatar_preview img, #wp_user_profile_avatar_thumbnail img, #wp_user_profile_avatar_preview-existing img, #wp_user_profile_avatar_thumbnail-existing img { max-height: 96px; border: 1px solid #dfdfdf; display: block; } 6 | .widget_wp_user_profile_avatar #wp_user_profile_avatar_preview img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_preview-existing img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail-existing img { max-height: 64px; } 7 | .defaultavatarpicker #wp_user_profile_avatar_preview, .defaultavatarpicker #wp_user_profile_avatar_preview-existing { width: 32px; height: 32px; margin-right: 0; display: inline-block; overflow: hidden; vertical-align: middle; } 8 | .defaultavatarpicker #wp_user_profile_avatar_preview img , .defaultavatarpicker #wp_user_profile_avatar_preview-existing img { width: 32px; height: auto; border: 0; } 9 | #wp-user-profile-avatar-edit #wp_user_profile_avatar_remove, #wp-user-profile-avatar-edit #wp_user_profile_avatar_undo, #wp-user-profile-avatar-edit-attachment { margin-left: 10px !important; } 10 | #wp-user-profile-avatar-slider { width: 22.75em; } 11 | #wp-user-profile-avatar-upload-messages span { display: block; } 12 | .wp-user-profile-avatar-hide { display: none !important; } 13 | .wp-user-profile-avatar-no-avatars { display: none; } 14 | 15 | #TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left{ 16 | width: 100%; 17 | } 18 | #TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left #settings_upload_avatar{ 19 | display: none; 20 | } -------------------------------------------------------------------------------- /admin/avatar/assets/css/frontend.min.css: -------------------------------------------------------------------------------- 1 | #wp-user-profile-avatar-errors,#wp-user-profile-avatar-readable-size-error,.wp-user-profile-avatar-error{color:#c00!important;font-weight:700!important}#wp-user-profile-avatar-readable-size-success,#wp-user-profile-avatar-success,.wp-user-profile-avatar-success{color:#179a17!important;font-weight:700!important}#wp-user-profile-avatar-readable-size-error,#wp_user_profile_avatar_undo_button{display:none}#wp_user_profile_avatar_preview,#wp_user_profile_avatar_preview-existing{margin-right:10px}#wp_user_profile_avatar_preview,#wp_user_profile_avatar_preview-existing,#wp_user_profile_avatar_thumbnail,#wp_user_profile_avatar_thumbnail-existing{display:inline-block;text-align:center;vertical-align:top}#wp_user_profile_avatar_preview img,#wp_user_profile_avatar_preview-existing img,#wp_user_profile_avatar_thumbnail img,#wp_user_profile_avatar_thumbnail-existing img{max-height:96px;border:1px solid #dfdfdf;display:block}.widget_wp_user_profile_avatar #wp_user_profile_avatar_preview img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_preview-existing img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail img,.widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail-existing img{max-height:64px}.defaultavatarpicker #wp_user_profile_avatar_preview,.defaultavatarpicker #wp_user_profile_avatar_preview-existing{width:32px;height:32px;margin-right:0;display:inline-block;overflow:hidden;vertical-align:middle}.defaultavatarpicker #wp_user_profile_avatar_preview img,.defaultavatarpicker #wp_user_profile_avatar_preview-existing img{width:32px;height:auto;border:0}#wp-user-profile-avatar-edit #wp_user_profile_avatar_remove,#wp-user-profile-avatar-edit #wp_user_profile_avatar_undo,#wp-user-profile-avatar-edit-attachment{margin-left:10px!important}#wp-user-profile-avatar-slider{width:22.75em}#wp-user-profile-avatar-upload-messages span{display:block}.wp-user-profile-avatar-hide{display:none!important}.wp-user-profile-avatar-no-avatars{display:none}.wp-user-profile-avatar .alignleft{float:left;margin:.3rem 2rem 2rem 2rem}.wp-user-profile-avatar .alignright{float:right;margin:.3rem 0 2rem 2rem}.wp-user-profile-avatar .aligncenter{margin-bottom:4rem;margin-top:4rem;margin-left:auto;margin-right:auto;text-align:center}.wp-user-profile-avatar .alignnone{margin-bottom:4rem;margin-top:4rem;margin-left:auto;margin-right:auto;text-align:center} -------------------------------------------------------------------------------- /admin/avatar/includes/wp-user-profile-avatar-user.php: -------------------------------------------------------------------------------- 1 | comment_author_email)) 46 | { 47 | $user_id = $id_or_email->user_id; 48 | } 49 | } 50 | else 51 | { 52 | if ( is_email( $id_or_email ) ) 53 | { 54 | $user = get_user_by( 'email', $id_or_email ); 55 | if($user) 56 | { 57 | $user_id = $user->ID; 58 | } 59 | } 60 | else 61 | { 62 | $user_id = $id_or_email; 63 | } 64 | } 65 | 66 | // First checking custom avatar. 67 | if( check_wpupa_url( $user_id ) ) 68 | { 69 | $url = get_wpupa_url( $user_id, ['size' => 'thumbnail'] ); 70 | } 71 | else if( $wpupa_disable_gravatar ) 72 | { 73 | $url = get_wpupa_default_avatar_url(['size' => 'thumbnail']); 74 | } 75 | else 76 | { 77 | $has_valid_url = check_wpupa_gravatar($id_or_email); 78 | if(!$has_valid_url) 79 | { 80 | $url = get_wpupa_default_avatar_url(['size' => 'thumbnail']); 81 | } 82 | else 83 | { 84 | if($wpupa_default != 'wp_user_profile_avatar' && !empty($user_id)) 85 | { 86 | $url = get_wpupa_url( $user_id, ['size' => 'thumbnail' ] ); 87 | } 88 | } 89 | } 90 | 91 | return $url; 92 | } 93 | 94 | } 95 | 96 | new WPUPA_User(); -------------------------------------------------------------------------------- /static/css/single.css: -------------------------------------------------------------------------------- 1 | .single .top { 2 | height: 500px; 3 | position: fixed; 4 | top: 140px; 5 | transition: var(--tr3); 6 | z-index: -1; 7 | } 8 | .single .top::before { 9 | content: ''; 10 | width: 100%; 11 | height: 100%; 12 | position: absolute; 13 | top: 0; 14 | right: 0; 15 | } 16 | .single .top img { 17 | width: 100%; 18 | height: 100%; 19 | object-fit: cover; 20 | vertical-align: middle; 21 | border-radius: var(--radius-large); 22 | } 23 | .single .box { 24 | width: 100%; 25 | margin-top: 490px; 26 | } 27 | .single .box .content { 28 | width: 800px; 29 | height: auto; 30 | background-color: var(--bgc-filter); 31 | -webkit-backdrop-filter: blur(20px); 32 | backdrop-filter: blur(20px); 33 | border-radius: var(--radius-large); 34 | box-shadow: var(--box); 35 | padding: 30px 40px 40px 40px; 36 | margin: 0 auto; 37 | } 38 | .single .box .content .cate, 39 | .single .box .content .cate a { 40 | font-size: 18px; 41 | font-weight: 700; 42 | color: var(--theme); 43 | text-transform: uppercase; 44 | } 45 | .single .box .content .title { 46 | margin-top: 15px; 47 | font-size: 28px; 48 | font-weight: 700; 49 | line-height: 1.5; 50 | color: var(--text); 51 | word-break: break-all; 52 | word-wrap: break-word; 53 | } 54 | .single .box .content .info { 55 | margin-top: 10px; 56 | display: flex; 57 | } 58 | .single .box .content .info > div { 59 | margin-right: 20px; 60 | } 61 | .single .box .content .info .date, 62 | .single .box .content .info .date span, 63 | .single .box .content .info .views, 64 | .single .box .content .info .views span, 65 | .single .box .content .info .comments, 66 | .single .box .content .info .comments a, 67 | .single .box .content .info .comments span { 68 | color: var(--text-sub); 69 | font-size: 14px; 70 | font-weight: 300; 71 | } 72 | .single .box .content .author { 73 | margin-top: 15px; 74 | display: flex; 75 | align-items: center; 76 | } 77 | .single .box .content .author > a { 78 | display: block; 79 | width: 40px; 80 | height: 40px; 81 | border-radius: var(--radius-sub); 82 | overflow: hidden; 83 | margin-right: 10px; 84 | } 85 | .single .box .content .author a img { 86 | width: 100%; 87 | height: 100%; 88 | vertical-align: middle; 89 | } 90 | .single .box .content .author span a { 91 | color: var(--text); 92 | } 93 | .single .box .content .text { 94 | margin-top: 30px; 95 | } -------------------------------------------------------------------------------- /admin/avatar/assets/css/frontend.css: -------------------------------------------------------------------------------- 1 | #wp-user-profile-avatar-errors, #wp-user-profile-avatar-readable-size-error, .wp-user-profile-avatar-error { color: #c00 !important; font-weight: 700 !important; } 2 | #wp-user-profile-avatar-success, #wp-user-profile-avatar-readable-size-success, .wp-user-profile-avatar-success { color: #179a17 !important; font-weight: 700 !important; } 3 | #wp-user-profile-avatar-readable-size-error, #wp_user_profile_avatar_undo_button { display: none; } 4 | #wp_user_profile_avatar_preview, #wp_user_profile_avatar_preview-existing { margin-right: 10px; } 5 | #wp_user_profile_avatar_preview, #wp_user_profile_avatar_preview-existing, #wp_user_profile_avatar_thumbnail, #wp_user_profile_avatar_thumbnail-existing { display: inline-block; text-align: center; vertical-align: top; } 6 | #wp_user_profile_avatar_preview img, #wp_user_profile_avatar_thumbnail img, #wp_user_profile_avatar_preview-existing img, #wp_user_profile_avatar_thumbnail-existing img { max-height: 96px; border: 1px solid #dfdfdf; display: block; } 7 | .widget_wp_user_profile_avatar #wp_user_profile_avatar_preview img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_preview-existing img, .widget_wp_user_profile_avatar #wp_user_profile_avatar_thumbnail-existing img { max-height: 64px; } 8 | .defaultavatarpicker #wp_user_profile_avatar_preview, .defaultavatarpicker #wp_user_profile_avatar_preview-existing { width: 32px; height: 32px; margin-right: 0; display: inline-block; overflow: hidden; vertical-align: middle; } 9 | .defaultavatarpicker #wp_user_profile_avatar_preview img , .defaultavatarpicker #wp_user_profile_avatar_preview-existing img { width: 32px; height: auto; border: 0; } 10 | #wp-user-profile-avatar-edit #wp_user_profile_avatar_remove, #wp-user-profile-avatar-edit #wp_user_profile_avatar_undo, #wp-user-profile-avatar-edit-attachment { margin-left: 10px !important; } 11 | #wp-user-profile-avatar-slider { width: 22.75em; } 12 | #wp-user-profile-avatar-upload-messages span { display: block; } 13 | .wp-user-profile-avatar-hide { display: none !important; } 14 | .wp-user-profile-avatar-no-avatars { display: none; } 15 | .wp-user-profile-avatar .alignleft {float: left;margin: 0.3rem 2rem 2rem 2rem;} 16 | .wp-user-profile-avatar .alignright {float: right;margin: 0.3rem 0 2rem 2rem;} 17 | .wp-user-profile-avatar .aligncenter {margin-bottom: 4rem;margin-top: 4rem;margin-left: auto;margin-right: auto;text-align: center;} 18 | .wp-user-profile-avatar .alignnone {margin-bottom: 4rem;margin-top: 4rem;margin-left: auto;margin-right: auto;text-align: center;} -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 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 | -------------------------------------------------------------------------------- /admin/avatar/templates/wp-avatar-upload.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 | 11 | 26 | 27 | 28 | 35 | 36 | 52 | 53 | 54 | 55 | 58 | 59 | 60 |
12 |

13 | 14 |

15 | 16 |

17 | 18 |

19 | */ ?> 20 | 21 | 22 | 23 | 24 |

25 |
37 |

38 | 39 | 40 |

41 |

42 | 43 | 44 |

45 |

46 | 47 |

48 |

49 | 50 |

51 |
56 | 57 |
61 |
62 | 63 |
64 | 65 |
-------------------------------------------------------------------------------- /functions/remove-category.php: -------------------------------------------------------------------------------- 1 | flush_rules(); 10 | } 11 | 12 | add_action('init', 'no_category_base_permastruct'); 13 | 14 | function no_category_base_permastruct() { 15 | global $wp_rewrite, $wp_version; 16 | if (version_compare($wp_version, '3.4', '<')) { 17 | $wp_rewrite -> extra_permastructs['category'][0] = '%category%'; 18 | } else { 19 | $wp_rewrite -> extra_permastructs['category']['struct'] = '%category%'; 20 | } 21 | } 22 | 23 | add_filter('category_rewrite_rules', 'no_category_base_rewrite_rules'); 24 | 25 | function no_category_base_rewrite_rules($category_rewrite) { 26 | $category_rewrite = array(); 27 | $categories = get_categories(array('hide_empty' => false)); 28 | foreach ($categories as $category) { 29 | $category_nicename = $category -> slug; 30 | if ($category -> parent == $category -> cat_ID) 31 | $category -> parent = 0; 32 | elseif ($category -> parent != 0) 33 | $category_nicename = get_category_parents($category -> parent, false, '/', true) . $category_nicename; 34 | $category_rewrite['(' . $category_nicename . ')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]'; 35 | $category_rewrite['(' . $category_nicename . ')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]'; 36 | $category_rewrite['(' . $category_nicename . ')/?$'] = 'index.php?category_name=$matches[1]'; 37 | } 38 | global $wp_rewrite; 39 | $old_category_base = get_option('category_base') ? get_option('category_base') : 'category'; 40 | $old_category_base = trim($old_category_base, '/'); 41 | $category_rewrite[$old_category_base . '/(.*)$'] = 'index.php?category_redirect=$matches[1]'; 42 | return $category_rewrite; 43 | } 44 | 45 | add_filter('query_vars', 'no_category_base_query_vars'); 46 | 47 | function no_category_base_query_vars($public_query_vars) { 48 | $public_query_vars[] = 'category_redirect'; 49 | return $public_query_vars; 50 | } 51 | 52 | add_filter('request', 'no_category_base_request'); 53 | 54 | function no_category_base_request($query_vars) { 55 | if (isset($query_vars['category_redirect'])) { 56 | $catlink = trailingslashit(get_option('home')) . user_trailingslashit($query_vars['category_redirect'], 'category'); 57 | status_header(301); 58 | header("Location: $catlink"); 59 | exit(); 60 | } 61 | return $query_vars; 62 | } 63 | 64 | ?> -------------------------------------------------------------------------------- /inc/recommend.php: -------------------------------------------------------------------------------- 1 | explode(',',get_option("recommend")), 4 | 'post__not_in' => get_option('sticky_posts'), 5 | 'showposts' => 1, 6 | )); 7 | ?> 8 | 9 | 10 | have_posts()) : while($recommend->have_posts()) : $recommend->the_post(); ?> 11 |
12 |
13 | 14 | 15 | 16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 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 | -------------------------------------------------------------------------------- /admin/option.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 |
14 |

15 |
16 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 52 | 53 | 54 |
21 | " class="regular-text"> 22 |

23 |
28 | " class="regular-text"> 29 |

30 |
35 | " class="regular-text"> 36 |

true to hide.','ipop'); ?>

37 |

/admin or /wp-login.php after the domain name.','ipop'); ?>

38 |
43 | " class="regular-text"> 44 |

45 |
50 |

https://chuangzaoshi.com/icon/

51 |
55 |

56 | 57 |

58 |
59 |
-------------------------------------------------------------------------------- /admin/avatar/assets/js/frontend-avatar.min.js: -------------------------------------------------------------------------------- 1 | var FrontendAvatar=(FrontendAvatar=function(){return{init:function(){jQuery("#wp_user_profile_avatar_add").on("click",FrontendAvatar.actions.chooseAvatar),jQuery("#wp_user_profile_avatar_remove").on("click",FrontendAvatar.actions.removeAvatar),jQuery("#wp_user_profile_avatar_undo").on("click",FrontendAvatar.actions.undoAvatar),jQuery("#wp_user_profile_avatar_update_profile").on("click",FrontendAvatar.actions.updateAvatar)},actions:{removeAvatar:function(a){jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-error"),jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-success"),jQuery("#upload_avatar_responce").html("");var r=jQuery(".update-user-profile-avatar").serialize(),e=new FormData;e.append("action","remove_user_avatar"),e.append("form_data",r),e.append("security",wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security),jQuery.ajax({url:wp_user_profile_avatar_frontend_avatar.ajax_url,type:"post",dataType:"JSON",data:e,processData:!1,contentType:!1,success:function(a){jQuery("#upload_avatar_responce").addClass(a.class),jQuery("#upload_avatar_responce").html(a.message),"wp-user-profile-avatar-success"==a.class&&(jQuery("#wp_user_profile_avatar_preview img").attr("src",a.avatar_original),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",a.avatar_thumbnail),jQuery(".update-user-profile-avatar #wpupa_url").val(""),jQuery(".update-user-profile-avatar #wpupa_attachment_id").val(""),jQuery("#wp_user_profile_avatar_remove_button").hide())}})},undoAvatar:function(a){jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-error"),jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-success"),jQuery("#upload_avatar_responce").html("");var r=jQuery(".update-user-profile-avatar").serialize(),e=new FormData;e.append("action","undo_user_avatar"),e.append("form_data",r),e.append("security",wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security),jQuery.ajax({url:wp_user_profile_avatar_frontend_avatar.ajax_url,type:"post",dataType:"JSON",data:e,processData:!1,contentType:!1,success:function(a){jQuery("#upload_avatar_responce").addClass(a.class),jQuery("#upload_avatar_responce").html(a.message),"wp-user-profile-avatar-success"==a.class&&(jQuery("#wp_user_profile_avatar_preview img").attr("src",a.avatar_original),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",a.avatar_thumbnail),jQuery("#wp_user_profile_avatar_undo_button").hide())}})},updateAvatar:function(a){jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-error"),jQuery("#upload_avatar_responce").removeClass("wp-user-profile-avatar-success"),jQuery("#upload_avatar_responce").html("");var r=jQuery(".update-user-profile-avatar").serialize(),e=new FormData;e.append("user-avatar",jQuery(".wp-user-profile-avatar-image")[0].files[0]),e.append("action","update_user_avatar"),e.append("form_data",r),e.append("security",wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security),jQuery.ajax({url:wp_user_profile_avatar_frontend_avatar.ajax_url,type:"post",dataType:"JSON",data:e,processData:!1,contentType:!1,success:function(a){jQuery("#upload_avatar_responce").addClass(a.class),jQuery("#upload_avatar_responce").html(a.message),"wp-user-profile-avatar-success"==a.class&&(jQuery("#wp_user_profile_avatar_preview img").attr("src",a.avatar_original),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",a.avatar_thumbnail),jQuery("#wp_user_profile_avatar_undo_button").show())}})}}}})();jQuery(document).ready(function(a){FrontendAvatar.init()}); -------------------------------------------------------------------------------- /static/iconfont/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3557637", 3 | "name": "ipop.onll.cn", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "15838429", 10 | "name": "arrow-down", 11 | "font_class": "arrow-down", 12 | "unicode": "e666", 13 | "unicode_decimal": 58982 14 | }, 15 | { 16 | "icon_id": "15838431", 17 | "name": "arrow-right", 18 | "font_class": "arrow-right", 19 | "unicode": "e665", 20 | "unicode_decimal": 58981 21 | }, 22 | { 23 | "icon_id": "562688", 24 | "name": "Login", 25 | "font_class": "login1", 26 | "unicode": "e624", 27 | "unicode_decimal": 58916 28 | }, 29 | { 30 | "icon_id": "27300831", 31 | "name": "cloudy at night", 32 | "font_class": "a-cloudyatnight", 33 | "unicode": "e754", 34 | "unicode_decimal": 59220 35 | }, 36 | { 37 | "icon_id": "27300844", 38 | "name": "moon", 39 | "font_class": "moon", 40 | "unicode": "e758", 41 | "unicode_decimal": 59224 42 | }, 43 | { 44 | "icon_id": "27300853", 45 | "name": "partly cloudy_01", 46 | "font_class": "a-partlycloudy_01", 47 | "unicode": "e759", 48 | "unicode_decimal": 59225 49 | }, 50 | { 51 | "icon_id": "27300860", 52 | "name": "sunny", 53 | "font_class": "sunny", 54 | "unicode": "e75b", 55 | "unicode_decimal": 59227 56 | }, 57 | { 58 | "icon_id": "15625220", 59 | "name": "搜索", 60 | "font_class": "sousuo1", 61 | "unicode": "e692", 62 | "unicode_decimal": 59026 63 | }, 64 | { 65 | "icon_id": "4765745", 66 | "name": "up-circle", 67 | "font_class": "up-circle", 68 | "unicode": "e785", 69 | "unicode_decimal": 59269 70 | }, 71 | { 72 | "icon_id": "4765741", 73 | "name": "time-circle", 74 | "font_class": "time-circle", 75 | "unicode": "e784", 76 | "unicode_decimal": 59268 77 | }, 78 | { 79 | "icon_id": "4765866", 80 | "name": "message", 81 | "font_class": "message", 82 | "unicode": "e78a", 83 | "unicode_decimal": 59274 84 | }, 85 | { 86 | "icon_id": "4765887", 87 | "name": "poweroff", 88 | "font_class": "poweroff", 89 | "unicode": "e78c", 90 | "unicode_decimal": 59276 91 | }, 92 | { 93 | "icon_id": "4765891", 94 | "name": "setting", 95 | "font_class": "setting", 96 | "unicode": "e78e", 97 | "unicode_decimal": 59278 98 | }, 99 | { 100 | "icon_id": "4765896", 101 | "name": "eye", 102 | "font_class": "eye", 103 | "unicode": "e78f", 104 | "unicode_decimal": 59279 105 | }, 106 | { 107 | "icon_id": "4767011", 108 | "name": "right", 109 | "font_class": "right", 110 | "unicode": "e7eb", 111 | "unicode_decimal": 59371 112 | }, 113 | { 114 | "icon_id": "4767012", 115 | "name": "left", 116 | "font_class": "left", 117 | "unicode": "e7ec", 118 | "unicode_decimal": 59372 119 | }, 120 | { 121 | "icon_id": "4767018", 122 | "name": "doubleleft", 123 | "font_class": "doubleleft", 124 | "unicode": "e7ed", 125 | "unicode_decimal": 59373 126 | }, 127 | { 128 | "icon_id": "4767059", 129 | "name": "menu", 130 | "font_class": "menu", 131 | "unicode": "e7f4", 132 | "unicode_decimal": 59380 133 | }, 134 | { 135 | "icon_id": "4767094", 136 | "name": "ellipsis", 137 | "font_class": "ellipsis", 138 | "unicode": "e7fc", 139 | "unicode_decimal": 59388 140 | } 141 | ] 142 | } 143 | -------------------------------------------------------------------------------- /static/js/main.js: -------------------------------------------------------------------------------- 1 | // 滚动时隐藏header 2 | var header_element = document.querySelector(".header"); 3 | if(header_element) { 4 | var headroom = []; 5 | headroom = new Headroom(header_element, { 6 | "tolerance": 5, 7 | "offset": 0, 8 | }); 9 | headroom.init(); 10 | } 11 | var header_element_m = document.querySelector(".header-m"); 12 | if(header_element_m) { 13 | var headroom_m = []; 14 | headroom_m = new Headroom(header_element_m, { 15 | "tolerance": 5, 16 | "offset": 259, 17 | }); 18 | headroom_m.init(); 19 | } 20 | 21 | // 页眉 22 | const menu_item = document.querySelector('#menu #item'); 23 | if(menu_item) { 24 | menu_item.insertBefore(document.createElement('div'), menu_item.children[0]).setAttribute('class','menu-block'); 25 | } 26 | 27 | 28 | $("#menu #item > li > a").on("mouseover", function() { 29 | var width = $(this).parent().width(); 30 | var position = $(this).parent().position(); 31 | $("#menu #item .menu-block").css({ 32 | opacity: 1, 33 | width: width, 34 | left: position.left, 35 | }); 36 | }) 37 | $("#menu #item > li > a").on("mouseout", function() { 38 | $("#menu #item .menu-block").css({ 39 | opacity: 0, 40 | }); 41 | }); 42 | 43 | // 移动端菜单 44 | const menu_btn = document.querySelector('.menu-btn'); //open按钮 45 | const menu_btn_c = document.querySelector('.menu-btn-c'); //close按钮 46 | const menu_m = document.querySelector('.menu-m'); // 菜单 47 | const menu_mask = document.querySelector('.menu-mask'); //遮罩 48 | 49 | menu_btn.onclick = function() { 50 | menu_m.className = 'menu-m menu-m-o'; 51 | menu_mask.className = 'menu-mask menu-mask-o'; 52 | } 53 | menu_btn_c.onclick = function() { 54 | menu_m.className = 'menu-m'; 55 | menu_mask.className = 'menu-mask'; 56 | 57 | } 58 | menu_mask.onclick = function() { 59 | menu_m.className = 'menu-m'; 60 | this.className = 'menu-mask'; 61 | } 62 | 63 | // 移动端菜单栏 64 | const has_children_a = document.querySelectorAll('.menu-m .center .menu-box .nav-m .item-m > .menu-item-has-children > a'); 65 | const has_children_ul = document.querySelectorAll('.menu-m .center .menu-box .nav-m .item-m > .menu-item-has-children > .sub-menu'); 66 | const has_children_a_i = document.querySelectorAll('.menu-m .center .menu-box .nav-m .item-m > .menu-item-has-children > a i'); 67 | 68 | for(let i=0; i 300) { 107 | $('.single .top').css('opacity','0'); 108 | } else { 109 | $('.single .top').css('opacity','1'); 110 | } 111 | }) -------------------------------------------------------------------------------- /inc/main.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 37 |
38 |
39 | 40 |
41 | 42 |
    43 | 44 | 45 | 46 |
  • 47 | 54 |
    55 |
    56 |
    57 |
    58 |
    59 |
    60 |
    61 |
    62 |
    63 |
    64 |
    65 |
  • 66 | 67 | 68 |
    69 | 70 |
71 |
72 |
-------------------------------------------------------------------------------- /static/css/home.css: -------------------------------------------------------------------------------- 1 | /* recommend.php */ 2 | .recommend { 3 | height: 400px; 4 | background-color: var(--bgc-sub); 5 | border-radius: var(--radius-large); 6 | border: 1px solid var(--border); 7 | margin-bottom: 50px; 8 | overflow: hidden; 9 | display: flex; 10 | } 11 | .recommend .pic { 12 | width: 60%; 13 | position: relative; 14 | } 15 | .recommend .pic::before { 16 | content: ''; 17 | width: 100%; 18 | height: 100%; 19 | position: absolute; 20 | top: 0; 21 | right: 0; 22 | background: linear-gradient(to right, var(--bgc-0) 50%, var(--bgc-sub) 100%); 23 | } 24 | .recommend .pic img { 25 | width: 100%; 26 | height: 100%; 27 | object-fit: cover; 28 | vertical-align: middle; 29 | } 30 | 31 | .recommend .box { 32 | width: 40%; 33 | position: relative; 34 | } 35 | .recommend .box .content { 36 | width: 130%; 37 | height: 300px; 38 | background-color: var(--bgc-filter); 39 | -webkit-backdrop-filter: blur(20px); 40 | backdrop-filter: blur(20px); 41 | position: absolute; 42 | top: 30px; 43 | right: 40px; 44 | border-radius: var(--radius-large); 45 | box-shadow: var(--box); 46 | display: flex; 47 | flex-direction: column; 48 | justify-content: space-between; 49 | padding: 30px; 50 | transition: var(--tr3); 51 | } 52 | .recommend .box .content:hover { 53 | box-shadow: var(--box-hover); 54 | } 55 | .recommend .content .cate, 56 | .recommend .content .cate a { 57 | font-size: 18px; 58 | color: var(--theme); 59 | text-transform: uppercase; 60 | } 61 | .recommend .content .title { 62 | margin-top: 10px; 63 | line-height: 1.4; 64 | word-break: break-all; 65 | text-overflow: ellipsis; 66 | display: -webkit-box; 67 | -webkit-box-orient: vertical; 68 | -webkit-line-clamp: 2; 69 | overflow: hidden; 70 | } 71 | .recommend .content .title a { 72 | font-size: 24px; 73 | color: var(--text); 74 | } 75 | .recommend .content .excerpt { 76 | margin-top: 5px; 77 | font-weight: 300; 78 | color: var(--text-info); 79 | word-break: break-all; 80 | text-overflow: ellipsis; 81 | display: -webkit-box; 82 | -webkit-box-orient: vertical; 83 | -webkit-line-clamp: 3; 84 | overflow: hidden; 85 | } 86 | .recommend .content .more { 87 | display: flex; 88 | justify-content: space-between; 89 | align-items: center; 90 | transition: var(--tr3); 91 | } 92 | .recommend .content .more .author-avatar { 93 | height: 30px; 94 | font-size: 16px; 95 | color: var(--text-info); 96 | display: flex; 97 | align-items: center; 98 | transition: var(--tr3); 99 | } 100 | .recommend .content .more .author-avatar:hover { 101 | color: var(--theme); 102 | } 103 | .recommend .content .more .author-avatar img { 104 | width: 30px; 105 | height: 30px; 106 | border-radius: 50%; 107 | margin-right: 8px; 108 | vertical-align: middle; 109 | } 110 | .recommend .content .more .author-avatar span { 111 | max-width: 200px; 112 | text-overflow: ellipsis; 113 | white-space: nowrap; 114 | overflow: hidden; 115 | } 116 | .recommend .content .more .readmore { 117 | display: inline-block; 118 | padding: 6px 20px; 119 | background-color: var(--theme); 120 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 121 | color: var(--text-box); 122 | font-size: 14px; 123 | border-radius: var(--radius-sub); 124 | transition: var(--tr3); 125 | } 126 | .recommend .content .more .readmore:hover { 127 | opacity: .8; 128 | } 129 | .recommend .box .info { 130 | width: 100%; 131 | height: 70px; 132 | position: absolute; 133 | bottom: 0; 134 | display: flex; 135 | align-items: center; 136 | justify-content: right; 137 | padding-right: 50px; 138 | } 139 | .recommend .box .info > div { 140 | margin-right: 20px; 141 | } 142 | .recommend .box .info .date, 143 | .recommend .box .info .date span, 144 | .recommend .box .info .views, 145 | .recommend .box .info .views span, 146 | .recommend .box .info .comments, 147 | .recommend .box .info .comments span, 148 | .recommend .box .info .comments a { 149 | color: var(--text-sub); 150 | font-weight: 300; 151 | font-size: 14px; 152 | } 153 | 154 | /* 移动端 */ 155 | .recommend-m { 156 | display: none; 157 | } 158 | -------------------------------------------------------------------------------- /static/js/headroom.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it 3 | * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js 4 | * License: MIT 5 | */ 6 | 7 | !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=ls.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s}); -------------------------------------------------------------------------------- /admin/avatar/admin/templates/shortcode-popup.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /admin/avatar/assets/js/admin-avatar.min.js: -------------------------------------------------------------------------------- 1 | var AdminAvatar=(AdminAvatar=function(){return{init:function(){jQuery("#wp_user_profile_avatar_add").on("click",AdminAvatar.actions.chooseAvatar),jQuery("#wp_user_profile_avatar_remove").on("click",AdminAvatar.actions.removeAvatar),jQuery("#wp_user_profile_avatar_undo").on("click",AdminAvatar.actions.undoAvatar),jQuery("body").on("click","#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .nav-tab-wrapper a",AdminAvatar.actions.showShortcodeAvatarTab),jQuery("body").on("change","#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_link_to",AdminAvatar.actions.imageLinkTo),jQuery("body").on("click","#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #user_avatar_form_btn",AdminAvatar.actions.addUserAvatarShortcode),jQuery("body").on("click","#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_upload_avatar #upload_avatar_form_btn",AdminAvatar.actions.addUploadAvatarShortcode),"undefined"!=typeof tinymce&&(tinymce.PluginManager.add("wp_user_profile_avatar_shortcodes",function(a,r){a.addButton("wp_user_profile_avatar_shortcodes",{title:wp_user_profile_avatar_admin_avatar.icon_title,classes:"thickbox",image:wp_user_profile_avatar_admin_avatar.default_avatar,icon:!1,onclick:function(){}})}),setTimeout(function(){jQuery(".mce-thickbox button").remove(),jQuery(".mce-thickbox").html('')},1500))},actions:{showShortcodeAvatarTab:function(a){jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left .settings-panel").hide();var r=jQuery(a.target).attr("href");jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left "+r).show()},imageLinkTo:function(a){"custom"==jQuery(a.target).val()?jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to").attr("type","text"):jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to").attr("type","hidden")},addUserAvatarShortcode:function(a){var r=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_user_id").val(),t=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_size").val(),e=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_alignment").val(),o=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_link_to").val(),i=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to").val(),_="";1==jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_open_new_window").prop("checked")&&(_=jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_open_new_window").val());var n=""!=o&&"custom"!=o&&""==i?' link="'+o+'"':"",u="

[user_profile_avatar"+(""!=r?' user_id="'+r+'"':"")+(""!=t?' size="'+t+'"':"")+(""!=e?' align="'+e+'"':"")+(n=""!=i?' link="'+i+'"':n)+(""!=_?' target="'+_+'"':"")+"] "+jQuery("body").find("#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_caption").val()+" [/user_profile_avatar]

";tinymce.activeEditor.insertContent(u),jQuery("body").find("#TB_window #TB_title #TB_closeAjaxWindow #TB_closeWindowButton").trigger("click")},addUploadAvatarShortcode:function(a){tinymce.activeEditor.insertContent("

[user_profile_avatar_upload]

"),jQuery("body").find("#TB_window #TB_title #TB_closeAjaxWindow #TB_closeWindowButton").trigger("click")},chooseAvatar:function(a){var r=wp.media({library:{type:"image"},title:wp_user_profile_avatar_admin_avatar.media_box_title,multiple:!1}).on("select",function(){var a=r.state().get("selection").first().toJSON();jQuery("#wp_user_profile_avatar_preview img").attr("src",a.url),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",a.url),jQuery("#wpupa_attachment_id").attr("value",a.id),jQuery("#wp_user_profile_avatar_radio").trigger("click"),jQuery("#wp_user_profile_avatar_undo_button").show()}).open()},removeAvatar:function(a){jQuery("#wp_user_profile_avatar_preview img").attr("src",wp_user_profile_avatar_admin_avatar.default_avatar),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",wp_user_profile_avatar_admin_avatar.default_avatar),jQuery("#wpupa_attachment_id").attr("value",""),jQuery("#wpupa_url").attr("value",""),jQuery("#wp_user_profile_avatar_remove").hide()},undoAvatar:function(a){jQuery("#wp_user_profile_avatar_preview img").attr("src",wp_user_profile_avatar_admin_avatar.default_avatar),jQuery("#wp_user_profile_avatar_thumbnail img").attr("src",wp_user_profile_avatar_admin_avatar.default_avatar),jQuery("#wpupa_attachment_id").attr("value",""),jQuery("#wp_user_profile_avatar_undo_button").hide()}}}})();jQuery(document).ready(function(a){AdminAvatar.init()}); -------------------------------------------------------------------------------- /static/css/text.css: -------------------------------------------------------------------------------- 1 | .text { 2 | width: 100%; 3 | } 4 | .text > * { 5 | width: 100%; 6 | margin-top: 20px; 7 | color: var(--text); 8 | } 9 | 10 | /* 文本 */ 11 | .text p, 12 | .text a, 13 | .text h1, 14 | .text h2, 15 | .text h3, 16 | .text h4, 17 | .text h5, 18 | .text h6 { 19 | line-height: 2; 20 | word-break: break-all; 21 | word-wrap: break-word; 22 | white-space: normal; 23 | text-align: justify; 24 | } 25 | 26 | /* 居中 */ 27 | .text .has-text-align-center { 28 | text-align: center; 29 | } 30 | .text .has-text-align-right { 31 | text-align: right; 32 | } 33 | 34 | /* 文本高亮 */ 35 | .text .has-black-color { 36 | color: #000; 37 | } 38 | .text .has-cyan-bluish-gray-color { 39 | color: #abb8c3; 40 | } 41 | .text .has-white-color { 42 | color: var(--text-keep); 43 | } 44 | .text .has-pale-pink-color { 45 | color: #f78da7; 46 | } 47 | .text .has-vivid-red-color { 48 | color: #cf2e2e; 49 | } 50 | .text .has-luminous-vivid-orange-color { 51 | color: #ff6900; 52 | } 53 | .text .has-luminous-vivid-amber-color { 54 | color: #fcb900; 55 | } 56 | .text .has-light-green-cyan-color { 57 | color: #7bdcb5; 58 | } 59 | .text .has-vivid-green-cyan-color { 60 | color: #00d084; 61 | } 62 | .text .has-pale-cyan-blue-color { 63 | color: #8ed1fc; 64 | } 65 | .text .has-vivid-cyan-blue-color { 66 | color: #0693e3; 67 | } 68 | .text .has-vivid-purple-color { 69 | color: #9b51e0; 70 | } 71 | 72 | /* 超链接 */ 73 | .text a { 74 | color: var(--theme); 75 | text-decoration: underline; 76 | } 77 | 78 | /* 图片 */ 79 | .text .wp-block-image { 80 | border-radius: var(--radius-sub); 81 | overflow: hidden; 82 | } 83 | .text .wp-block-image img { 84 | width: 100%; 85 | height: 100%; 86 | object-fit: cover; 87 | vertical-align: middle; 88 | } 89 | 90 | /* 视频 */ 91 | .text .wp-block-video { 92 | width: 100%; 93 | padding-bottom: 60%; 94 | position: relative; 95 | background-color: #000000; 96 | border-radius: var(--radius-sub); 97 | overflow: hidden; 98 | } 99 | .text .wp-block-video video { 100 | position: absolute; 101 | width: 100%; 102 | height: 100%; 103 | vertical-align: middle; 104 | } 105 | 106 | /* 引用 */ 107 | .text .wp-block-quote { 108 | border-left: 4px solid var(--theme); 109 | padding: 10px; 110 | color: var(--text-info); 111 | background-color: var(--bgc-sub); 112 | border-radius: var(--radius-sub); 113 | } 114 | .text .wp-block-quote cite { 115 | font-weight: 300; 116 | font-size: 12px; 117 | } 118 | 119 | /* 标题 */ 120 | .text h1 { 121 | font-size: 28px; 122 | position: relative; 123 | 124 | } 125 | .text h2 { 126 | font-size: 24px; 127 | position: relative; 128 | } 129 | .text h3 { 130 | font-size: 20px; 131 | position: relative; 132 | } 133 | .text h4 { 134 | font-size: 17px; 135 | position: relative; 136 | 137 | } 138 | .text h5 { 139 | font-size: 15px; 140 | position: relative; 141 | } 142 | .text h6 { 143 | font-size: 15px; 144 | font-weight: 400; 145 | position: relative; 146 | } 147 | .text h4::after, 148 | .text h3::after, 149 | .text h2::after, 150 | .text h1::after { 151 | content: ''; 152 | height: 4px; 153 | position: absolute; 154 | bottom: 0; 155 | left: 0; 156 | border-radius: var(--radius-sub); 157 | background-color: var(--theme); 158 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 159 | box-shadow: 1px 1px 5px -1px var(--theme-sub); 160 | } 161 | .text h4::after { 162 | width: 30px; 163 | } 164 | .text h3::after{ 165 | width: 40px; 166 | } 167 | .text h2::after{ 168 | width: 60px; 169 | } 170 | .text h1::after{ 171 | width: 80px; 172 | } 173 | 174 | /* 列表 */ 175 | .text ul, 176 | .text ol { 177 | margin-left: 20px; 178 | display: flex; 179 | flex-direction: column; 180 | } 181 | .text ul li, 182 | .text ol li { 183 | margin-left: 20px; 184 | width: calc(100% - 40px); 185 | word-break : break-all; 186 | word-wrap: break-word; 187 | } 188 | .text ul li{ 189 | list-style: disc; 190 | } 191 | .text ol li { 192 | list-style: auto; 193 | } 194 | 195 | /* 行内代码 */ 196 | .text code { 197 | font-size: 14px; 198 | font-family: 'Consolas', 'Ipop', 'monospace'; 199 | background-color: var(--code); 200 | color: var(--theme); 201 | padding: 2px 4px; 202 | border-radius: 4px; 203 | } 204 | 205 | /* 代码框 */ 206 | .text pre { 207 | line-height: 1.3; 208 | background-color: var(--bgc-sub); 209 | padding: 10px 15px; 210 | border-radius: var(--radius-sub); 211 | max-height: 512px; 212 | overflow: auto; 213 | } 214 | .text pre code { 215 | border: 0; 216 | padding: 0; 217 | color: var(--text); 218 | background-color: transparent; 219 | } 220 | 221 | /* 表格 */ 222 | .text .wp-block-table { 223 | overflow-x: auto; 224 | 225 | } 226 | .text .wp-block-table table { 227 | width: 100%; 228 | border-collapse: collapse; 229 | } 230 | .text .wp-block-table table th, 231 | .text .wp-block-table table td { 232 | font-size: 15px; 233 | border: 1px solid var(--border); 234 | padding: 8px 10px; 235 | text-align: left; 236 | } 237 | .text .wp-block-table table tr:first-child { 238 | background-color: var(--theme-sub); 239 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 240 | color: var(--bgc); 241 | } 242 | 243 | /* 附件 */ 244 | .text .attachment a img { 245 | vertical-align: middle; 246 | } -------------------------------------------------------------------------------- /admin/avatar/wp-user-profile-avatar.php: -------------------------------------------------------------------------------- 1 | ' ) ) { 113 | 114 | WPUPA_Install::install(); 115 | flush_rewrite_rules(); 116 | } 117 | } 118 | 119 | 120 | /** 121 | * load_plugin_textdomain function. 122 | * 123 | * @access public 124 | * @param 125 | * @return 126 | * @since 1.0 127 | */ 128 | /** 129 | * frontend_scripts function. 130 | * 131 | * @access public 132 | * @param 133 | * @return 134 | * @since 1.0 135 | */ 136 | public function frontend_scripts() { 137 | 138 | wp_enqueue_style( 'wp-user-profile-avatar-frontend', get_template_directory_uri().'/admin/avatar/assets/css/frontend.min.css'); 139 | 140 | wp_register_script( 'wp-user-profile-avatar-frontend-avatar', get_template_directory_uri().'/admin/avatar/assets/js/frontend-avatar.min.js', array( 'jquery' ), WPUPA_VERSION, true); 141 | 142 | wp_localize_script( 'wp-user-profile-avatar-frontend-avatar', 'wp_user_profile_avatar_frontend_avatar', array( 143 | 'ajax_url' => admin_url( 'admin-ajax.php' ), 144 | 'wp_user_profile_avatar_security' => wp_create_nonce( "_nonce_user_profile_avatar_security" ), 145 | 'media_box_title' => __( 'Choose Image: Default Avatar', 'wp-user-profile-avatar'), 146 | 'default_avatar' => get_template_directory_uri().'/admin/avatar/assets/images/wp-user-thumbnail.png', 147 | ) 148 | ); 149 | } 150 | 151 | 152 | 153 | 154 | } 155 | 156 | 157 | /** 158 | * add_plugin_page_wp_user_profile_avatar_settings_link function. 159 | * Create link on plugin page for wp user profile avatar plugin settings 160 | * @access public 161 | * @param 162 | * @return 163 | * @since 1.0 164 | */ 165 | function add_plugin_page_wp_user_profile_avatar_settings_link( $links ) 166 | { 167 | $links[] = '' . __('Settings', 'wp-user-profile-avatar') . ''; 168 | return $links; 169 | } 170 | add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'add_plugin_page_wp_user_profile_avatar_settings_link'); 171 | 172 | 173 | /** 174 | * Main instance of WP User Profile Avatar. 175 | * 176 | * Returns the main instance of WP User Profile Avatar to prevent the need to use globals. 177 | * 178 | * @since 1.0 179 | * @return WP_User_Profile_Avatar 180 | */ 181 | function WPUPA() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName 182 | return WP_User_Profile_Avatar::instance(); 183 | } 184 | $GLOBALS['WP_User_Profile_Avatar'] = WPUPA(); -------------------------------------------------------------------------------- /static/css/main.css: -------------------------------------------------------------------------------- 1 | /* type */ 2 | .home { 3 | margin-top: 140px; 4 | } 5 | .home .type { 6 | font-size: 36px; 7 | font-weight: 700; 8 | color: var(--text); 9 | word-break: break-all; 10 | word-wrap: break-word; 11 | } 12 | .home .type span { 13 | font-size: 16px; 14 | font-weight: 400; 15 | color: var(--text-info); 16 | } 17 | .author .type { 18 | margin-top: 50px; 19 | } 20 | 21 | /* main.php */ 22 | .main { 23 | margin-top: 30px; 24 | } 25 | .main .post ul { 26 | width: 100%; 27 | display: grid; 28 | grid-template-columns: 1fr 1fr 1fr 1fr; 29 | grid-gap: 30px 20px; 30 | } 31 | .main .post ul li { 32 | width: 100%; 33 | height: 100%; 34 | border-radius: var(--radius); 35 | border: 1px solid var(--border); 36 | } 37 | .main .post ul li .pic { 38 | height: 150px; 39 | position: relative; 40 | } 41 | .main .post ul li .pic::before { 42 | content: ''; 43 | width: 100%; 44 | height: 100%; 45 | position: absolute; 46 | top: 0; 47 | right: 0; 48 | } 49 | .main .post ul li .pic img { 50 | width: 100%; 51 | height: 100%; 52 | object-fit: cover; 53 | vertical-align: middle; 54 | border-radius: var(--radius) var(--radius) 0 0; 55 | } 56 | .main .post ul li .box { 57 | width: 100%; 58 | height: 200px; 59 | background-color: var(--bgc-sub); 60 | position: relative; 61 | padding: 0 10px; 62 | border-radius: 0 0 var(--radius) var(--radius); 63 | } 64 | .main .post ul li .box .content { 65 | width: calc(100% - 20px); 66 | height: 100%; 67 | background-color: var(--bgc-filter); 68 | -webkit-backdrop-filter: blur(20px); 69 | backdrop-filter: blur(20px); 70 | position: absolute; 71 | bottom: 40px; 72 | border-radius: var(--radius); 73 | box-shadow: var(--box); 74 | padding: 10px 15px 15px 15px; 75 | display: flex; 76 | flex-direction: column; 77 | justify-content: space-between; 78 | transition: var(--tr3); 79 | } 80 | .main .post ul li .box .content:hover { 81 | box-shadow: var(--box-hover); 82 | } 83 | .main .post ul li .box .content .cate { 84 | text-overflow: ellipsis; 85 | white-space: nowrap; 86 | overflow: hidden; 87 | } 88 | .main .post ul li .box .content .cate, 89 | .main .post ul li .box .content .cate a { 90 | font-size: 14px; 91 | font-weight: 700; 92 | color: var(--theme); 93 | text-transform: uppercase; 94 | } 95 | .main .post ul li .box .content .title { 96 | margin-top: 5px; 97 | line-height: 1.4; 98 | word-break: break-all; 99 | text-overflow: ellipsis; 100 | display: -webkit-box; 101 | -webkit-box-orient: vertical; 102 | -webkit-line-clamp: 2; 103 | overflow: hidden; 104 | } 105 | .main .post ul li .box .content .title a { 106 | font-size: 15px; 107 | color: var(--text); 108 | } 109 | .main .post ul li .box .content .excerpt { 110 | margin-top: 8px; 111 | font-size: 12px; 112 | font-weight: 300; 113 | color: var(--text-info); 114 | word-break: break-all; 115 | text-overflow: ellipsis; 116 | display: -webkit-box; 117 | -webkit-box-orient: vertical; 118 | -webkit-line-clamp: 3; 119 | overflow: hidden; 120 | } 121 | .main .post ul li .box .content .more { 122 | display: flex; 123 | justify-content: space-between; 124 | align-items: center; 125 | } 126 | .main .post ul li .box .content .more .author-avatar { 127 | height: 25px; 128 | font-size: 14px; 129 | color: var(--text-info); 130 | display: flex; 131 | align-items: center; 132 | transition: var(--tr3); 133 | } 134 | .main .post ul li .box .content .more .author-avatar:hover { 135 | color: var(--theme); 136 | } 137 | .main .post ul li .box .content .more .author-avatar img { 138 | width: 25px; 139 | height: 25px; 140 | border-radius: 50%; 141 | margin-right: 5px; 142 | vertical-align: middle; 143 | } 144 | .main .post ul li .box .content .more .author-avatar span { 145 | max-width: 100px; 146 | text-overflow: ellipsis; 147 | white-space: nowrap; 148 | overflow: hidden; 149 | } 150 | .main .post ul li .box .content .more .readmore { 151 | display: inline-block; 152 | padding: 5px 12px; 153 | background-color: var(--theme); 154 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 155 | color: var(--text-box); 156 | font-size: 12px; 157 | border-radius: var(--radius-sub); 158 | transition: var(--tr3); 159 | } 160 | .main .post ul li .box .content .more .readmore:hover { 161 | opacity: .8; 162 | } 163 | .main .post ul li .box .info { 164 | width: 100%; 165 | height: 40px; 166 | position: absolute; 167 | bottom: 0; 168 | padding-left: 10px; 169 | display: flex; 170 | align-items: center; 171 | } 172 | .main .post ul li .box .info .date, 173 | .main .post ul li .box .info .date span, 174 | .main .post ul li .box .info .views, 175 | .main .post ul li .box .info .views span, 176 | .main .post ul li .box .info .sticky, 177 | .main .post ul li .box .info .sticky span { 178 | font-size: 12px; 179 | font-weight: 300; 180 | color: var(--text-sub); 181 | } 182 | .main .post ul li .box .info > * { 183 | margin-right: 10px; 184 | } 185 | .main .post ul li .box .info > *:last-child { 186 | margin-right: 0; 187 | } 188 | 189 | /* pagination-ajax.php */ 190 | #pagination { 191 | width: 100%; 192 | height: 100px; 193 | display: flex; 194 | align-items: center; 195 | justify-content: center; 196 | } 197 | #pagination a { 198 | display: block; 199 | font-size: 14px; 200 | padding: 6px 20px; 201 | background-color: var(--bgc-sub); 202 | border: 1px solid var(--bgc-sub); 203 | border-radius: var(--radius-large); 204 | color: var(--text-sub); 205 | transition: var(--tr3); 206 | 207 | } 208 | #pagination a:hover { 209 | background-color: var(--bgc); 210 | border: 1px solid var(--theme); 211 | color: var(--theme); 212 | } 213 | 214 | .main .no-post, 215 | .main-m .no-post { 216 | width: 100%; 217 | color: var(--text-sub); 218 | } 219 | 220 | /* 移动端 */ 221 | .main-m { 222 | display: none; 223 | } 224 | .main-m .no-post { 225 | text-align: center; 226 | font-size: 14px; 227 | } -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 59 |
60 | 61 | 62 |
63 | 67 |
68 | 69 | 70 | 71 | 72 | 73 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | = 2 || $page >= 2 ) { 18 | echo ' – ' . sprintf( __('Page %s','ipop'), max( $paged, $page ) ); 19 | } 20 | } 21 | 22 | function page_number() { 23 | global $page, $paged; 24 | if ( $paged >= 2 || $page >= 2 ) { 25 | echo ' – ' . sprintf( __('Page %s','ipop'), max( $paged, $page ) ); 26 | } 27 | } 28 | 29 | // 设定摘要长度 30 | function new_excerpt_length($length) { 31 | return 500; 32 | } 33 | add_filter('excerpt_length', 'new_excerpt_length'); 34 | 35 | // 自定义头像 36 | require('admin/avatar/wp-user-profile-avatar.php'); 37 | 38 | // 获取用户头像 39 | function get_user_avatar() { 40 | global $current_user; 41 | get_currentuserinfo(); 42 | return get_avatar($current_user -> ID, 400); 43 | } 44 | 45 | // 获取用户昵称 46 | function get_user_name() { 47 | global $current_user, $display_name; 48 | get_currentuserinfo(); 49 | echo $current_user -> display_name; 50 | } 51 | 52 | // 注册菜单 53 | register_nav_menus( array( 54 | 'pc' => 'PC端', 55 | 'mobile' => '移动端', 56 | ) ); 57 | 58 | // 电脑端菜单 59 | function get_menu() { 60 | wp_nav_menu( array( 61 | 'theme_location' => 'pc', 62 | 'container_id' => 'menu', 63 | 'container_class' => 'menu', 64 | 'menu_id' => 'item', 65 | 'menu_class' => 'item', 66 | 'fallback_cb' => 'nav_fallback' 67 | ) ); 68 | } 69 | 70 | function nav_fallback() { 71 | if(is_home()) { 72 | echo ''; 77 | } else { 78 | echo ''; 83 | } 84 | } 85 | 86 | // 移动端菜单 87 | function get_menu_m() { 88 | wp_nav_menu( array( 89 | 'theme_location' => 'mobile', 90 | 'container_id' => 'nav-m', 91 | 'container_class' => 'nav-m', 92 | 'menu_id' => 'item-m', 93 | 'menu_class' => 'item-m', 94 | 'fallback_cb' => 'nav_fallback_m' 95 | ) ); 96 | } 97 | 98 | function nav_fallback_m() { 99 | if(is_home()) { 100 | echo ''; 105 | } else { 106 | echo ''; 111 | } 112 | } 113 | 114 | // 移除分类 115 | require_once('functions/remove-category.php'); 116 | 117 | // 特色图 118 | if(function_exists('add_theme_support')) { 119 | add_theme_support('post-thumbnails',array('post','page')); 120 | } 121 | 122 | // 默认封面图 123 | function default_pic() { 124 | $default_pic = get_template_directory_uri() . '/static/images/default-pic.png'; 125 | return $default_pic; 126 | } 127 | 128 | //获取文章第一张图片 129 | function catch_that_image() { 130 | error_reporting(0); 131 | global $post, $posts; 132 | $first_img = ''; 133 | ob_start(); 134 | ob_end_clean(); 135 | $output = preg_match_all('//i', $post->post_content, $matches); 136 | $first_img = $matches [1] [0]; 137 | if(empty($first_img)){ 138 | if(get_option("random_pic")) { 139 | $first_img = get_option("random_pic"); 140 | } else { 141 | $first_img = default_pic(); 142 | } 143 | 144 | } 145 | return $first_img; 146 | } 147 | 148 | // 显示文章浏览次数 149 | function getPostViews($postID) { 150 | $count_key = 'post_views_count'; 151 | $count = get_post_meta ( $postID, $count_key, true ); 152 | if ($count == '') { 153 | delete_post_meta ( $postID, $count_key ); 154 | add_post_meta ( $postID, $count_key, '0' ); 155 | return "0"; 156 | } 157 | return $count . ''; 158 | } 159 | function setPostViews($postID) { 160 | $count_key = 'post_views_count'; 161 | $count = get_post_meta ( $postID, $count_key, true ); 162 | if ($count == '') { 163 | $count = 0; 164 | delete_post_meta ( $postID, $count_key ); 165 | add_post_meta ( $postID, $count_key, '0' ); 166 | } else { 167 | $count ++; 168 | update_post_meta ( $postID, $count_key, $count ); 169 | } 170 | } 171 | 172 | // 主题后台设置 173 | add_action('admin_menu', 'ipop_set'); 174 | function ipop_set(){ 175 | add_menu_page( 176 | __('iPop Settings','ipop'), 177 | __('iPop Settings','ipop'), 178 | 'edit_themes', 179 | 'ipop_opt', 180 | 'ipop_opt');} 181 | function ipop_opt(){ 182 | require get_template_directory()."/admin/option.php"; 183 | } 184 | 185 | // 分页第一页返回首页 186 | $current_url = home_url(add_query_arg(array())); 187 | $home_page_1 = home_url() . '/page/1'; 188 | if($current_url == $home_page_1) { 189 | wp_redirect(home_url()); 190 | } 191 | 192 | //搜索时排除页面 193 | function exclude_page() { 194 | global $post; 195 | if ($post->post_type == 'page') { 196 | return true; 197 | } else { 198 | return false; 199 | } 200 | } 201 | 202 | //禁止空搜索 203 | add_filter( 'request', 'uctheme_redirect_blank_search' ); 204 | function uctheme_redirect_blank_search( $query_variables ) { 205 | if(isset($_GET['s']) && !is_admin()) { 206 | if(empty($_GET['s']) || ctype_space($_GET['s'])) { 207 | wp_redirect( home_url() ); 208 | exit; 209 | } 210 | } 211 | return $query_variables; 212 | } 213 | 214 | // 登出后重定向 215 | function auto_redirect_after_logout(){ 216 | wp_redirect(home_url()); 217 | exit(); 218 | } 219 | add_action('wp_logout','auto_redirect_after_logout'); 220 | 221 | 222 | // 主题翻译 223 | function ipop_setup() { 224 | load_theme_textdomain('ipop', get_template_directory() . '/languages'); 225 | } 226 | add_action('init', 'ipop_setup'); 227 | 228 | // 头像翻译 229 | function avatar_setup() { 230 | load_theme_textdomain('wp-user-profile-avatar', get_template_directory() . '/admin/avatar/languages'); 231 | } 232 | add_action('init', 'avatar_setup'); -------------------------------------------------------------------------------- /admin/avatar/assets/js/frontend-avatar.js: -------------------------------------------------------------------------------- 1 | var FrontendAvatar = function () { 2 | 3 | return { 4 | 5 | init: function() 6 | { 7 | jQuery( '#wp_user_profile_avatar_add' ).on('click', FrontendAvatar.actions.chooseAvatar); 8 | jQuery( '#wp_user_profile_avatar_remove' ).on('click', FrontendAvatar.actions.removeAvatar); 9 | jQuery( '#wp_user_profile_avatar_undo' ).on('click', FrontendAvatar.actions.undoAvatar); 10 | jQuery( '#wp_user_profile_avatar_update_profile' ).on('click', FrontendAvatar.actions.updateAvatar); 11 | }, 12 | 13 | actions: 14 | { 15 | /** 16 | * removeAvatar function. 17 | * 18 | * @access public 19 | * @param 20 | * @return 21 | * @since 1.0 22 | */ 23 | removeAvatar: function (event) 24 | { 25 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-error'); 26 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-success'); 27 | jQuery('#upload_avatar_responce').html(''); 28 | 29 | var form_data = jQuery('.update-user-profile-avatar').serialize(); 30 | 31 | var fd = new FormData(); 32 | fd.append("action", 'remove_user_avatar'); 33 | fd.append("form_data", form_data); 34 | fd.append("security", wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security); 35 | 36 | jQuery.ajax({ 37 | url: wp_user_profile_avatar_frontend_avatar.ajax_url, 38 | type: 'post', 39 | dataType: 'JSON', 40 | data: fd, 41 | processData: false, 42 | contentType: false, 43 | success: function (responce) 44 | { 45 | jQuery('#upload_avatar_responce').addClass(responce.class); 46 | jQuery('#upload_avatar_responce').html(responce.message); 47 | 48 | if(responce.class == 'wp-user-profile-avatar-success') 49 | { 50 | jQuery('#wp_user_profile_avatar_preview img').attr('src', responce.avatar_original); 51 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', responce.avatar_thumbnail); 52 | 53 | jQuery('.update-user-profile-avatar #wpupa_url').val(''); 54 | jQuery('.update-user-profile-avatar #wpupa_attachment_id').val(''); 55 | jQuery('#wp_user_profile_avatar_remove_button').hide(); 56 | } 57 | } 58 | }); 59 | }, 60 | 61 | /** 62 | * undoAvatar function. 63 | * 64 | * @access public 65 | * @param 66 | * @return 67 | * @since 1.0 68 | */ 69 | undoAvatar: function (event) 70 | { 71 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-error'); 72 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-success'); 73 | jQuery('#upload_avatar_responce').html(''); 74 | 75 | var form_data = jQuery('.update-user-profile-avatar').serialize(); 76 | 77 | var fd = new FormData(); 78 | fd.append("action", 'undo_user_avatar'); 79 | fd.append("form_data", form_data); 80 | fd.append("security", wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security); 81 | 82 | jQuery.ajax({ 83 | url: wp_user_profile_avatar_frontend_avatar.ajax_url, 84 | type: 'post', 85 | dataType: 'JSON', 86 | data: fd, 87 | processData: false, 88 | contentType: false, 89 | success: function (responce) 90 | { 91 | jQuery('#upload_avatar_responce').addClass(responce.class); 92 | jQuery('#upload_avatar_responce').html(responce.message); 93 | 94 | if(responce.class == 'wp-user-profile-avatar-success') 95 | { 96 | jQuery('#wp_user_profile_avatar_preview img').attr('src', responce.avatar_original); 97 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', responce.avatar_thumbnail); 98 | 99 | jQuery('#wp_user_profile_avatar_undo_button').hide(); 100 | } 101 | } 102 | }); 103 | }, 104 | 105 | /** 106 | * updateAvatar function. 107 | * 108 | * @access public 109 | * @param 110 | * @return 111 | * @since 1.0 112 | */ 113 | updateAvatar: function (event) 114 | { 115 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-error'); 116 | jQuery('#upload_avatar_responce').removeClass('wp-user-profile-avatar-success'); 117 | jQuery('#upload_avatar_responce').html(''); 118 | 119 | var form_data = jQuery('.update-user-profile-avatar').serialize(); 120 | 121 | var fd = new FormData(); 122 | fd.append("user-avatar", jQuery('.wp-user-profile-avatar-image')[0].files[0]); 123 | fd.append("action", 'update_user_avatar'); 124 | fd.append("form_data", form_data); 125 | fd.append("security", wp_user_profile_avatar_frontend_avatar.wp_user_profile_avatar_security); 126 | 127 | jQuery.ajax({ 128 | url: wp_user_profile_avatar_frontend_avatar.ajax_url, 129 | type: 'post', 130 | dataType: 'JSON', 131 | data: fd, 132 | processData: false, 133 | contentType: false, 134 | success: function (responce) 135 | { 136 | jQuery('#upload_avatar_responce').addClass(responce.class); 137 | jQuery('#upload_avatar_responce').html(responce.message); 138 | 139 | if(responce.class == 'wp-user-profile-avatar-success') 140 | { 141 | jQuery('#wp_user_profile_avatar_preview img').attr('src', responce.avatar_original); 142 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', responce.avatar_thumbnail); 143 | 144 | jQuery('#wp_user_profile_avatar_undo_button').show(); 145 | } 146 | } 147 | }); 148 | 149 | }, 150 | 151 | } /* end of action */ 152 | 153 | }; /* enf of return */ 154 | 155 | }; /* end of class */ 156 | 157 | FrontendAvatar = FrontendAvatar(); 158 | 159 | jQuery(document).ready(function($) 160 | { 161 | FrontendAvatar.init(); 162 | }); 163 | -------------------------------------------------------------------------------- /static/css/header.css: -------------------------------------------------------------------------------- 1 | .headroom { 2 | transition: var(--tr3); 3 | } 4 | .headroom--pinned { 5 | transform: translateY(0%); 6 | } 7 | .headroom--unpinned { 8 | transform: translateY(-100%); 9 | } 10 | 11 | .header { 12 | display: block; 13 | width: 100%; 14 | height: 90px; 15 | position: fixed; 16 | top: 0; 17 | padding: 20px 20px 0 20px; 18 | z-index: 10; 19 | } 20 | .navbar { 21 | width: 100%; 22 | height: 100%; 23 | background-color: var(--bgc-filter); 24 | -webkit-backdrop-filter: blur(20px); 25 | backdrop-filter: blur(20px); 26 | border-radius: 10px; 27 | padding: 0 20px; 28 | display: flex; 29 | align-items: center; 30 | justify-content: space-between; 31 | transition: var(--tr3); 32 | } 33 | .navbar:hover { 34 | box-shadow: var(--box-hover); 35 | } 36 | .navbar .left { 37 | display: flex; 38 | align-items: center; 39 | width: calc(100% - 200px); 40 | /* overflow-X: auto; */ 41 | } 42 | .navbar .left::-webkit-scrollbar { 43 | width: 0; 44 | height: 0; 45 | } 46 | .navbar .left .logo { 47 | margin-right: 20px; 48 | } 49 | .navbar .left img { 50 | width: 32px; 51 | height: 32px; 52 | vertical-align: middle; 53 | } 54 | 55 | .navbar .left .nav .item { 56 | display: flex; 57 | position: relative; 58 | } 59 | .navbar .left .nav .item .menu-block { 60 | opacity: 0; 61 | background: var(--bgc-sub); 62 | position: absolute; 63 | height: 100%; 64 | border-radius: var(--radius-sub); 65 | z-index: 1; 66 | transition: all .15s; 67 | } 68 | .navbar .left .nav .item > li { 69 | margin-right: 10px; 70 | position: relative; 71 | } 72 | .navbar .left .nav .item > li:last-child { 73 | margin-right: 0; 74 | } 75 | .navbar .left .nav .item > li > a { 76 | position: relative; 77 | display: flex; 78 | align-items: center; 79 | padding: 5px 12px; 80 | border-radius: var(--radius-sub); 81 | color: var(--text); 82 | font-size: 14px; 83 | white-space: nowrap; 84 | transition: var(--tr3); 85 | z-index: 3; 86 | } 87 | .navbar .left .nav .item > li > a > i { 88 | margin-right: 5px; 89 | } 90 | .navbar .left .nav .item > .current-menu-item > a { 91 | background-color: var(--theme); 92 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 93 | color: var(--text-box); 94 | } 95 | .navbar .left .nav .item > .menu-item-has-children > a::after { 96 | display: inline-block; 97 | margin-left: 4px; 98 | content: '\e666'; 99 | font-family: iconfont; 100 | font-size: 12px; 101 | font-weight: 700; 102 | transition: var(--tr3); 103 | } 104 | .navbar .left .nav .item > .menu-item-has-children > a:hover::after { 105 | transform: rotate(-90deg); 106 | } 107 | .navbar .left .nav .item .menu-item-has-children .item-children-box { 108 | opacity: 0; 109 | visibility: hidden; 110 | position: absolute; 111 | transform: translate(-10px, 0); 112 | padding-top: 33.5px; 113 | transition: var(--tr3); 114 | } 115 | .navbar .left .nav .item .menu-item-has-children:hover .item-children-box { 116 | opacity: 1; 117 | visibility: visible; 118 | } 119 | 120 | .navbar .left .nav .item > .menu-item-has-children .item-children-box .item-children-box { 121 | display: none; 122 | } 123 | 124 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul { 125 | opacity: 0; 126 | visibility: hidden; 127 | transform: translateY(10px); 128 | padding: 8px; 129 | border-radius: var(--radius); 130 | background-color: var(--bgc); 131 | box-shadow: var(--box); 132 | overflow: hidden; 133 | transition: var(--tr3); 134 | } 135 | .navbar .left .nav .item .menu-item-has-children:hover .item-children-box ul { 136 | opacity: 1; 137 | visibility: visible; 138 | transform: translateY(0); 139 | } 140 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul li { 141 | /*margin-bottom: 5px;*/ 142 | transform: translateY(20px); 143 | transition: var(--tr6); 144 | } 145 | .navbar .left .nav .item .menu-item-has-children:hover .item-children-box ul li { 146 | transform: translateY(0); 147 | } 148 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul li:last-child { 149 | margin-bottom: 0; 150 | } 151 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul li a { 152 | display: block; 153 | padding: 5px 70px 5px 10px; 154 | font-size: 14px; 155 | color: var(--text); 156 | border-radius: var(--radius-sub); 157 | white-space: nowrap; 158 | transition: var(--tr1); 159 | } 160 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul li a:hover { 161 | background-color: var(--theme-sub-text); 162 | } 163 | .navbar .left .nav .item .menu-item-has-children .item-children-box ul .current-menu-item a { 164 | color: var(--text-box); 165 | background-color: var(--theme); 166 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 167 | } 168 | 169 | 170 | .navbar .right { 171 | height: 40px; 172 | position: relative; 173 | } 174 | .navbar .right .user { 175 | width: 180px; 176 | display: flex; 177 | align-items: center; 178 | justify-content: right; 179 | cursor: pointer; 180 | } 181 | .navbar .right .visitor { 182 | width: auto; 183 | } 184 | .navbar .right .user p { 185 | color: var(--text); 186 | margin-right: 10px; 187 | overflow: hidden; 188 | text-overflow: ellipsis; 189 | white-space: nowrap; 190 | } 191 | .navbar .right .user p::-webkit-scrollbar { 192 | width: 0; 193 | height: 0; 194 | } 195 | .navbar .right .user img { 196 | width: 40px; 197 | height: 40px; 198 | border-radius: 50%; 199 | vertical-align: middle; 200 | } 201 | .navbar .right .menu { 202 | position: absolute; 203 | right: -20px; 204 | visibility: hidden; 205 | opacity: 0; 206 | transform: translateY(5px); 207 | transition: var(--tr3); 208 | } 209 | 210 | .navbar .right .user:hover ~ .menu, 211 | .navbar .right .menu:hover { 212 | visibility: visible; 213 | opacity: 1; 214 | transform: translateY(0); 215 | } 216 | 217 | .navbar .right .menu .box { 218 | margin-top: 30px; 219 | padding: 8px; 220 | border-radius: var(--radius); 221 | background-color: var(--bgc); 222 | box-shadow: var(--box); 223 | overflow: hidden; 224 | } 225 | .navbar .right .menu .box li { 226 | display: block; 227 | /*margin-bottom: 5px;*/ 228 | visibility: hidden; 229 | opacity: 0; 230 | transform: translateY(20px); 231 | transition: var(--tr6); 232 | } 233 | .navbar .right .user:hover ~ .menu .box li, 234 | .navbar .right .menu:hover .box li { 235 | visibility: visible; 236 | opacity: 1; 237 | transform: translateY(0); 238 | } 239 | 240 | .navbar .right .menu .box li:last-child { 241 | margin-bottom: 0; 242 | } 243 | .navbar .right .menu .box .search-btn, 244 | .navbar .right .menu .box .search-btn2 { 245 | cursor: pointer; 246 | } 247 | .navbar .right .menu .box a { 248 | display: block; 249 | padding: 5px 10px; 250 | border-radius: var(--radius-sub); 251 | position: relative; 252 | font-size: 14px; 253 | color: var(--text); 254 | display: flex; 255 | align-items: center; 256 | width: 150px; 257 | } 258 | .navbar .right .menu .box a span { 259 | font-size: 12px; 260 | color: var(--text); 261 | } 262 | .navbar .right .menu .box a span:last-child { 263 | position: absolute; 264 | right: 10px; 265 | } 266 | .navbar .right .menu .box a:hover, 267 | .navbar .right .menu .box a:hover span { 268 | color: var(--text-box); 269 | } 270 | .navbar .right .menu .box a span:first-child { 271 | margin-right: 5px; 272 | } 273 | .navbar .right .menu .box .search-btn:hover, 274 | .navbar .right .menu .box .setting:hover, 275 | .navbar .right .menu .box .login:hover { 276 | background-color: var(--theme); 277 | background: linear-gradient(to right, var(--theme), var(--theme-sub)); 278 | } 279 | .navbar .right .menu .box .logout:hover { 280 | background-color: var(--danger); 281 | } 282 | 283 | /* 未开启登录导航栏右侧 */ 284 | .navbar .right .hide-login { 285 | height: 100%; 286 | display: flex; 287 | align-items: center; 288 | } 289 | .navbar .right .hide-login .search-btn { 290 | cursor: pointer; 291 | color: var(--text); 292 | font-size: 14px; 293 | padding: 5px 12px; 294 | border-radius: var(--radius-sub); 295 | transition: var(--tr3); 296 | } 297 | .navbar .right .hide-login .search-btn:hover { 298 | background-color: var(--bgc-sub); 299 | } 300 | .navbar .right .hide-login .search-btn span { 301 | margin-right: 5px; 302 | font-size: 13px; 303 | } 304 | 305 | /* 移动端 */ 306 | .header-m, 307 | .menu-m, 308 | .menu-mask { 309 | display: none; 310 | } -------------------------------------------------------------------------------- /admin/avatar/languages/wp-user-profile-avatar.pot: -------------------------------------------------------------------------------- 1 | #, fuzzy 2 | msgid "" 3 | msgstr "" 4 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 | "Project-Id-Version: WP User Profile Avatar\n" 6 | "POT-Creation-Date: 2020-05-15 22:57+0200\n" 7 | "PO-Revision-Date: 2020-05-15 22:57+0200\n" 8 | "Last-Translator: \n" 9 | "Language-Team: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Generator: Poedit 2.3.1\n" 14 | "X-Poedit-Basepath: ..\n" 15 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 | "X-Poedit-WPHeader: wp-user-profile-avatar.php\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 19 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 20 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 23 | 24 | #: admin/templates/shortcode-popup.php:3 25 | msgid "User Avatar" 26 | msgstr "" 27 | 28 | #: admin/templates/shortcode-popup.php:4 29 | msgid "Upload Avatar" 30 | msgstr "" 31 | 32 | #: admin/templates/shortcode-popup.php:13 33 | msgid "User Name" 34 | msgstr "" 35 | 36 | #: admin/templates/shortcode-popup.php:16 37 | msgid "Select User" 38 | msgstr "" 39 | 40 | #: admin/templates/shortcode-popup.php:26 41 | msgid "Size" 42 | msgstr "" 43 | 44 | #: admin/templates/shortcode-popup.php:29 45 | #: admin/templates/shortcode-popup.php:43 46 | #: admin/templates/shortcode-popup.php:56 47 | msgid "None" 48 | msgstr "" 49 | 50 | #: admin/templates/shortcode-popup.php:36 51 | msgid "size parameter only work for uploaded avatar not with custom url." 52 | msgstr "" 53 | 54 | #: admin/templates/shortcode-popup.php:40 55 | msgid "Alignment" 56 | msgstr "" 57 | 58 | #: admin/templates/shortcode-popup.php:53 59 | msgid "Link To" 60 | msgstr "" 61 | 62 | #: admin/templates/shortcode-popup.php:63 63 | msgid "Add custom URL" 64 | msgstr "" 65 | 66 | #: admin/templates/shortcode-popup.php:67 67 | msgid "Open link in a new window" 68 | msgstr "" 69 | 70 | #: admin/templates/shortcode-popup.php:73 71 | msgid "Caption" 72 | msgstr "" 73 | 74 | #: admin/templates/shortcode-popup.php:82 75 | #: admin/templates/shortcode-popup.php:101 76 | msgid "Insert Shortcode" 77 | msgstr "" 78 | 79 | #: admin/templates/shortcode-popup.php:93 80 | msgid "Shortcode" 81 | msgstr "" 82 | 83 | #: admin/wp-user-profile-avatar-admin.php:52 84 | msgid "Profile Avatar Settings" 85 | msgstr "" 86 | 87 | #. Plugin Name of the plugin/theme 88 | #. Description of the plugin/theme 89 | #: admin/wp-user-profile-avatar-admin.php:71 90 | #: admin/wp-user-profile-avatar-admin.php:72 91 | #: admin/wp-user-profile-avatar-admin.php:108 92 | #: admin/wp-user-profile-avatar-settings.php:49 93 | #: admin/wp-user-profile-avatar-settings.php:115 94 | msgid "WP User Profile Avatar" 95 | msgstr "" 96 | 97 | #: admin/wp-user-profile-avatar-admin.php:74 wp-user-profile-avatar.php:159 98 | msgid "Choose Image: Default Avatar" 99 | msgstr "" 100 | 101 | #: admin/wp-user-profile-avatar-admin.php:113 102 | msgid "Image" 103 | msgstr "" 104 | 105 | #: admin/wp-user-profile-avatar-admin.php:120 templates/wp-avatar-upload.php:16 106 | msgid "OR Upload Image" 107 | msgstr "" 108 | 109 | #: admin/wp-user-profile-avatar-admin.php:123 110 | #: admin/wp-user-profile-avatar-settings.php:125 111 | msgid "Choose Image" 112 | msgstr "" 113 | 114 | #: admin/wp-user-profile-avatar-admin.php:142 templates/wp-avatar-upload.php:39 115 | msgid "Original Size" 116 | msgstr "" 117 | 118 | #: admin/wp-user-profile-avatar-admin.php:146 templates/wp-avatar-upload.php:43 119 | #: wp-user-profile-avatar-functions.php:316 120 | msgid "Thumbnail" 121 | msgstr "" 122 | 123 | #: admin/wp-user-profile-avatar-admin.php:149 templates/wp-avatar-upload.php:46 124 | msgid "Remove Image" 125 | msgstr "" 126 | 127 | #: admin/wp-user-profile-avatar-admin.php:152 128 | #: admin/wp-user-profile-avatar-settings.php:127 129 | #: templates/wp-avatar-upload.php:49 130 | msgid "Undo" 131 | msgstr "" 132 | 133 | #: admin/wp-user-profile-avatar-settings.php:58 134 | msgid "Avatar Visibility" 135 | msgstr "" 136 | 137 | #: admin/wp-user-profile-avatar-settings.php:62 138 | msgid "Show Avatars" 139 | msgstr "" 140 | 141 | #: admin/wp-user-profile-avatar-settings.php:64 142 | msgid "" 143 | "If it is unchecked then it will not show the user avatar at profile and " 144 | "frontend side." 145 | msgstr "" 146 | 147 | #: admin/wp-user-profile-avatar-settings.php:70 wp-user-profile-avatar.php:181 148 | msgid "Settings" 149 | msgstr "" 150 | 151 | #: admin/wp-user-profile-avatar-settings.php:74 152 | msgid "Add shortcode avatar button to Visual Editor" 153 | msgstr "" 154 | 155 | #: admin/wp-user-profile-avatar-settings.php:80 156 | msgid "Allow Contributors & Subscribers to upload avatars" 157 | msgstr "" 158 | 159 | #: admin/wp-user-profile-avatar-settings.php:86 160 | msgid "Disable Gravatar and use own custom avatars" 161 | msgstr "" 162 | 163 | #: admin/wp-user-profile-avatar-settings.php:95 164 | #: admin/wp-user-profile-avatar-settings.php:98 165 | msgid "Avatar Rating" 166 | msgstr "" 167 | 168 | #: admin/wp-user-profile-avatar-settings.php:108 169 | #: admin/wp-user-profile-avatar-settings.php:111 170 | msgid "Default Avatar" 171 | msgstr "" 172 | 173 | #: admin/wp-user-profile-avatar-settings.php:112 174 | msgid "" 175 | "For users without a custom avatar of their own, you can either display a " 176 | "generic logo or a generated one based on their e-mail address." 177 | msgstr "" 178 | 179 | #: admin/wp-user-profile-avatar-settings.php:126 180 | msgid "Remove" 181 | msgstr "" 182 | 183 | #: admin/wp-user-profile-avatar-settings.php:148 184 | msgid "Save Changes" 185 | msgstr "" 186 | 187 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:83 188 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:98 189 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:108 190 | msgid "ERROR: " 191 | msgstr "" 192 | 193 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:83 194 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:98 195 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:108 196 | msgid "" 197 | "You do not have enough priviledge to access this page. Please login to " 198 | "continue." 199 | msgstr "" 200 | 201 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:197 202 | msgid "Error! Select Image" 203 | msgstr "" 204 | 205 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:204 206 | msgid "Successfully Updated Avatar" 207 | msgstr "" 208 | 209 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:237 210 | msgid "Successfully Removed Avatar" 211 | msgstr "" 212 | 213 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:277 214 | msgid "Successfully Undo Avatar" 215 | msgstr "" 216 | 217 | #: templates/wp-avatar-upload.php:56 218 | msgid "Update Profile" 219 | msgstr "" 220 | 221 | #: wp-user-profile-avatar-functions.php:13 222 | msgid "G — Suitable for all audiences" 223 | msgstr "" 224 | 225 | #: wp-user-profile-avatar-functions.php:14 226 | msgid "PG — Possibly offensive, usually for audiences 13 and above" 227 | msgstr "" 228 | 229 | #: wp-user-profile-avatar-functions.php:15 230 | msgid "R — Intended for adult audiences above 17" 231 | msgstr "" 232 | 233 | #: wp-user-profile-avatar-functions.php:16 234 | msgid "X — Even more mature than above" 235 | msgstr "" 236 | 237 | #: wp-user-profile-avatar-functions.php:32 238 | msgid "Mystery Man" 239 | msgstr "" 240 | 241 | #: wp-user-profile-avatar-functions.php:33 242 | msgid "Blank" 243 | msgstr "" 244 | 245 | #: wp-user-profile-avatar-functions.php:34 246 | msgid "Gravatar Logo" 247 | msgstr "" 248 | 249 | #: wp-user-profile-avatar-functions.php:35 250 | msgid "Identicon (Generated)" 251 | msgstr "" 252 | 253 | #: wp-user-profile-avatar-functions.php:36 254 | msgid "Wavatar (Generated)" 255 | msgstr "" 256 | 257 | #: wp-user-profile-avatar-functions.php:37 258 | msgid "MonsterID (Generated)" 259 | msgstr "" 260 | 261 | #: wp-user-profile-avatar-functions.php:38 262 | msgid "Retro (Generated)" 263 | msgstr "" 264 | 265 | #: wp-user-profile-avatar-functions.php:313 266 | msgid "Original" 267 | msgstr "" 268 | 269 | #: wp-user-profile-avatar-functions.php:314 270 | msgid "Large" 271 | msgstr "" 272 | 273 | #: wp-user-profile-avatar-functions.php:315 274 | msgid "Medium" 275 | msgstr "" 276 | 277 | #: wp-user-profile-avatar-functions.php:332 278 | msgid "Center" 279 | msgstr "" 280 | 281 | #: wp-user-profile-avatar-functions.php:333 282 | msgid "Left" 283 | msgstr "" 284 | 285 | #: wp-user-profile-avatar-functions.php:334 286 | msgid "Right" 287 | msgstr "" 288 | 289 | #: wp-user-profile-avatar-functions.php:350 290 | msgid "Image File" 291 | msgstr "" 292 | 293 | #: wp-user-profile-avatar-functions.php:351 294 | msgid "Attachment Page" 295 | msgstr "" 296 | 297 | #: wp-user-profile-avatar-functions.php:352 298 | msgid "Custom URL" 299 | msgstr "" 300 | 301 | #. Plugin URI of the plugin/theme 302 | msgid "https://www.wp-eventmanager.com/" 303 | msgstr "" 304 | 305 | #. Author of the plugin/theme 306 | msgid "WP Event Manager" 307 | msgstr "" 308 | 309 | #. Author URI of the plugin/theme 310 | msgid "https://www.wp-eventmanager.com" 311 | msgstr "" 312 | -------------------------------------------------------------------------------- /admin/avatar/languages/zh_CN.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: WP User Profile Avatar\n" 4 | "POT-Creation-Date: 2022-08-05 13:46+0800\n" 5 | "PO-Revision-Date: 2022-08-05 13:47+0800\n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: zh_CN\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=1; plural=0;\n" 13 | "X-Generator: Poedit 2.1\n" 14 | "X-Poedit-Basepath: ..\n" 15 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 | "X-Poedit-WPHeader: wp-user-profile-avatar.php\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 19 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 20 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 23 | 24 | #: admin/templates/shortcode-popup.php:3 25 | msgid "User Avatar" 26 | msgstr "用户头像" 27 | 28 | #: admin/templates/shortcode-popup.php:4 29 | msgid "Upload Avatar" 30 | msgstr "上传头像" 31 | 32 | #: admin/templates/shortcode-popup.php:13 33 | msgid "User Name" 34 | msgstr "用户名" 35 | 36 | #: admin/templates/shortcode-popup.php:16 37 | msgid "Select User" 38 | msgstr "选择用户" 39 | 40 | #: admin/templates/shortcode-popup.php:26 41 | msgid "Size" 42 | msgstr "尺寸" 43 | 44 | #: admin/templates/shortcode-popup.php:29 45 | #: admin/templates/shortcode-popup.php:43 46 | #: admin/templates/shortcode-popup.php:56 47 | msgid "None" 48 | msgstr "无" 49 | 50 | #: admin/templates/shortcode-popup.php:36 51 | msgid "size parameter only work for uploaded avatar not with custom url." 52 | msgstr "大小参数只适用于上传的头像,而不是自定义url。" 53 | 54 | #: admin/templates/shortcode-popup.php:40 55 | msgid "Alignment" 56 | msgstr "对齐" 57 | 58 | #: admin/templates/shortcode-popup.php:53 59 | msgid "Link To" 60 | msgstr "链接到" 61 | 62 | #: admin/templates/shortcode-popup.php:63 63 | msgid "Add custom URL" 64 | msgstr "添加自定义URL" 65 | 66 | #: admin/templates/shortcode-popup.php:67 67 | msgid "Open link in a new window" 68 | msgstr "在新窗口中打开链接" 69 | 70 | #: admin/templates/shortcode-popup.php:73 71 | msgid "Caption" 72 | msgstr "标题" 73 | 74 | #: admin/templates/shortcode-popup.php:82 75 | #: admin/templates/shortcode-popup.php:101 76 | msgid "Insert Shortcode" 77 | msgstr "插入简码" 78 | 79 | #: admin/templates/shortcode-popup.php:93 80 | msgid "Shortcode" 81 | msgstr "简码" 82 | 83 | #: admin/wp-user-profile-avatar-admin.php:53 84 | msgid "Profile Avatar Settings" 85 | msgstr "头像设置" 86 | 87 | #. Plugin Name of the plugin/theme 88 | #. Description of the plugin/theme 89 | #: admin/wp-user-profile-avatar-admin.php:72 90 | #: admin/wp-user-profile-avatar-admin.php:73 91 | #: admin/wp-user-profile-avatar-admin.php:109 92 | #: admin/wp-user-profile-avatar-settings.php:47 93 | #: admin/wp-user-profile-avatar-settings.php:113 94 | msgid "WP User Profile Avatar" 95 | msgstr "用户头像" 96 | 97 | #: admin/wp-user-profile-avatar-admin.php:75 wp-user-profile-avatar.php:145 98 | msgid "Choose Image: Default Avatar" 99 | msgstr "选择图片:默认头像" 100 | 101 | #: admin/wp-user-profile-avatar-admin.php:114 102 | msgid "Image" 103 | msgstr "图片" 104 | 105 | #: admin/wp-user-profile-avatar-admin.php:118 106 | msgid "Enter Image URL" 107 | msgstr "输入图片URL" 108 | 109 | #: admin/wp-user-profile-avatar-admin.php:121 templates/wp-avatar-upload.php:16 110 | msgid "OR Upload Image" 111 | msgstr "或上传图片" 112 | 113 | #: admin/wp-user-profile-avatar-admin.php:124 114 | #: admin/wp-user-profile-avatar-settings.php:123 115 | msgid "Choose Image" 116 | msgstr "选择图片" 117 | 118 | #: admin/wp-user-profile-avatar-admin.php:143 templates/wp-avatar-upload.php:39 119 | msgid "Original Size" 120 | msgstr "原始大小" 121 | 122 | #: admin/wp-user-profile-avatar-admin.php:147 templates/wp-avatar-upload.php:43 123 | #: wp-user-profile-avatar-functions.php:322 124 | msgid "Thumbnail" 125 | msgstr "缩略图" 126 | 127 | #: admin/wp-user-profile-avatar-admin.php:150 templates/wp-avatar-upload.php:46 128 | msgid "Remove Image" 129 | msgstr "移除图片" 130 | 131 | #: admin/wp-user-profile-avatar-admin.php:153 132 | #: admin/wp-user-profile-avatar-settings.php:125 133 | #: templates/wp-avatar-upload.php:49 134 | msgid "Undo" 135 | msgstr "撤销" 136 | 137 | #: admin/wp-user-profile-avatar-settings.php:56 138 | msgid "Avatar Visibility" 139 | msgstr "头像可见性" 140 | 141 | #: admin/wp-user-profile-avatar-settings.php:60 142 | msgid "Show Avatars" 143 | msgstr "显示头像" 144 | 145 | #: admin/wp-user-profile-avatar-settings.php:62 146 | msgid "" 147 | "If it is unchecked then it will not show the user avatar at profile and " 148 | "frontend side." 149 | msgstr "如果未选中,则不会在配置文件和前端显示用户头像。" 150 | 151 | #: admin/wp-user-profile-avatar-settings.php:68 wp-user-profile-avatar.php:167 152 | msgid "Settings" 153 | msgstr "设置" 154 | 155 | #: admin/wp-user-profile-avatar-settings.php:72 156 | msgid "Add shortcode avatar button to Visual Editor" 157 | msgstr "将简码头像按钮添加到可视化编辑器" 158 | 159 | #: admin/wp-user-profile-avatar-settings.php:78 160 | msgid "Allow Contributors & Subscribers to upload avatars" 161 | msgstr "允许贡献者和订阅者上传头像" 162 | 163 | #: admin/wp-user-profile-avatar-settings.php:84 164 | msgid "Disable all default gravatar and set own custom default avatar." 165 | msgstr "禁用Gravatar并使用自己的自定义头像(自定义头像必须勾选)" 166 | 167 | #: admin/wp-user-profile-avatar-settings.php:93 168 | #: admin/wp-user-profile-avatar-settings.php:96 169 | msgid "Avatar Rating" 170 | msgstr "头像等级" 171 | 172 | #: admin/wp-user-profile-avatar-settings.php:106 173 | #: admin/wp-user-profile-avatar-settings.php:109 174 | msgid "Default Avatar" 175 | msgstr "默认头像" 176 | 177 | #: admin/wp-user-profile-avatar-settings.php:110 178 | msgid "" 179 | "For users without a custom avatar of their own, you can either display a " 180 | "generic logo or a generated one based on their e-mail address." 181 | msgstr "" 182 | "对于没有自己的自定义头像的用户,可以显示通用的徽标,也可以根据他们的电子邮件" 183 | "地址生成徽标。" 184 | 185 | #: admin/wp-user-profile-avatar-settings.php:124 186 | msgid "Remove" 187 | msgstr "移除" 188 | 189 | #: admin/wp-user-profile-avatar-settings.php:146 190 | msgid "Save Changes" 191 | msgstr "保存设置" 192 | 193 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:83 194 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:98 195 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:108 196 | msgid "ERROR: " 197 | msgstr "错误: " 198 | 199 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:83 200 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:98 201 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:108 202 | msgid "" 203 | "You do not have enough priviledge to access this page. Please login to " 204 | "continue." 205 | msgstr "您没有足够的权限访问此页。请登录继续。" 206 | 207 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:208 208 | msgid "Error! Select Image" 209 | msgstr "错误!选择图像" 210 | 211 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:215 212 | msgid "Successfully Updated Avatar" 213 | msgstr "头像更新成功" 214 | 215 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:256 216 | msgid "Successfully Removed Avatar" 217 | msgstr "头像移除成功" 218 | 219 | #: shortcodes/wp-user-profile-avatar-shortcodes.php:301 220 | msgid "Successfully Undo Avatar" 221 | msgstr "头像撤销成功" 222 | 223 | #: templates/wp-avatar-upload.php:56 224 | msgid "Update Profile" 225 | msgstr "更新资料" 226 | 227 | #: wp-user-profile-avatar-functions.php:13 228 | msgid "G — Suitable for all audiences" 229 | msgstr "G — 适合任何年龄的访客查看" 230 | 231 | #: wp-user-profile-avatar-functions.php:14 232 | msgid "PG — Possibly offensive, usually for audiences 13 and above" 233 | msgstr "PG — 可能有争议的头像,只适合13岁以上读者查看" 234 | 235 | #: wp-user-profile-avatar-functions.php:15 236 | msgid "R — Intended for adult audiences above 17" 237 | msgstr "R — 成人级,只适合17岁以上成人查看" 238 | 239 | #: wp-user-profile-avatar-functions.php:16 240 | msgid "X — Even more mature than above" 241 | msgstr "X — 最高等级,不适合大多数人查看" 242 | 243 | #: wp-user-profile-avatar-functions.php:32 244 | msgid "Mystery Man" 245 | msgstr "神秘人" 246 | 247 | #: wp-user-profile-avatar-functions.php:33 248 | msgid "Blank" 249 | msgstr "空白" 250 | 251 | #: wp-user-profile-avatar-functions.php:34 252 | msgid "Gravatar Logo" 253 | msgstr "Gravatar标志" 254 | 255 | #: wp-user-profile-avatar-functions.php:35 256 | msgid "Identicon (Generated)" 257 | msgstr "抽象图形(自动生成)" 258 | 259 | #: wp-user-profile-avatar-functions.php:36 260 | msgid "Wavatar (Generated)" 261 | msgstr "Wavatar(自动生成)" 262 | 263 | #: wp-user-profile-avatar-functions.php:37 264 | msgid "MonsterID (Generated)" 265 | msgstr "小怪物(自动生成)" 266 | 267 | #: wp-user-profile-avatar-functions.php:38 268 | msgid "Retro (Generated)" 269 | msgstr "复古(自动生成)" 270 | 271 | #: wp-user-profile-avatar-functions.php:319 272 | msgid "Original" 273 | msgstr "" 274 | 275 | #: wp-user-profile-avatar-functions.php:320 276 | msgid "Large" 277 | msgstr "" 278 | 279 | #: wp-user-profile-avatar-functions.php:321 280 | msgid "Medium" 281 | msgstr "" 282 | 283 | #: wp-user-profile-avatar-functions.php:338 284 | msgid "Center" 285 | msgstr "" 286 | 287 | #: wp-user-profile-avatar-functions.php:339 288 | msgid "Left" 289 | msgstr "" 290 | 291 | #: wp-user-profile-avatar-functions.php:340 292 | msgid "Right" 293 | msgstr "" 294 | 295 | #: wp-user-profile-avatar-functions.php:356 296 | msgid "Image File" 297 | msgstr "" 298 | 299 | #: wp-user-profile-avatar-functions.php:357 300 | msgid "Attachment Page" 301 | msgstr "" 302 | 303 | #: wp-user-profile-avatar-functions.php:358 304 | msgid "Custom URL" 305 | msgstr "" 306 | 307 | #. Plugin URI of the plugin/theme 308 | msgid "https://www.wp-eventmanager.com/" 309 | msgstr "" 310 | 311 | #. Author of the plugin/theme 312 | msgid "WP Event Manager" 313 | msgstr "" 314 | 315 | #. Author URI of the plugin/theme 316 | msgid "https://www.wp-eventmanager.com" 317 | msgstr "" 318 | -------------------------------------------------------------------------------- /admin/avatar/admin/wp-user-profile-avatar-settings.php: -------------------------------------------------------------------------------- 1 | 'admin']); 44 | ?> 45 | 46 |
47 |

48 | 49 | 50 | 158 | 159 |
51 |
52 | 53 | 54 | 55 | 56 | 57 | 65 | 66 | 67 | 68 | 69 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 103 | 104 | 105 | 106 | 107 | 142 | 143 | 144 | 145 | 148 | 149 | 152 | 153 | 154 |
58 |
59 | 62 |

63 |
64 |
70 |
71 | 74 |
75 | 76 |
77 | 80 |
81 | 82 |
83 | 86 |
87 |
95 |
96 | 97 | $rating) : ?> 98 | 99 |
100 | 101 |
102 |
108 |
109 | 110 |
111 | 112 | 113 |
114 | 115 | 122 |

123 | 124 | 125 | 126 | 127 |

128 | 129 | 130 | $label) : ?> 131 | 132 | 133 | 134 |
137 | 138 | 139 | 140 |
141 |
146 | 147 | 150 | 151 |
155 | 156 |
157 |
160 |
161 | 162 | settings_page = new WPUPA_Settings(); 20 | 21 | $wpupa_tinymce = get_option('wpupa_tinymce'); 22 | if($wpupa_tinymce) 23 | { 24 | add_action('init', array( $this, 'wpupa_add_buttons')); 25 | } 26 | 27 | add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 ); 28 | add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 29 | 30 | add_action( 'show_user_profile', array( $this, 'wpupa_add_fields' ) ); 31 | add_action( 'edit_user_profile', array( $this, 'wpupa_add_fields' ) ); 32 | 33 | add_action( 'personal_options_update', array( $this, 'wpupa_save_fields' ) ); 34 | add_action( 'edit_user_profile_update', array( $this, 'wpupa_save_fields' ) ); 35 | 36 | add_action( 'admin_init', array($this,'allow_contributor_subscriber_uploads')); 37 | 38 | add_action('init', array( $this, 'thickbox_model_init')); 39 | add_action('wp_ajax_thickbox_model_view', array( $this, 'thickbox_model_view')); 40 | add_action('wp_ajax_nopriv_thickbox_model_view', array( $this, 'thickbox_model_view')); 41 | } 42 | 43 | /** 44 | * admin_menu function. 45 | * 46 | * @access public 47 | * @param 48 | * @return 49 | * @since 1.0 50 | */ 51 | public function admin_menu() { 52 | 53 | add_submenu_page( 'users.php', __( 'Profile Avatar Settings', 'wp-user-profile-avatar' ), __( 'Profile Avatar Settings', 'wp-user-profile-avatar' ), 'manage_options', 'wp-user-profile-avatar-settings', array( $this->settings_page, 'settings' ) ); 54 | } 55 | 56 | /** 57 | * admin_enqueue_scripts function. 58 | * 59 | * @access public 60 | * @param 61 | * @return 62 | * @since 1.0 63 | */ 64 | public function admin_enqueue_scripts() 65 | { 66 | wp_register_style( 'wp-user-profile-avatar-backend', get_template_directory_uri().'/admin/avatar/assets/css/backend.min.css' ); 67 | 68 | wp_register_script( 'wp-user-profile-avatar-admin-avatar', get_template_directory_uri().'/admin/avatar/assets/js/admin-avatar.min.js', array( 'jquery' ), WPUPA_VERSION, true); 69 | 70 | wp_localize_script( 'wp-user-profile-avatar-admin-avatar', 'wp_user_profile_avatar_admin_avatar', array( 71 | 'thinkbox_ajax_url' => admin_url( 'admin-ajax.php' ) . '?height=600&width=770&action=thickbox_model_view', 72 | 'thinkbox_title' => __( 'WP User Profile Avatar', 'wp-user-profile-avatar'), 73 | 'icon_title' => __( 'WP User Profile Avatar', 'wp-user-profile-avatar'), 74 | 'wp_user_profile_avatar_security' => wp_create_nonce( "_nonce_user_profile_avatar_security" ), 75 | 'media_box_title' => __( 'Choose Image: Default Avatar', 'wp-user-profile-avatar'), 76 | 'default_avatar' => get_template_directory_uri().'/admin/avatar/assets/images/wp-user-thumbnail.png', 77 | ) 78 | ); 79 | 80 | wp_enqueue_style( 'wp-user-profile-avatar-backend' ); 81 | wp_enqueue_script( 'wp-user-profile-avatar-admin-avatar' ); 82 | } 83 | 84 | /** 85 | * wpupa_add_fields function. 86 | * 87 | * @access public 88 | * @param $user 89 | * @return 90 | * @since 1.0 91 | */ 92 | public function wpupa_add_fields( $user ) 93 | { 94 | wp_enqueue_media(); 95 | 96 | wp_enqueue_style( 'wp-user-profile-avatar-backend'); 97 | 98 | wp_enqueue_script( 'wp-user-profile-avatar-admin-avatar' ); 99 | 100 | $user_id = $user->ID; 101 | 102 | $wpupa_original = get_wpupa_url($user_id, ['size' => 'original']); 103 | $wpupa_thumbnail = get_wpupa_url($user_id, ['size' => 'thumbnail']); 104 | 105 | $wpupa_attachment_id = get_user_meta($user_id, '_wpupa_attachment_id', true); 106 | $wpupa_url = get_user_meta($user_id, '_wpupa_url', true); 107 | 108 | ?> 109 |

110 | 111 | 112 | 113 | 116 | 157 | 158 |
114 | 115 | 117 |

118 | 119 |

120 | 121 |

122 | 123 |

124 | 125 | 126 |

127 | 128 | 140 |
141 |

142 | 143 | 144 |

145 |

146 | 147 | 148 |

149 |

150 | 151 |

152 |

153 | 154 |

155 |
156 |
159 | add_cap('upload_files'); 295 | } 296 | else 297 | { 298 | $contributor->remove_cap('upload_files'); 299 | } 300 | } 301 | 302 | if(!empty($subscriber)) 303 | { 304 | if($wpupa_allow_upload) 305 | { 306 | $subscriber->add_cap('upload_files'); 307 | } 308 | else 309 | { 310 | $subscriber->remove_cap('upload_files'); 311 | } 312 | } 313 | 314 | } 315 | 316 | 317 | } 318 | 319 | new WPUPA_Admin(); 320 | 321 | 322 | 323 | -------------------------------------------------------------------------------- /admin/avatar/assets/js/admin-avatar.js: -------------------------------------------------------------------------------- 1 | var AdminAvatar = function () { 2 | 3 | return { 4 | 5 | init: function() 6 | { 7 | jQuery( '#wp_user_profile_avatar_add' ).on('click', AdminAvatar.actions.chooseAvatar); 8 | jQuery( '#wp_user_profile_avatar_remove' ).on('click', AdminAvatar.actions.removeAvatar); 9 | jQuery( '#wp_user_profile_avatar_undo' ).on('click', AdminAvatar.actions.undoAvatar); 10 | 11 | jQuery( 'body' ).on('click', '#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .nav-tab-wrapper a', AdminAvatar.actions.showShortcodeAvatarTab); 12 | 13 | jQuery( 'body' ).on('change', '#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_link_to', AdminAvatar.actions.imageLinkTo); 14 | 15 | jQuery( 'body' ).on('click', '#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #user_avatar_form_btn', AdminAvatar.actions.addUserAvatarShortcode); 16 | 17 | jQuery( 'body' ).on('click', '#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_upload_avatar #upload_avatar_form_btn', AdminAvatar.actions.addUploadAvatarShortcode); 18 | 19 | if(typeof(tinymce) != "undefined") 20 | { 21 | tinymce.PluginManager.add('wp_user_profile_avatar_shortcodes', function( editor, url ) { 22 | editor.addButton('wp_user_profile_avatar_shortcodes', { 23 | title: wp_user_profile_avatar_admin_avatar.icon_title, 24 | classes: 'thickbox', 25 | image: wp_user_profile_avatar_admin_avatar.default_avatar, 26 | icon: false, 27 | onclick: function() { 28 | 29 | } 30 | }); 31 | }); 32 | 33 | setTimeout(function(){ 34 | jQuery('.mce-thickbox button').remove(); 35 | jQuery('.mce-thickbox').html(''); 36 | }, 1500); 37 | } 38 | 39 | }, 40 | 41 | 42 | actions: 43 | { 44 | /** 45 | * showShortcodeAvatarTab function. 46 | * 47 | * @access public 48 | * @param 49 | * @return 50 | * @since 1.0 51 | */ 52 | showShortcodeAvatarTab: function (event) 53 | { 54 | jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left .settings-panel').hide(); 55 | 56 | var id = jQuery(event.target).attr('href'); 57 | 58 | jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap .admin-setting-left ' + id).show(); 59 | }, 60 | 61 | /** 62 | * imageLinkTo function. 63 | * 64 | * @access public 65 | * @param 66 | * @return 67 | * @since 1.0 68 | */ 69 | imageLinkTo: function (event) 70 | { 71 | var link_to = jQuery(event.target).val(); 72 | 73 | if(link_to == 'custom') 74 | { 75 | jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to').attr('type','text'); 76 | } 77 | else 78 | { 79 | jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to').attr('type','hidden'); 80 | } 81 | }, 82 | 83 | /** 84 | * addUserAvatarShortcode function. 85 | * 86 | * @access public 87 | * @param 88 | * @return 89 | * @since 1.0 90 | */ 91 | addUserAvatarShortcode: function (event) 92 | { 93 | var user_id = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_user_id').val(); 94 | 95 | var size = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_size').val(); 96 | 97 | var align = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_alignment').val(); 98 | 99 | var link = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_link_to').val(); 100 | 101 | var custom_link = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_custom_link_to').val(); 102 | 103 | var target = ''; 104 | if(jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_open_new_window').prop("checked") == true) 105 | { 106 | target = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_open_new_window').val(); 107 | } 108 | 109 | var caption = jQuery('body').find('#TB_window #TB_ajaxContent .wp-user-profile-avatar-shortcode-wrap #settings_user_avatar #wp_image_caption').val(); 110 | 111 | var user_tag = (user_id != "") ? ' user_id="' + user_id + '"' : ""; 112 | 113 | var size_tag = (size != "") ? ' size="' + size + '"' : ""; 114 | 115 | var align_tag = (align != "") ? ' align="' + align + '"' : ""; 116 | 117 | var link_tag = (link != "" && link != 'custom' && custom_link == "") ? ' link="' + link + '"' : ""; 118 | link_tag = (custom_link != "") ? ' link="' + custom_link + '"' : link_tag; 119 | 120 | var target_tag = (target != "") ? ' target="' + target + '"' : ""; 121 | 122 | var shortcode = "

[user_profile_avatar" + user_tag + size_tag + align_tag + link_tag + target_tag + "] " + caption + " [/user_profile_avatar]

"; 123 | 124 | tinymce.activeEditor.insertContent(shortcode); 125 | //editor.insertContent('[wdm_shortcode]'); 126 | 127 | jQuery('body').find('#TB_window #TB_title #TB_closeAjaxWindow #TB_closeWindowButton').trigger("click"); 128 | }, 129 | 130 | /** 131 | * addUploadAvatarShortcode function. 132 | * 133 | * @access public 134 | * @param 135 | * @return 136 | * @since 1.0 137 | */ 138 | addUploadAvatarShortcode: function (event) 139 | { 140 | var shortcode = "

[user_profile_avatar_upload]

"; 141 | 142 | tinymce.activeEditor.insertContent(shortcode); 143 | //editor.insertContent('[wdm_shortcode]'); 144 | 145 | jQuery('body').find('#TB_window #TB_title #TB_closeAjaxWindow #TB_closeWindowButton').trigger("click"); 146 | }, 147 | 148 | /** 149 | * chooseAvatar function. 150 | * 151 | * @access public 152 | * @param 153 | * @return 154 | * @since 1.0 155 | */ 156 | chooseAvatar: function (event) 157 | { 158 | var upload = wp.media({ 159 | library: { 160 | type: 'image' 161 | }, 162 | title: wp_user_profile_avatar_admin_avatar.media_box_title, /*Title for Media Box*/ 163 | multiple: false /*For limiting multiple image*/ 164 | }) 165 | .on('select', function () 166 | { 167 | var select = upload.state().get('selection'); 168 | var attach = select.first().toJSON(); 169 | 170 | jQuery('#wp_user_profile_avatar_preview img').attr('src', attach.url); 171 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', attach.url); 172 | jQuery('#wpupa_attachment_id').attr('value', attach.id); 173 | jQuery('#wp_user_profile_avatar_radio').trigger('click'); 174 | jQuery('#wp_user_profile_avatar_undo_button').show(); 175 | }) 176 | .open(); 177 | }, 178 | 179 | /** 180 | * removeAvatar function. 181 | * 182 | * @access public 183 | * @param 184 | * @return 185 | * @since 1.0 186 | */ 187 | removeAvatar: function (event) 188 | { 189 | jQuery('#wp_user_profile_avatar_preview img').attr('src', wp_user_profile_avatar_admin_avatar.default_avatar); 190 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', wp_user_profile_avatar_admin_avatar.default_avatar); 191 | jQuery('#wpupa_attachment_id').attr('value', ''); 192 | jQuery('#wpupa_url').attr('value', ''); 193 | 194 | jQuery('#wp_user_profile_avatar_remove').hide(); 195 | }, 196 | 197 | /** 198 | * undoAvatar function. 199 | * 200 | * @access public 201 | * @param 202 | * @return 203 | * @since 1.0 204 | */ 205 | undoAvatar: function (event) 206 | { 207 | jQuery('#wp_user_profile_avatar_preview img').attr('src', wp_user_profile_avatar_admin_avatar.default_avatar); 208 | jQuery('#wp_user_profile_avatar_thumbnail img').attr('src', wp_user_profile_avatar_admin_avatar.default_avatar); 209 | jQuery('#wpupa_attachment_id').attr('value', ''); 210 | 211 | jQuery('#wp_user_profile_avatar_undo_button').hide(); 212 | }, 213 | 214 | } /* end of action */ 215 | 216 | }; /* enf of return */ 217 | 218 | }; /* end of class */ 219 | 220 | AdminAvatar = AdminAvatar(); 221 | 222 | jQuery(document).ready(function($) 223 | { 224 | AdminAvatar.init(); 225 | }); 226 | -------------------------------------------------------------------------------- /static/strawberry/variables.scss: -------------------------------------------------------------------------------- 1 | $icomoon-font-family: "StrawberryIcon-Free" !default; 2 | $icomoon-font-path: "fonts" !default; 3 | 4 | $czs-about: "\e900"; 5 | $czs-about-l: "\e901"; 6 | $czs-add: "\e902"; 7 | $czs-airplane: "\e903"; 8 | $czs-airplane-l: "\e904"; 9 | $czs-alipay: "\e905"; 10 | $czs-analysis: "\e906"; 11 | $czs-android: "\e907"; 12 | $czs-angle-down-l: "\e908"; 13 | $czs-angle-left-l: "\e909"; 14 | $czs-angle-right-l: "\e90a"; 15 | $czs-angle-up-l: "\e90b"; 16 | $czs-apple: "\e90c"; 17 | $czs-arrow-down-l: "\e90d"; 18 | $czs-arrow-up-l: "\e90e"; 19 | $czs-baiduwangpan: "\e90f"; 20 | $czs-bar-chart: "\e910"; 21 | $czs-bar-chart-l: "\e911"; 22 | $czs-battery: "\e912"; 23 | $czs-battery-l: "\e913"; 24 | $czs-bell: "\e914"; 25 | $czs-bell-l: "\e915"; 26 | $czs-bevel: "\e916"; 27 | $czs-bilibili: "\e917"; 28 | $czs-bitcoin: "\e918"; 29 | $czs-blackboard: "\e919"; 30 | $czs-blackboard-l: "\e91a"; 31 | $czs-block: "\e91b"; 32 | $czs-block-l: "\e91c"; 33 | $czs-bluetooth: "\e91d"; 34 | $czs-bluetooth-l: "\e91e"; 35 | $czs-board: "\e91f"; 36 | $czs-board-l: "\e920"; 37 | $czs-book: "\e921"; 38 | $czs-book-l: "\e922"; 39 | $czs-bookmark: "\e923"; 40 | $czs-bookmark-l: "\e924"; 41 | $czs-box: "\e925"; 42 | $czs-box-l: "\e926"; 43 | $czs-briefcase: "\e927"; 44 | $czs-briefcase-l: "\e928"; 45 | $czs-brush: "\e929"; 46 | $czs-brush-l: "\e92a"; 47 | $czs-bug: "\e92b"; 48 | $czs-bug-l: "\e92c"; 49 | $czs-building: "\e92d"; 50 | $czs-building-l: "\e92e"; 51 | $czs-buy: "\e92f"; 52 | $czs-buy-l: "\e930"; 53 | $czs-calculator: "\e931"; 54 | $czs-calculator-l: "\e932"; 55 | $czs-calendar: "\e933"; 56 | $czs-calendar-l: "\e934"; 57 | $czs-camber: "\e935"; 58 | $czs-camber-l: "\e936"; 59 | $czs-camber-o: "\e937"; 60 | $czs-camera: "\e938"; 61 | $czs-camera-l: "\e939"; 62 | $czs-category-l: "\e93a"; 63 | $czs-certificate: "\e93b"; 64 | $czs-certificate-l: "\e93c"; 65 | $czs-chemistry: "\e93d"; 66 | $czs-chemistry-l: "\e93e"; 67 | $czs-choose-list-l: "\e93f"; 68 | $czs-chrome: "\e940"; 69 | $czs-circle: "\e941"; 70 | $czs-circle-l: "\e942"; 71 | $czs-circle-o: "\e943"; 72 | $czs-clip-l: "\e944"; 73 | $czs-clock: "\e945"; 74 | $czs-clock-l: "\e946"; 75 | $czs-close-l: "\e947"; 76 | $czs-clothes: "\e948"; 77 | $czs-clothes-l: "\e949"; 78 | $czs-cloud: "\e94a"; 79 | $czs-cloud-download-l: "\e94b"; 80 | $czs-cloud-l: "\e94c"; 81 | $czs-cloud-upload-l: "\e94d"; 82 | $czs-code-branch: "\e94e"; 83 | $czs-code-file: "\e94f"; 84 | $czs-code-file-l: "\e950"; 85 | $czs-code-fork: "\e951"; 86 | $czs-code-l: "\e952"; 87 | $czs-coin: "\e953"; 88 | $czs-coin-l: "\e954"; 89 | $czs-collection: "\e955"; 90 | $czs-come-l: "\e956"; 91 | $czs-command: "\e957"; 92 | $czs-command-l: "\e958"; 93 | $czs-commed2: "\e959"; 94 | $czs-commed2-l: "\e95a"; 95 | $czs-comment: "\e95b"; 96 | $czs-comment-l: "\e95c"; 97 | $czs-computer: "\e95d"; 98 | $czs-computer-l: "\e95e"; 99 | $czs-configuration: "\e95f"; 100 | $czs-configuration-l: "\e960"; 101 | $czs-control: "\e961"; 102 | $czs-control-rank: "\e962"; 103 | $czs-credit-card: "\e963"; 104 | $czs-credit-card-l: "\e964"; 105 | $czs-crown: "\e965"; 106 | $czs-crown-l: "\e966"; 107 | $czs-css3: "\e967"; 108 | $czs-cup: "\e968"; 109 | $czs-cup-l: "\e969"; 110 | $czs-dashboard: "\e96a"; 111 | $czs-dashboard-l: "\e96b"; 112 | $czs-diamond: "\e96c"; 113 | $czs-diamond-l: "\e96d"; 114 | $czs-doc-edit: "\e96e"; 115 | $czs-doc-edit-l: "\e96f"; 116 | $czs-doc-file: "\e970"; 117 | $czs-doc-file-l: "\e971"; 118 | $czs-download-l: "\e972"; 119 | $czs-dribbble: "\e973"; 120 | $czs-dropbox: "\e974"; 121 | $czs-earth: "\e975"; 122 | $czs-earth-l: "\e976"; 123 | $czs-eye: "\e977"; 124 | $czs-eye-l: "\e978"; 125 | $czs-face: "\e979"; 126 | $czs-facebook: "\e97a"; 127 | $czs-face-l: "\e97b"; 128 | $czs-file: "\e97c"; 129 | $czs-file-l: "\e97d"; 130 | $czs-film: "\e97e"; 131 | $czs-film-l: "\e97f"; 132 | $czs-fire-l: "\e980"; 133 | $czs-firewall: "\e981"; 134 | $czs-firewall-l: "\e982"; 135 | $czs-folder: "\e983"; 136 | $czs-folder-l: "\e984"; 137 | $czs-forum: "\e985"; 138 | $czs-forum-l: "\e986"; 139 | $czs-game: "\e987"; 140 | $czs-game-l: "\e988"; 141 | $czs-gift: "\e989"; 142 | $czs-gift-l: "\e98a"; 143 | $czs-github: "\e98b"; 144 | $czs-github-logo: "\e98c"; 145 | $czs-Google: "\e98d"; 146 | $czs-greatwall: "\e98e"; 147 | $czs-hacker: "\e98f"; 148 | $czs-hacker-l: "\e990"; 149 | $czs-hammer: "\e991"; 150 | $czs-hammer-l: "\e992"; 151 | $czs-hand-bevel: "\e993"; 152 | $czs-hand-button: "\e994"; 153 | $czs-hande-vertical: "\e995"; 154 | $czs-hand-gather: "\e996"; 155 | $czs-hand-grasp: "\e997"; 156 | $czs-hand-horizontal: "\e998"; 157 | $czs-hand-pointer: "\e999"; 158 | $czs-hand-slide: "\e99a"; 159 | $czs-hand-stop: "\e99b"; 160 | $czs-hand-touch: "\e99c"; 161 | $czs-hdmi: "\e99d"; 162 | $czs-hdmi-l: "\e99e"; 163 | $czs-headset: "\e99f"; 164 | $czs-headset-l: "\e9a0"; 165 | $czs-heart: "\e9a1"; 166 | $czs-heart-l: "\e9a2"; 167 | $czs-home: "\e9a3"; 168 | $czs-home-l: "\e9a4"; 169 | $czs-html5: "\e9a5"; 170 | $czs-image: "\e9a6"; 171 | $czs-image-l: "\e9a7"; 172 | $czs-inbox: "\e9a8"; 173 | $czs-inbox-l: "\e9a9"; 174 | $czs-Instagram: "\e9aa"; 175 | $czs-key: "\e9ab"; 176 | $czs-keyboard: "\e9ac"; 177 | $czs-keyboard-l: "\e9ad"; 178 | $czs-key-l: "\e9ae"; 179 | $czs-label-info: "\e9af"; 180 | $czs-label-info-l: "\e9b0"; 181 | $czs-laptop: "\e9b1"; 182 | $czs-laptop-l: "\e9b2"; 183 | $czs-layers: "\e9b3"; 184 | $czs-layout-grid: "\e9b4"; 185 | $czs-layout-grids: "\e9b5"; 186 | $czs-layout-list: "\e9b6"; 187 | $czs-light: "\e9b7"; 188 | $czs-light-flash-l: "\e9b8"; 189 | $czs-light-l: "\e9b9"; 190 | $czs-lightning: "\e9ba"; 191 | $czs-lightning-l: "\e9bb"; 192 | $czs-link-l: "\e9bc"; 193 | $czs-linux: "\e9bd"; 194 | $czs-list-clipboard: "\e9be"; 195 | $czs-list-clipboard-l: "\e9bf"; 196 | $czs-location: "\e9c0"; 197 | $czs-location-l: "\e9c1"; 198 | $czs-lock: "\e9c2"; 199 | $czs-lock-l: "\e9c3"; 200 | $czs-map: "\e9c4"; 201 | $czs-map-l: "\e9c5"; 202 | $czs-medal: "\e9c6"; 203 | $czs-medal-l: "\e9c7"; 204 | $czs-menu-l: "\e9c8"; 205 | $czs-message: "\e9c9"; 206 | $czs-message-l: "\e9ca"; 207 | $czs-microchip: "\e9cb"; 208 | $czs-microchip-l: "\e9cc"; 209 | $czs-microphone: "\e9cd"; 210 | $czs-microphone-l: "\e9ce"; 211 | $czs-microsoft: "\e9cf"; 212 | $czs-mobile: "\e9d0"; 213 | $czs-mobile-l: "\e9d1"; 214 | $czs-moments: "\e9d2"; 215 | $czs-money: "\e9d3"; 216 | $czs-moon: "\e9d4"; 217 | $czs-moon-l: "\e9d5"; 218 | $czs-more: "\e9d6"; 219 | $czs-mouse: "\e9d7"; 220 | $czs-mouse-l: "\e9d8"; 221 | $czs-music: "\e9d9"; 222 | $czs-music-file: "\e9da"; 223 | $czs-music-file-l: "\e9db"; 224 | $czs-music-l: "\e9dc"; 225 | $czs-music-note: "\e9dd"; 226 | $czs-music-note-l: "\e9de"; 227 | $czs-nail: "\e9df"; 228 | $czs-nail-l: "\e9e0"; 229 | $czs-network: "\e9e1"; 230 | $czs-network-l: "\e9e2"; 231 | $czs-new: "\e9e3"; 232 | $czs-new-l: "\e9e4"; 233 | $czs-newspaper: "\e9e5"; 234 | $czs-newspaper-l: "\e9e6"; 235 | $czs-operation: "\e9e7"; 236 | $czs-operation-l: "\e9e8"; 237 | $czs-out-l: "\e9e9"; 238 | $czs-pad: "\e9ea"; 239 | $czs-pad-l: "\e9eb"; 240 | $czs-paper: "\e9ec"; 241 | $czs-paper-l: "\e9ed"; 242 | $czs-paper-plane: "\e9ee"; 243 | $czs-paper-plane-l: "\e9ef"; 244 | $czs-pause-l: "\e9f0"; 245 | $czs-paypal: "\e9f1"; 246 | $czs-pen: "\e9f2"; 247 | $czs-pen-write: "\e9f3"; 248 | $czs-people: "\e9f4"; 249 | $czs-phone: "\e9f5"; 250 | $czs-phone-l: "\e9f6"; 251 | $czs-pinterest: "\e9f7"; 252 | $czs-play-l: "\e9f8"; 253 | $czs-plugin: "\e9f9"; 254 | $czs-pokemon-ball: "\e9fa"; 255 | $czs-port: "\e9fb"; 256 | $czs-port-l: "\e9fc"; 257 | $czs-printer: "\e9fd"; 258 | $czs-printer-l: "\e9fe"; 259 | $czs-product: "\e9ff"; 260 | $czs-program: "\ea00"; 261 | $czs-program-l: "\ea01"; 262 | $czs-qq: "\ea02"; 263 | $czs-qrcode-l: "\ea03"; 264 | $czs-quote-left: "\ea04"; 265 | $czs-quote-right: "\ea05"; 266 | $czs-qzone: "\ea06"; 267 | $czs-raspberry: "\ea07"; 268 | $czs-raspberry-l: "\ea08"; 269 | $czs-read: "\ea09"; 270 | $czs-read-l: "\ea0a"; 271 | $czs-red-envelope: "\ea0b"; 272 | $czs-renew: "\ea0c"; 273 | $czs-right-clipboard: "\ea0d"; 274 | $czs-right-clipboard-l: "\ea0e"; 275 | $czs-robot: "\ea0f"; 276 | $czs-robot2: "\ea10"; 277 | $czs-robot2-l: "\ea11"; 278 | $czs-robot-l: "\ea12"; 279 | $czs-rocket: "\ea13"; 280 | $czs-rocket-l: "\ea14"; 281 | $czs-rollerbrush: "\ea15"; 282 | $czs-rollerbrush-l: "\ea16"; 283 | $czs-router: "\ea17"; 284 | $czs-router-l: "\ea18"; 285 | $czs-rss: "\ea19"; 286 | $czs-ruler: "\ea1a"; 287 | $czs-ruler-l: "\ea1b"; 288 | $czs-save: "\ea1c"; 289 | $czs-save-l: "\ea1d"; 290 | $czs-scan-l: "\ea1e"; 291 | $czs-scissors: "\ea1f"; 292 | $czs-sdcard: "\ea20"; 293 | $czs-sdcard-l: "\ea21"; 294 | $czs-search-l: "\ea22"; 295 | $czs-server: "\ea23"; 296 | $czs-server-l: "\ea24"; 297 | $czs-servers: "\ea25"; 298 | $czs-setting: "\ea26"; 299 | $czs-setting-l: "\ea27"; 300 | $czs-share: "\ea28"; 301 | $czs-shield: "\ea29"; 302 | $czs-shield-l: "\ea2a"; 303 | $czs-shop: "\ea2b"; 304 | $czs-shop-l: "\ea2c"; 305 | $czs-shopping-cart: "\ea2d"; 306 | $czs-shopping-cart-l: "\ea2e"; 307 | $czs-site-folder: "\ea2f"; 308 | $czs-site-folder-l: "\ea30"; 309 | $czs-slider-l: "\ea31"; 310 | $czs-square: "\ea32"; 311 | $czs-square-l: "\ea33"; 312 | $czs-square-o: "\ea34"; 313 | $czs-star: "\ea35"; 314 | $czs-star-l: "\ea36"; 315 | $czs-steam: "\ea37"; 316 | $czs-storage: "\ea38"; 317 | $czs-storage-l: "\ea39"; 318 | $czs-sun: "\ea3a"; 319 | $czs-sun-l: "\ea3b"; 320 | $czs-sword: "\ea3c"; 321 | $czs-sword-l: "\ea3d"; 322 | $czs-tab: "\ea3e"; 323 | $czs-tab-l: "\ea3f"; 324 | $czs-tag: "\ea40"; 325 | $czs-tag-l: "\ea41"; 326 | $czs-taiji: "\ea42"; 327 | $czs-talk: "\ea43"; 328 | $czs-talk-l: "\ea44"; 329 | $czs-taobao: "\ea45"; 330 | $czs-telegram: "\ea46"; 331 | $czs-text-l: "\ea47"; 332 | $czs-thumbs-up: "\ea48"; 333 | $czs-thumbs-up-l: "\ea49"; 334 | $czs-ticket: "\ea4a"; 335 | $czs-ticket-l: "\ea4b"; 336 | $czs-time: "\ea4c"; 337 | $czs-time-l: "\ea4d"; 338 | $czs-tmall: "\ea4e"; 339 | $czs-transmission-l: "\ea4f"; 340 | $czs-transport: "\ea50"; 341 | $czs-trash: "\ea51"; 342 | $czs-trash-l: "\ea52"; 343 | $czs-triangle: "\ea53"; 344 | $czs-triangle-l: "\ea54"; 345 | $czs-triangle-o: "\ea55"; 346 | $czs-truck: "\ea56"; 347 | $czs-truck-l: "\ea57"; 348 | $czs-tv: "\ea58"; 349 | $czs-tv-l: "\ea59"; 350 | $czs-twitter: "\ea5a"; 351 | $czs-upload-l: "\ea5b"; 352 | $czs-usb: "\ea5c"; 353 | $czs-usb-l: "\ea5d"; 354 | $czs-user: "\ea5e"; 355 | $czs-user-l: "\ea5f"; 356 | $czs-v2ex: "\ea60"; 357 | $czs-video-camera: "\ea61"; 358 | $czs-video-camera-l: "\ea62"; 359 | $czs-video-file: "\ea63"; 360 | $czs-video-file-l: "\ea64"; 361 | $czs-vimeo: "\ea65"; 362 | $czs-volume: "\ea66"; 363 | $czs-volume-l: "\ea67"; 364 | $czs-volume-x-l: "\ea68"; 365 | $czs-warning: "\ea69"; 366 | $czs-warning-l: "\ea6a"; 367 | $czs-watch: "\ea6b"; 368 | $czs-watch-l: "\ea6c"; 369 | $czs-webcam: "\ea6d"; 370 | $czs-webcam-l: "\ea6e"; 371 | $czs-web-edit: "\ea6f"; 372 | $czs-web-edit-l: "\ea70"; 373 | $czs-weibo: "\ea71"; 374 | $czs-weixin: "\ea72"; 375 | $czs-weixinzhifu: "\ea73"; 376 | $czs-wifi: "\ea74"; 377 | $czs-wordpress: "\ea75"; 378 | $czs-wrench: "\ea76"; 379 | $czs-wrench-l: "\ea77"; 380 | $czs-write-l: "\ea78"; 381 | $czs-x-buy-l: "\ea79"; 382 | $czs-youtube: "\ea7a"; 383 | $czs-zhihu: "\ea7b"; 384 | $czs-zip-folder: "\ea7c"; 385 | $czs-zip-folder-l: "\ea7d"; 386 | 387 | -------------------------------------------------------------------------------- /static/iconfont/demo.css: -------------------------------------------------------------------------------- 1 | /* Logo 字体 */ 2 | @font-face { 3 | font-family: "iconfont logo"; 4 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); 5 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), 6 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), 7 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), 8 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); 9 | } 10 | 11 | .logo { 12 | font-family: "iconfont logo"; 13 | font-size: 160px; 14 | font-style: normal; 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | } 18 | 19 | /* tabs */ 20 | .nav-tabs { 21 | position: relative; 22 | } 23 | 24 | .nav-tabs .nav-more { 25 | position: absolute; 26 | right: 0; 27 | bottom: 0; 28 | height: 42px; 29 | line-height: 42px; 30 | color: #666; 31 | } 32 | 33 | #tabs { 34 | border-bottom: 1px solid #eee; 35 | } 36 | 37 | #tabs li { 38 | cursor: pointer; 39 | width: 100px; 40 | height: 40px; 41 | line-height: 40px; 42 | text-align: center; 43 | font-size: 16px; 44 | border-bottom: 2px solid transparent; 45 | position: relative; 46 | z-index: 1; 47 | margin-bottom: -1px; 48 | color: #666; 49 | } 50 | 51 | 52 | #tabs .active { 53 | border-bottom-color: #f00; 54 | color: #222; 55 | } 56 | 57 | .tab-container .content { 58 | display: none; 59 | } 60 | 61 | /* 页面布局 */ 62 | .main { 63 | padding: 30px 100px; 64 | width: 960px; 65 | margin: 0 auto; 66 | } 67 | 68 | .main .logo { 69 | color: #333; 70 | text-align: left; 71 | margin-bottom: 30px; 72 | line-height: 1; 73 | height: 110px; 74 | margin-top: -50px; 75 | overflow: hidden; 76 | *zoom: 1; 77 | } 78 | 79 | .main .logo a { 80 | font-size: 160px; 81 | color: #333; 82 | } 83 | 84 | .helps { 85 | margin-top: 40px; 86 | } 87 | 88 | .helps pre { 89 | padding: 20px; 90 | margin: 10px 0; 91 | border: solid 1px #e7e1cd; 92 | background-color: #fffdef; 93 | overflow: auto; 94 | } 95 | 96 | .icon_lists { 97 | width: 100% !important; 98 | overflow: hidden; 99 | *zoom: 1; 100 | } 101 | 102 | .icon_lists li { 103 | width: 100px; 104 | margin-bottom: 10px; 105 | margin-right: 20px; 106 | text-align: center; 107 | list-style: none !important; 108 | cursor: default; 109 | } 110 | 111 | .icon_lists li .code-name { 112 | line-height: 1.2; 113 | } 114 | 115 | .icon_lists .icon { 116 | display: block; 117 | height: 100px; 118 | line-height: 100px; 119 | font-size: 42px; 120 | margin: 10px auto; 121 | color: #333; 122 | -webkit-transition: font-size 0.25s linear, width 0.25s linear; 123 | -moz-transition: font-size 0.25s linear, width 0.25s linear; 124 | transition: font-size 0.25s linear, width 0.25s linear; 125 | } 126 | 127 | .icon_lists .icon:hover { 128 | font-size: 100px; 129 | } 130 | 131 | .icon_lists .svg-icon { 132 | /* 通过设置 font-size 来改变图标大小 */ 133 | width: 1em; 134 | /* 图标和文字相邻时,垂直对齐 */ 135 | vertical-align: -0.15em; 136 | /* 通过设置 color 来改变 SVG 的颜色/fill */ 137 | fill: currentColor; 138 | /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 139 | normalize.css 中也包含这行 */ 140 | overflow: hidden; 141 | } 142 | 143 | .icon_lists li .name, 144 | .icon_lists li .code-name { 145 | color: #666; 146 | } 147 | 148 | /* markdown 样式 */ 149 | .markdown { 150 | color: #666; 151 | font-size: 14px; 152 | line-height: 1.8; 153 | } 154 | 155 | .highlight { 156 | line-height: 1.5; 157 | } 158 | 159 | .markdown img { 160 | vertical-align: middle; 161 | max-width: 100%; 162 | } 163 | 164 | .markdown h1 { 165 | color: #404040; 166 | font-weight: 500; 167 | line-height: 40px; 168 | margin-bottom: 24px; 169 | } 170 | 171 | .markdown h2, 172 | .markdown h3, 173 | .markdown h4, 174 | .markdown h5, 175 | .markdown h6 { 176 | color: #404040; 177 | margin: 1.6em 0 0.6em 0; 178 | font-weight: 500; 179 | clear: both; 180 | } 181 | 182 | .markdown h1 { 183 | font-size: 28px; 184 | } 185 | 186 | .markdown h2 { 187 | font-size: 22px; 188 | } 189 | 190 | .markdown h3 { 191 | font-size: 16px; 192 | } 193 | 194 | .markdown h4 { 195 | font-size: 14px; 196 | } 197 | 198 | .markdown h5 { 199 | font-size: 12px; 200 | } 201 | 202 | .markdown h6 { 203 | font-size: 12px; 204 | } 205 | 206 | .markdown hr { 207 | height: 1px; 208 | border: 0; 209 | background: #e9e9e9; 210 | margin: 16px 0; 211 | clear: both; 212 | } 213 | 214 | .markdown p { 215 | margin: 1em 0; 216 | } 217 | 218 | .markdown>p, 219 | .markdown>blockquote, 220 | .markdown>.highlight, 221 | .markdown>ol, 222 | .markdown>ul { 223 | width: 80%; 224 | } 225 | 226 | .markdown ul>li { 227 | list-style: circle; 228 | } 229 | 230 | .markdown>ul li, 231 | .markdown blockquote ul>li { 232 | margin-left: 20px; 233 | padding-left: 4px; 234 | } 235 | 236 | .markdown>ul li p, 237 | .markdown>ol li p { 238 | margin: 0.6em 0; 239 | } 240 | 241 | .markdown ol>li { 242 | list-style: decimal; 243 | } 244 | 245 | .markdown>ol li, 246 | .markdown blockquote ol>li { 247 | margin-left: 20px; 248 | padding-left: 4px; 249 | } 250 | 251 | .markdown code { 252 | margin: 0 3px; 253 | padding: 0 5px; 254 | background: #eee; 255 | border-radius: 3px; 256 | } 257 | 258 | .markdown strong, 259 | .markdown b { 260 | font-weight: 600; 261 | } 262 | 263 | .markdown>table { 264 | border-collapse: collapse; 265 | border-spacing: 0px; 266 | empty-cells: show; 267 | border: 1px solid #e9e9e9; 268 | width: 95%; 269 | margin-bottom: 24px; 270 | } 271 | 272 | .markdown>table th { 273 | white-space: nowrap; 274 | color: #333; 275 | font-weight: 600; 276 | } 277 | 278 | .markdown>table th, 279 | .markdown>table td { 280 | border: 1px solid #e9e9e9; 281 | padding: 8px 16px; 282 | text-align: left; 283 | } 284 | 285 | .markdown>table th { 286 | background: #F7F7F7; 287 | } 288 | 289 | .markdown blockquote { 290 | font-size: 90%; 291 | color: #999; 292 | border-left: 4px solid #e9e9e9; 293 | padding-left: 0.8em; 294 | margin: 1em 0; 295 | } 296 | 297 | .markdown blockquote p { 298 | margin: 0; 299 | } 300 | 301 | .markdown .anchor { 302 | opacity: 0; 303 | transition: opacity 0.3s ease; 304 | margin-left: 8px; 305 | } 306 | 307 | .markdown .waiting { 308 | color: #ccc; 309 | } 310 | 311 | .markdown h1:hover .anchor, 312 | .markdown h2:hover .anchor, 313 | .markdown h3:hover .anchor, 314 | .markdown h4:hover .anchor, 315 | .markdown h5:hover .anchor, 316 | .markdown h6:hover .anchor { 317 | opacity: 1; 318 | display: inline-block; 319 | } 320 | 321 | .markdown>br, 322 | .markdown>p>br { 323 | clear: both; 324 | } 325 | 326 | 327 | .hljs { 328 | display: block; 329 | background: white; 330 | padding: 0.5em; 331 | color: #333333; 332 | overflow-x: auto; 333 | } 334 | 335 | .hljs-comment, 336 | .hljs-meta { 337 | color: #969896; 338 | } 339 | 340 | .hljs-string, 341 | .hljs-variable, 342 | .hljs-template-variable, 343 | .hljs-strong, 344 | .hljs-emphasis, 345 | .hljs-quote { 346 | color: #df5000; 347 | } 348 | 349 | .hljs-keyword, 350 | .hljs-selector-tag, 351 | .hljs-type { 352 | color: #a71d5d; 353 | } 354 | 355 | .hljs-literal, 356 | .hljs-symbol, 357 | .hljs-bullet, 358 | .hljs-attribute { 359 | color: #0086b3; 360 | } 361 | 362 | .hljs-section, 363 | .hljs-name { 364 | color: #63a35c; 365 | } 366 | 367 | .hljs-tag { 368 | color: #333333; 369 | } 370 | 371 | .hljs-title, 372 | .hljs-attr, 373 | .hljs-selector-id, 374 | .hljs-selector-class, 375 | .hljs-selector-attr, 376 | .hljs-selector-pseudo { 377 | color: #795da3; 378 | } 379 | 380 | .hljs-addition { 381 | color: #55a532; 382 | background-color: #eaffea; 383 | } 384 | 385 | .hljs-deletion { 386 | color: #bd2c00; 387 | background-color: #ffecec; 388 | } 389 | 390 | .hljs-link { 391 | text-decoration: underline; 392 | } 393 | 394 | /* 代码高亮 */ 395 | /* PrismJS 1.15.0 396 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ 397 | /** 398 | * prism.js default theme for JavaScript, CSS and HTML 399 | * Based on dabblet (http://dabblet.com) 400 | * @author Lea Verou 401 | */ 402 | code[class*="language-"], 403 | pre[class*="language-"] { 404 | color: black; 405 | background: none; 406 | text-shadow: 0 1px white; 407 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 408 | text-align: left; 409 | white-space: pre; 410 | word-spacing: normal; 411 | word-break: normal; 412 | word-wrap: normal; 413 | line-height: 1.5; 414 | 415 | -moz-tab-size: 4; 416 | -o-tab-size: 4; 417 | tab-size: 4; 418 | 419 | -webkit-hyphens: none; 420 | -moz-hyphens: none; 421 | -ms-hyphens: none; 422 | hyphens: none; 423 | } 424 | 425 | pre[class*="language-"]::-moz-selection, 426 | pre[class*="language-"] ::-moz-selection, 427 | code[class*="language-"]::-moz-selection, 428 | code[class*="language-"] ::-moz-selection { 429 | text-shadow: none; 430 | background: #b3d4fc; 431 | } 432 | 433 | pre[class*="language-"]::selection, 434 | pre[class*="language-"] ::selection, 435 | code[class*="language-"]::selection, 436 | code[class*="language-"] ::selection { 437 | text-shadow: none; 438 | background: #b3d4fc; 439 | } 440 | 441 | @media print { 442 | 443 | code[class*="language-"], 444 | pre[class*="language-"] { 445 | text-shadow: none; 446 | } 447 | } 448 | 449 | /* Code blocks */ 450 | pre[class*="language-"] { 451 | padding: 1em; 452 | margin: .5em 0; 453 | overflow: auto; 454 | } 455 | 456 | :not(pre)>code[class*="language-"], 457 | pre[class*="language-"] { 458 | background: #f5f2f0; 459 | } 460 | 461 | /* Inline code */ 462 | :not(pre)>code[class*="language-"] { 463 | padding: .1em; 464 | border-radius: .3em; 465 | white-space: normal; 466 | } 467 | 468 | .token.comment, 469 | .token.prolog, 470 | .token.doctype, 471 | .token.cdata { 472 | color: slategray; 473 | } 474 | 475 | .token.punctuation { 476 | color: #999; 477 | } 478 | 479 | .namespace { 480 | opacity: .7; 481 | } 482 | 483 | .token.property, 484 | .token.tag, 485 | .token.boolean, 486 | .token.number, 487 | .token.constant, 488 | .token.symbol, 489 | .token.deleted { 490 | color: #905; 491 | } 492 | 493 | .token.selector, 494 | .token.attr-name, 495 | .token.string, 496 | .token.char, 497 | .token.builtin, 498 | .token.inserted { 499 | color: #690; 500 | } 501 | 502 | .token.operator, 503 | .token.entity, 504 | .token.url, 505 | .language-css .token.string, 506 | .style .token.string { 507 | color: #9a6e3a; 508 | background: hsla(0, 0%, 100%, .5); 509 | } 510 | 511 | .token.atrule, 512 | .token.attr-value, 513 | .token.keyword { 514 | color: #07a; 515 | } 516 | 517 | .token.function, 518 | .token.class-name { 519 | color: #DD4A68; 520 | } 521 | 522 | .token.regex, 523 | .token.important, 524 | .token.variable { 525 | color: #e90; 526 | } 527 | 528 | .token.important, 529 | .token.bold { 530 | font-weight: bold; 531 | } 532 | 533 | .token.italic { 534 | font-style: italic; 535 | } 536 | 537 | .token.entity { 538 | cursor: help; 539 | } 540 | -------------------------------------------------------------------------------- /admin/avatar/shortcodes/wp-user-profile-avatar-shortcodes.php: -------------------------------------------------------------------------------- 1 | '', 38 | 'size' => 'thumbnail', 39 | 'align' => 'alignnone', 40 | 'link' => '#', 41 | 'target' => '_self', 42 | 43 | ), $atts ) ); 44 | 45 | ob_start(); 46 | 47 | $image_url = get_wpupa_url( $user_id, ['size' => $size ] ); 48 | 49 | if($link == 'image') { 50 | // Get image src 51 | $link = get_wpupa_url( $user_id, ['size' => 'original' ] ); 52 | } 53 | elseif($link == 'attachment') 54 | { 55 | // Get attachment URL 56 | $link = get_attachment_link(get_the_author_meta($wpdb->get_blog_prefix($blog_id).'user_avatar', $user_id)); 57 | } 58 | 59 | include_once (WPUPA_PLUGIN_DIR . '/templates/wp-user-avatar.php' ); 60 | 61 | return ob_get_clean(); 62 | 63 | } 64 | 65 | /** 66 | * user_profile_avatar_upload function. 67 | * 68 | * @access public 69 | * @param $atts, $content 70 | * @return 71 | * @since 1.0 72 | */ 73 | public function user_profile_avatar_upload($atts = [], $content = null) 74 | { 75 | extract( shortcode_atts( array( 76 | 77 | ), $atts ) ); 78 | 79 | ob_start(); 80 | 81 | if(!is_user_logged_in()) 82 | { 83 | echo '
' . __( 'ERROR: ', 'wp-event-manager-zoom' ) . '' . __( 'You do not have enough priviledge to access this page. Please login to continue.', 'wp-user-profile-avatar' ) . '
'; 84 | 85 | return false; 86 | } 87 | 88 | $wpupa_allow_upload = get_option('wpupa_allow_upload'); 89 | 90 | $user_id = get_current_user_id(); 91 | 92 | $user_data = get_userdata($user_id); 93 | 94 | if(in_array('contributor', $user_data->roles)) 95 | { 96 | if(empty($wpupa_allow_upload)) 97 | { 98 | echo '
' . __( 'ERROR: ', 'wp-event-manager-zoom' ) . '' . __( 'You do not have enough priviledge to access this page. Please login to continue.', 'wp-user-profile-avatar' ) . '
'; 99 | 100 | return false; 101 | } 102 | } 103 | 104 | if(in_array('subscriber', $user_data->roles)) 105 | { 106 | if(empty($wpupa_allow_upload)) 107 | { 108 | echo '
' . __( 'ERROR: ', 'wp-event-manager-zoom' ) . '' . __( 'You do not have enough priviledge to access this page. Please login to continue.', 'wp-user-profile-avatar' ) . '
'; 109 | 110 | return false; 111 | } 112 | } 113 | 114 | wp_enqueue_script( 'wp-user-profile-avatar-frontend-avatar' ); 115 | 116 | $wpupa_original = get_wpupa_url($user_id, ['size' => 'original']); 117 | $wpupa_thumbnail = get_wpupa_url($user_id, ['size' => 'thumbnail']); 118 | 119 | $wpupa_attachment_id = get_user_meta($user_id, '_wpupa_attachment_id', true); 120 | $wpupa_url = get_user_meta($user_id, '_wpupa_url', true); 121 | 122 | include_once (WPUPA_PLUGIN_DIR . '/templates/wp-avatar-upload.php' ); 123 | 124 | return ob_get_clean(); 125 | } 126 | 127 | /** 128 | * update_user_avatar function. 129 | * 130 | * @access public 131 | * @param 132 | * @return 133 | * @since 1.0 134 | */ 135 | public function update_user_avatar() 136 | { 137 | check_ajax_referer( '_nonce_user_profile_avatar_security', 'security' ); 138 | 139 | parse_str($_POST['form_data'], $form_data); 140 | 141 | //sanitize each of the values of form data 142 | $form_wpupa_url =esc_url_raw($form_data['wpupa_url']); 143 | $form_wpupa_attachment_id =absint($form_data['wpupa_attachment_id']); 144 | $user_id =absint($form_data['user_id']); 145 | 146 | 147 | $file = $_FILES['user-avatar']; 148 | 149 | if (isset($file) && !empty($file)) 150 | { 151 | 152 | $post_id = 0; 153 | 154 | //sanitize each of the values of file data 155 | $file_name=sanitize_file_name($file['name']); 156 | $file_type=sanitize_text_field($file['type']); 157 | $file_tmp_name=sanitize_text_field($file['tmp_name']); 158 | $file_size=absint($file['size']); 159 | 160 | // Upload file 161 | $overrides = array('test_form' => false); 162 | $uploaded_file = $this->handle_upload($file, $overrides); 163 | 164 | $attachment = array( 165 | 'post_title' => $file_name, 166 | 'post_content' => '', 167 | 'post_type' => 'attachment', 168 | 'post_parent' => null, // populated after inserting post 169 | 'post_mime_type' => $file_type, 170 | 'guid' => $uploaded_file['url'] 171 | ); 172 | 173 | $attachment['post_parent'] = $post_id; 174 | $attach_id = wp_insert_attachment($attachment, $uploaded_file['file'], $post_id); 175 | $attach_data = wp_generate_attachment_metadata($attach_id, $uploaded_file['file']); 176 | 177 | if(isset($user_id,$attach_id)) 178 | { 179 | $result = wp_update_attachment_metadata($attach_id, $attach_data); 180 | update_user_meta($user_id, '_wpupa_attachment_id', $attach_id); 181 | } 182 | } 183 | else 184 | { 185 | if(isset($user_id,$form_wpupa_attachment_id)) 186 | update_user_meta($user_id, '_wpupa_attachment_id', $form_wpupa_attachment_id); 187 | } 188 | 189 | if(isset($user_id,$form_wpupa_url)) 190 | update_user_meta($user_id, '_wpupa_url', $form_wpupa_url); 191 | 192 | if(!empty($form_wpupa_attachment_id) || $form_wpupa_url) 193 | { 194 | update_user_meta( $user_id, '_wpupa_default', 'wp_user_profile_avatar' ); 195 | } 196 | else 197 | { 198 | update_user_meta( $user_id, '_wpupa_default', '' ); 199 | } 200 | 201 | $wpupa_attachment_id = get_user_meta($user_id, '_wpupa_attachment_id', true); 202 | $wpupa_url = get_user_meta($user_id, '_wpupa_url', true); 203 | 204 | if( empty($wpupa_attachment_id) && empty($wpupa_url)) 205 | { 206 | $wpupa_original = ''; 207 | $wpupa_thumbnail = ''; 208 | $message = __( 'Error! Select Image', 'wp-user-profile-avatar'); 209 | $class = 'wp-user-profile-avatar-error'; 210 | } 211 | else 212 | { 213 | $wpupa_original = get_wpupa_url($user_id, ['size' => 'original']); 214 | $wpupa_thumbnail = get_wpupa_url($user_id, ['size' => 'thumbnail']); 215 | $message = __( 'Successfully Updated Avatar', 'wp-user-profile-avatar'); 216 | $class = 'wp-user-profile-avatar-success'; 217 | } 218 | 219 | echo json_encode(['avatar_original' => $wpupa_original, 'avatar_thumbnail' => $wpupa_thumbnail, 'message' => $message, 'class' => $class]); 220 | 221 | wp_die(); 222 | } 223 | 224 | /** 225 | * remove_user_avatar function. 226 | * 227 | * @access public 228 | * @param 229 | * @return 230 | * @since 1.0 231 | */ 232 | function remove_user_avatar() 233 | { 234 | check_ajax_referer( '_nonce_user_profile_avatar_security', 'security' ); 235 | 236 | parse_str($_POST['form_data'], $form_data); 237 | 238 | //sanitize each of the values of form data 239 | $wpupa_url =esc_url_raw($form_data['wpupa_url']); 240 | $wpupa_attachment_id =absint($form_data['wpupa_attachment_id']); 241 | $user_id =absint($form_data['user_id']); 242 | 243 | if(isset($user_id)) 244 | { 245 | update_user_meta($user_id, '_wpupa_attachment_id', ''); 246 | update_user_meta($user_id, '_wpupa_url', ''); 247 | update_user_meta( $user_id, '_wpupa_default', '' ); 248 | 249 | //delete also attachment 250 | wp_delete_attachment($wpupa_attachment_id,true); 251 | } 252 | 253 | $wpupa_original = get_wpupa_url($user_id, ['size' => 'original']); 254 | $wpupa_thumbnail = get_wpupa_url($user_id, ['size' => 'thumbnail']); 255 | 256 | $message = __( 'Successfully Removed Avatar', 'wp-user-profile-avatar'); 257 | $class = 'wp-user-profile-avatar-success'; 258 | 259 | echo json_encode(['avatar_original' => $wpupa_original, 'avatar_thumbnail' => $wpupa_thumbnail, 'message' => $message, 'class' => $class]); 260 | 261 | wp_die(); 262 | } 263 | 264 | /** 265 | * undo_user_avatar function. 266 | * 267 | * @access public 268 | * @param 269 | * @return 270 | * @since 1.0 271 | */ 272 | function undo_user_avatar() 273 | { 274 | check_ajax_referer( '_nonce_user_profile_avatar_security', 'security' ); 275 | 276 | parse_str($_POST['form_data'], $form_data); 277 | 278 | //sanitize each of the values of form data 279 | $wpupa_url =esc_url_raw($form_data['wpupa_url']); 280 | $wpupa_attachment_id =absint($form_data['wpupa_attachment_id']); 281 | $user_id =absint($form_data['user_id']); 282 | 283 | if(isset($user_id,$wpupa_attachment_id,$wpupa_url)) 284 | { 285 | update_user_meta($user_id, '_wpupa_attachment_id', $wpupa_attachment_id); 286 | update_user_meta($user_id, '_wpupa_url', $wpupa_url); 287 | } 288 | 289 | if(!empty($wpupa_attachment_id) || $wpupa_url) 290 | { 291 | update_user_meta( $user_id, '_wpupa_default', 'wp_user_profile_avatar' ); 292 | } 293 | else 294 | { 295 | update_user_meta( $user_id, '_wpupa_default', '' ); 296 | } 297 | 298 | $wpupa_original = get_wpupa_url($user_id, ['size' => 'original']); 299 | $wpupa_thumbnail = get_wpupa_url($user_id, ['size' => 'thumbnail']); 300 | 301 | $message = __( 'Successfully Undo Avatar', 'wp-user-profile-avatar'); 302 | $class = 'wp-user-profile-avatar-success'; 303 | 304 | echo json_encode(['avatar_original' => $wpupa_original, 'avatar_thumbnail' => $wpupa_thumbnail, 'message' => $message, 'class' => $class]); 305 | 306 | wp_die(); 307 | } 308 | 309 | /** 310 | * handle_upload function. 311 | * 312 | * @access public 313 | * @param $file_handler, $overrides 314 | * @return 315 | * @since 1.0 316 | */ 317 | function handle_upload($file_handler, $overrides) 318 | { 319 | require_once( ABSPATH . 'wp-admin/includes/image.php' ); 320 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); 321 | require_once( ABSPATH . 'wp-admin/includes/media.php' ); 322 | 323 | $upload = wp_handle_upload($file_handler, $overrides); 324 | 325 | return $upload; 326 | } 327 | 328 | } 329 | 330 | new WPUPA_Shortcodes(); --------------------------------------------------------------------------------