64 |
65 |
--------------------------------------------------------------------------------
/init.php:
--------------------------------------------------------------------------------
1 | '说说',
5 | 'singular_name' => '说说',
6 | 'add_new' => '发表说说',
7 | 'add_new_item' => '发表说说',
8 | 'edit_item' => '编辑说说',
9 | 'new_item' => '新说说',
10 | 'view_item' => '查看说说',
11 | 'search_items' => '搜索说说',
12 | 'not_found' => '暂无说说',
13 | 'not_found_in_trash' => '没有已遗弃的说说',
14 | 'parent_item_colon' => '', 'menu_name' => '说说');
15 | $args = array('labels' => $labels,
16 | 'public' => true,
17 | 'publicly_queryable' => true,
18 | 'show_ui' => true,
19 | 'show_in_menu' => true,
20 | 'show_in_rest' => true,
21 | 'exclude_from_search' => true,
22 | 'query_var' => true,
23 | 'rewrite' => true,
24 | 'capability_type' => 'post',
25 | 'has_archive' => true, 'hierarchical' => false,
26 | 'menu_position' => null, 'supports' => array('editor', 'author', 'title', 'comments'));
27 | register_post_type('shuoshuo', $args);
28 | }
29 |
30 | //注册重写规则
31 | function register_shuoshuo_rewrite_rule()
32 | {
33 | add_rewrite_rule('^shuoshuo$', 'index.php?post_type=shuoshuo', 'top');
34 | }
35 |
36 | function shuoshuo_archive_template($single)
37 | {
38 | global $wp_query, $post;
39 | if (isShuoShuo($post)) {
40 | if (file_exists(WP_SHUOSHUO_PLUGIN_DIR . '/includes/template/archive-shuoshuo.php')) {
41 | return WP_SHUOSHUO_PLUGIN_DIR . '/includes/template/archive-shuoshuo.php';
42 | }
43 | }
44 | return $single;
45 |
46 | }
47 |
48 | function shuoshuo_single_template($single)
49 | {
50 | global $wp_query, $post;
51 | if (isShuoShuo($post)) {
52 | if (file_exists(WP_SHUOSHUO_PLUGIN_DIR . '/includes/template/single-shuoshuo.php')) {
53 | return WP_SHUOSHUO_PLUGIN_DIR . '/includes/template/single-shuoshuo.php';
54 | }
55 | }
56 | return $single;
57 |
58 | }
59 |
60 | function isShuoShuo($post)
61 | {
62 | global $paged, $page, $post;
63 | return $post->post_type == WP_SHUOSHUO_POST_TYPE;
64 | }
65 |
66 | /* Filter the single_template with our custom function*/
67 | add_filter('archive_template', 'shuoshuo_archive_template');
68 | add_filter('single_template', 'shuoshuo_single_template');
69 |
70 | add_action('init', 'register_shuoshuo');
71 | add_action('init', 'register_shuoshuo_rewrite_rule');
72 | ?>
73 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | .shuoshuo_container {
2 | font-size: 16px;
3 | color: #fff;
4 | display: inline-block;
5 | width: 860px;
6 | }
7 | @media all and (orientation: landscape) {
8 | .shuoshuo_container {
9 | font-size: 16px;
10 | color: #fff;
11 | display: inline-block;
12 | width: 860px;
13 | }
14 |
15 | .shuoshuo_more a {
16 | color: #a0a
17 | }
18 |
19 | .shuoshuo_item {
20 | list-style: none;
21 | }
22 | .shuoshuo_item:last-child {
23 | margin-bottom: 0
24 | }
25 |
26 | .shuoshuo_meta {
27 | position: absolute;
28 | left: 0;
29 | top: 0
30 | }
31 |
32 | .shuoshuo_meta .shuoshuo_time {
33 | width: 56px;
34 | height: 56px;
35 | -webkit-border-radius: 28px;
36 | border-radius: 28px;
37 | text-align: center;
38 | overflow: hidden;
39 | margin-left: 48px;
40 | background: #48ACF9
41 | }
42 |
43 | .shuoshuo_time {
44 | color: #fff;
45 | background: #49a0e1
46 | }
47 |
48 | .shuoshuo_meta .shuoshuo_time .day {
49 | font: 24px/1 Tahoma;
50 | display: block;
51 | margin-top: 10px
52 | }
53 |
54 | .shuoshuo_meta .shuoshuo_time .month {
55 | font-size: 12px;
56 | display: block
57 | }
58 |
59 | .shuoshuo_content {
60 | color: #373037;
61 | background: #fff;
62 | padding: 8px;
63 | overflow: hidden
64 | }
65 |
66 | .shuoshuo_detail p {
67 | clear: both;
68 | padding: 6px 22px;
69 | font-family: Arial, Helvetica, sans-serif, 鍗庢枃琛屾シ;
70 | font-size: 20px
71 | }
72 |
73 | .shuoshuo_more {
74 | display: none;
75 | position: absolute
76 | }
77 |
78 | .shuoshuo_item:hover .shuoshuo_more {
79 | -webkit-animation-name: fadeIn;
80 | -webkit-animation-duration: .8s;
81 | -webkit-animation-iteration-count: 1;
82 | -webkit-animation-delay: 0s;
83 | right: 122px;
84 | position: absolute;
85 | display: block;
86 | transition: all .2s ease
87 | }
88 |
89 | .shuoshuo_item:hover .shuoshuo_time {
90 | box-shadow: 0 0 15px #873FFB
91 | }
92 |
93 | .shuoshuo_op {
94 | position: relative;
95 | padding-right: 30px;
96 | text-align: right
97 | }
98 |
99 | .shuoshuo_list {
100 | overflow: hidden;
101 | margin-bottom: 30px
102 | }
103 |
104 | .shuoshuo_item {
105 | position: relative;
106 | padding: 0 80px 0 120px;
107 | margin-top: 30px
108 | }
109 |
110 | .shuoshuo_item:last-child {
111 | margin-bottom: 0
112 | }
113 |
114 | .shuoshuo_meta {
115 | position: absolute;
116 | left: 0;
117 | top: 0
118 | }
119 |
120 | .shuoshuo_meta .shuoshuo_time {
121 | width: 3.6em;
122 | height: 3.6em;
123 | -webkit-border-radius: 1.8em;
124 | border-radius: 1.8em;
125 | text-align: center;
126 | overflow: hidden;
127 | margin-left: 48px
128 | }
129 |
130 | .shuoshuo_meta .shuoshuo_time .day {
131 | font: 24px/1 Tahoma;
132 | display: block;
133 | margin-top: 10px
134 | }
135 |
136 | .shuoshuo_meta .shuoshuo_time .month {
137 | font-size: 12px;
138 | display: block
139 | }
140 |
141 | .shuoshuo_content {
142 | padding: 8px;
143 | overflow: hidden;
144 | box-shadow: 0 0 10px 1px #7B7F7B
145 | }
146 |
147 | .shuoshuo_quote_before {
148 | font-size: 0;
149 | line-height: 99;
150 | height: 29px;
151 | width: 32px;
152 | display: block;
153 | overflow: hidden;
154 | float: left
155 | }
156 |
157 | .shuoshuo_quote_after {
158 | font-size: 0;
159 | line-height: 99;
160 | height: 29px;
161 | width: 32px;
162 | display: block;
163 | overflow: hidden;
164 | float: right
165 | }
166 |
167 | .shuoshuo_op {
168 | position: relative;
169 | padding-right: 25px;
170 | text-align: right
171 | }
172 |
173 | .shuoshuo_container .shuoshuo_op .shuoshuo_comment, .shuoshuo_container .shuoshuo_op .shuoshuo_like, .shuoshuo_op .shuoshuo_rt {
174 | display: inline-block;
175 | padding: 7px 10px 4px 34px;
176 | font: 12px Arial, Helvetica, sans-serif;
177 | border-radius: 0 0 4px 4px;
178 | vertical-align: top;
179 | height: 15px
180 | }
181 |
182 | div.pagination {
183 | padding: 0;
184 | margin: 25px 0 40px;
185 | text-align: center;
186 | font-size: 15px;
187 | line-height: 17px;
188 | position: relative
189 | }
190 |
191 | .pagination .pg-dots, .pagination .pg-item .current, .pagination .pg-item .disabled, .pagination .pg-item a {
192 | display: inline-block;
193 | color: #666;
194 | padding: 9px 13px;
195 | border-radius: 3px;
196 | -webkit-border-radius: 3px;
197 | -moz-border-radius: 3px;
198 | text-decoration: none;
199 | margin: 0 1px;
200 | min-width: 10px
201 | }
202 |
203 | .pagination .pg-item a {
204 | -webkit-transition: background .2s linear;
205 | -moz-transition: background .2s linear;
206 | -ms-transition: background .2s linear;
207 | -o-transition: background .2s linear;
208 | transition: background .2s linear;
209 | -webkit-backface-visibility: hidden;
210 | -moz-backface-visibility: hidden
211 | }
212 |
213 | .pagination .pg-next {
214 | position: absolute
215 | }
216 | }
217 |
218 | @media all and (orientation: portrait) {
219 | .shuoshuo_container {
220 | background: #e1dbcc;
221 | color: #fff
222 | }
223 |
224 | .shuoshuo_meta .shuoshuo_time {
225 | overflow: hidden;
226 | width: 50px;
227 | height: 50px;
228 | border-radius: 25px;
229 | background: #48acf9;
230 | text-align: center
231 | }
232 |
233 | .shuoshuo_time {
234 | background: #49a0e1;
235 | color: #fff
236 | }
237 |
238 | .shuoshuo_meta .shuoshuo_time .day {
239 | display: block;
240 | margin-top: 5px;
241 | font: 24px/1 Tahoma
242 | }
243 |
244 | .shuoshuo_time:hover {
245 | box-shadow: 0 0 15px #873ffb
246 | }
247 |
248 | .shuoshuo_meta .shuoshuo_time .month {
249 | display: block;
250 | font-size: 9pt
251 | }
252 |
253 | .shuoshuo_content {
254 | padding: 0 6px 5px;
255 | background: #fff;
256 | color: #373037
257 | }
258 |
259 | .shuoshuo_op {
260 | position: relative;
261 | padding-right: 30px;
262 | text-align: right
263 | }
264 |
265 | .shuoshuo_more {
266 | display: none
267 | }
268 |
269 | .shuoshuo_item:hover .shuoshuo_more {
270 | float: right;
271 | display: block;
272 | transition: all .2s ease;
273 | -webkit-animation-name: fadeIn;
274 | -webkit-animation-duration: .8s;
275 | -webkit-animation-iteration-count: 1;
276 | -webkit-animation-delay: 0s
277 | }
278 |
279 | .shuoshuo_list {
280 | overflow: hidden;
281 | margin: 10px;
282 | margin-bottom: 20px
283 | }
284 |
285 | .shuoshuo_item {
286 | position: relative;
287 | margin-top: 30px;
288 | margin-bottom: 20px;
289 | padding: 20px 10px 0 17px
290 | }
291 |
292 | .shuoshuo_meta {
293 | position: absolute;
294 | top: 0;
295 | left: 0
296 | }
297 |
298 | .shuoshuo_content {
299 | overflow: hidden
300 | }
301 |
302 | .shuoshuo_quote_before {
303 | float: left
304 | }
305 |
306 | .shuoshuo_quote_after, .shuoshuo_quote_before {
307 | display: block;
308 | overflow: hidden;
309 | width: 2pc;
310 | height: 29px;
311 | font-size: 0;
312 | line-height: 99
313 | }
314 |
315 | .shuoshuo_quote_after {
316 | float: right
317 | }
318 |
319 | .shuoshuo_detail {
320 | clear: both;
321 | padding: 0 9pt
322 | }
323 |
324 | .shuoshuo_detail.p {
325 | margin: 0 0 -22px
326 | }
327 |
328 | .shuoshuo_op {
329 | position: relative;
330 | padding-right: 25px;
331 | text-align: right
332 | }
333 |
334 | .shuoshuo_container .shuoshuo_op .shuoshuo_comment, .shuoshuo_container .shuoshuo_op .shuoshuo_like, .shuoshuo_op .shuoshuo_rt {
335 | display: inline-block;
336 | padding: 7px 10px 4px 34px;
337 | height: 15px;
338 | border-radius: 0 0 4px 4px;
339 | vertical-align: top;
340 | font: 9pt Arial, Helvetica, sans-serif
341 | }
342 |
343 | div.pagination {
344 | position: relative;
345 | margin: 10px 0 30px;
346 | padding: 0 0 10px 0;
347 | text-align: center;
348 | font-size: 15px;
349 | line-height: 17px
350 | }
351 |
352 | .pagination .pg-dots, .pagination .pg-item .current, .pagination .pg-item .disabled, .pagination .pg-item a {
353 | display: inline-block;
354 | margin: 0 1px;
355 | padding: 9px 13px;
356 | min-width: 10px;
357 | border-radius: 3px;
358 | color: #666;
359 | text-decoration: none
360 | }
361 |
362 | .pagination .pg-item a {
363 | -webkit-transition: background .2s linear;
364 | transition: background .2s linear;
365 | -ms-transition: background .2s linear;
366 | -webkit-backface-visibility: hidden;
367 | -moz-backface-visibility: hidden
368 | }
369 |
370 | .pagination .pg-next {
371 | position: absolute;
372 | right: 20px
373 | }
374 | }
375 |
376 | .shuoshuo_op .shuoshuo_rt {
377 | background-position: 4px -14px
378 | }
379 |
380 | .post-copyright {
381 | display: none
382 | }
383 |
384 | .shuoshuo_op a:hover {
385 | text-decoration: none
386 | }
387 |
388 | .shuoshuo_op .shuoshuo_rt {
389 | background-position: 0 -55px
390 | }
391 |
392 | .shuoshuo_op .shuoshuo_like {
393 | background-position: 0 0
394 | }
395 |
396 | .pagination .pg-filler-1 {
397 | width: 35%
398 | }
399 |
400 | .pagination .pg-filler-2 {
401 | width: 40%
402 | }
403 |
404 | .pagination .pg-prev {
405 | position: absolute;
406 | left: 20px
407 | }
408 |
409 | .pg-nav-item {
410 | text-transform: uppercase
411 | }
412 |
413 | .pagination .pg-item .current, .pagination .pg-item a:hover {
414 | background: #ff5e52;
415 | color: #fff
416 | }
417 |
418 | div.pagination a, div.pagination span.current {
419 | padding: 0
420 | }
421 |
422 | div.pagination a.navbutton {
423 | margin: 0 2px;
424 | border: 1px solid #eaeaea
425 | }
426 |
427 | .shuoshuo_list {
428 | overflow: hidden
429 | }
430 |
431 | @-webkit-keyframes fadeIn {
432 | 0% {
433 | opacity: 0
434 | }
435 | 50% {
436 | opacity: .5
437 | }
438 | to {
439 | opacity: 1
440 | }
441 | }
442 | .single-shuoshuo {
443 | background: #FFF;
444 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------