forked from seatonjiang/kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.php
530 lines (525 loc) · 14.8 KB
/
options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
<?php
/**
* The template for Settings content control
*
* @package Vtrois
* @version 2.5
*/
function optionsframework_option_name() {
$themename = wp_get_theme();
$themename = preg_replace("/\W/", "_", strtolower($themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename;
update_option( 'optionsframework', $optionsframework_settings );
}
function optionsframework_options() {
$imagepath = get_template_directory_uri() . '/images/options/';
$options = array();
$options[] = array(
'name' => '站点配置',
'type' => 'heading');
$options[] = array(
'name' => '站点Logo',
'desc' => '不添加显示文字标题,推荐图片尺寸 200px*50px,保存成功则自动显示Logo图片',
'id' => 'site_logo',
'type' => 'upload');
$options[] = array(
'name' => '背景颜色',
'desc' => '针对整个站点背景颜色控制',
'id' => 'background_index_color',
'std' => '#f5f5f5',
'type' => 'color');
$options[] = array(
'name' => '列表布局',
'desc' => '选择你喜欢的列表布局,默认显示新式列表布局',
'id' => "list_layout",
'std' => "new_layout",
'type' => "images",
'options' => array(
'old_layout' => $imagepath . 'old-layout.png',
'new_layout' => $imagepath . 'new-layout.png'));
$options[] = array(
'name' => '侧边栏随动',
'desc' => '是否启用侧边栏小工具随动功能',
'id' => 'site_sa',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '分类页面',
'desc' =>'是否启用分类页面的名称以及简介功能',
'id' => 'show_head_cat',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '标签页面',
'desc' =>'是否启用标签页面的名称以及简介功能',
'id' => 'show_head_tag',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '站点黑白',
'desc' => '是否启用站点黑白功能(一般常用于悼念日)',
'id' => 'site_bw',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '打赏连接',
'desc' => '输入您的打赏介绍页面的连接,若没开启点赞打赏功能该项无效',
'id' => 'donate_links',
'type' => 'text');
$options[] = array(
'name' => '组件配置',
'type' => 'heading');
$options[] = array(
'name' => '特色图片',
'desc' => '选择你喜欢的默认特色图片(仅针对新式布局)',
'id' => 'default_image',
'std' => get_template_directory_uri() . '/images/default.jpg',
'type' => 'upload');
$options[] = array(
'name' => '页面伪静态',
'desc' => '是否启用自定义页面伪静态功能',
'id' => 'page_html',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '网易云音乐',
'desc' => '是否启用网易云音乐自动播放功能',
'id' => 'wy_music',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '新浪分享 AppKey',
'desc' => '输入您的新浪分享 AppKey ,若留空不会影响分享功能',
'id' => 'sina_appkey',
'type' => 'text');
$options[] = array(
'name' => '访客留言',
'desc' => '是否启用访客留言按钮功能',
'id' => 'cd_gb',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '访客留言配置',
'desc' => '输入您的访客留言页面的连接,若没开启访客留言按钮该项无效',
'id' => 'guestbook_links',
'type' => 'text');
$options[] = array(
'name' => '微信展示',
'desc' => '是否启用微信展示按钮功能',
'id' => 'cd_weixin',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '微信图片',
'desc' => '上传你的微信二维码图片,图片尺寸要大于150px',
'id' => 'weixin_image',
'std' => get_template_directory_uri() . '/images/weixin.png',
'type' => 'upload');
$options[] = array(
'name' => 'SEO配置',
'type' => 'heading');
$options[] = array(
'name' => '关键词',
'desc' => '每个关键词之间用英文逗号分割',
'id' => 'site_keywords',
'type' => 'text');
$options[] = array(
'name' => '站点描述',
'id' => 'site_description',
'std' => '',
'type' => 'textarea');
$options[] = array(
'name' => '站点统计',
'desc' => '填写时需要去掉<script>与</script>标签',
'id' => 'site_tongji',
'std' => '',
'type' => 'textarea');
$options[] = array(
'name' => '顶部配置',
'type' => 'heading');
$options[] = array(
'name' => '顶部类型',
'desc' => '选择您喜欢的顶部类型并修改其对应选项',
'id' => 'background_mode',
'std' => 'image',
'type' => 'select',
'class' => 'mini',
'options' => array(
'image' => '图片',
'color' => '颜色'));
$options[] = array(
'name' => '图片样式',
'desc' => '只有在类型中选择“图片”才起作用',
'id' => 'background_image',
'std' => get_template_directory_uri() . '/images/background.jpg',
'type' => 'upload');
$options[] = array(
'name' => '图片文字-1',
'id' => 'background_image_text1',
'desc' => '只有在类型中选择“图片”才起作用',
'std' => 'Kratos',
'type' => 'text');
$options[] = array(
'name' => '图片文字-2',
'id' => 'background_image_text2',
'desc' => '只有在类型中选择“图片”才起作用',
'std' => 'A responsible theme for WordPress',
'type' => 'text');
$options[] = array(
'name' => '颜色样式',
'desc' => '只有在类型中选择“颜色”才起作用',
'id' => 'background_color',
'std' => '#222831',
'type' => 'color');
$options[] = array(
'name' => '内容页面',
'type' => 'heading');
$options[] = array(
'name' => '文章布局',
'desc' => '选择你喜欢的整体布局(显示左边栏,右边栏)默认显示右边栏',
'id' => "side_bar",
'std' => "right_side",
'type' => "images",
'options' => array(
'left_side' => $imagepath . 'col-left.png',
'right_side' => $imagepath . 'col-right.png'));
$options[] = array(
'name' => '版权声明',
'desc' => '是否启用 CC BY-SA 4.0 声明',
'id' => 'post_cc',
'std' => '1',
'type' => 'checkbox');
$options[] = array(
'name' => '分享按钮',
'desc' => '是否启用文章分享功能',
'id' => 'post_share',
'std' => '1',
'type' => 'checkbox');
$options[] = array(
'name' => '打赏按钮',
'desc' => '是否启用文章打赏功能',
'id' => 'post_like_donate',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '模板页面',
'type' => 'heading');
$options[] = array(
'name' => '页面布局',
'desc' => '选择你喜欢的整体布局(显示左边栏,右边栏)默认显示右边栏',
'id' => "page_side_bar",
'std' => "right_side",
'type' => "images",
'options' => array(
'left_side' => $imagepath . 'col-left.png',
'right_side' => $imagepath . 'col-right.png'));
$options[] = array(
'name' => '版权声明',
'desc' => '是否启用 CC BY-SA 4.0 声明',
'id' => 'page_cc',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '分享按钮',
'desc' => '是否启用文章分享功能',
'id' => 'page_share',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '打赏按钮',
'desc' => '是否启用文章打赏功能',
'id' => 'page_like_donate',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '主页配置',
'type' => 'heading');
$options[] = array(
'name' => '首屏背景',
'id' => 'krsort_hm_img',
'std' => get_template_directory_uri() . '/images/background.jpg',
'type' => 'upload');
$options[] = array(
'name' => '首屏大标题',
'id' => 'krsort_hm_tx1',
'std' => 'Kratos',
'type' => 'text');
$options[] = array(
'name' => '首屏小标题',
'id' => 'krsort_hm_tx2',
'std' => 'A responsible theme for WordPress',
'type' => 'text');
$options[] = array(
'name' => '二屏标题',
'id' => 'krsort_hm_tx3',
'std' => '标题内容',
'type' => 'text');
$options[] = array(
'name' => '二屏简介',
'id' => 'krsort_hm_tx4',
'std' => '这里是关于版块的简介内容',
'type' => 'text');
$options[] = array(
'name' => '二屏版块',
'id' => 'krsort_hm_bk1',
'std' => '15',
'type' => 'text');
$options[] = array(
'name' => '二屏连接',
'id' => 'krsort_hm_tx5',
'type' => 'text');
$options[] = array(
'name' => '三屏标题',
'id' => 'krsort_hm_tx6',
'std' => '标题内容',
'type' => 'text');
$options[] = array(
'name' => '三屏简介',
'id' => 'krsort_hm_tx7',
'std' => '这里是关于版块的简介内容',
'type' => 'text');
$options[] = array(
'name' => '三屏版块',
'id' => 'krsort_hm_bk2',
'std' => '15',
'type' => 'text');
$options[] = array(
'name' => '三屏连接',
'id' => 'krsort_hm_tx8',
'type' => 'text');
$options[] = array(
'name' => '四屏标题',
'id' => 'krsort_hm_tx9',
'std' => '标题内容',
'type' => 'text');
$options[] = array(
'name' => '四屏简介',
'id' => 'krsort_hm_tx10',
'std' => '这里是关于版块的简介内容',
'type' => 'text');
$options[] = array(
'name' => '四屏版块',
'id' => 'krsort_hm_bk3',
'std' => '15',
'type' => 'text');
$options[] = array(
'name' => '四屏连接',
'id' => 'krsort_hm_tx11',
'type' => 'text');
$options[] = array(
'name' => '404页面',
'type' => 'heading');
$options[] = array(
'name' => '页面标题',
'id' => 'error_text1',
'std' => '这里已经是废墟,什么东西都没有',
'type' => 'text');
$options[] = array(
'name' => '简介说明',
'id' => 'error_text2',
'std' => 'That page can not be found',
'type' => 'text');
$options[] = array(
'name' => '页面背景',
'id' => 'error_image',
'std' => get_template_directory_uri() . '/images/404.jpg',
'type' => 'upload');
$options[] = array(
'name' => '轮播图片',
'type' => 'heading');
$options[] = array(
'name' => '是否启用轮播',
'desc' => '图片宽度建议大于750像素',
'id' => 'kratos_banner',
'std' => '0',
'type' => 'select',
'class' => 'mini',
'options' => array(
'1' => '是',
'0' => '否'));
$options[] = array(
'name' => '轮播图片-1',
'id' => 'kratos_banner1',
'type' => 'upload');
$options[] = array(
'name' => '轮播链接-1',
'desc' => '链接可以留空',
'id' => 'kratos_banner_url1',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '轮播图片-2',
'id' => 'kratos_banner2',
'type' => 'upload');
$options[] = array(
'name' => '链接2',
'desc' => '链接可以留空',
'id' => 'kratos_banner_url2',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '轮播图片-3',
'id' => 'kratos_banner3',
'type' => 'upload');
$options[] = array(
'name' => '链接3',
'desc' => '链接可以留空',
'id' => 'kratos_banner_url3',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '轮播图片-4',
'id' => 'kratos_banner4',
'type' => 'upload');
$options[] = array(
'name' => '链接4',
'desc' => '链接可以留空',
'id' => 'kratos_banner_url4',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '轮播图片-5',
'id' => 'kratos_banner5',
'type' => 'upload');
$options[] = array(
'name' => '链接5',
'desc' => '链接可以留空',
'id' => 'kratos_banner_url5',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '邮件配置',
'type' => 'heading');
$options[] = array(
'name' => 'SMTP服务',
'desc' => '是否启用SMTP服务',
'id' => 'mail_smtps',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => '发信人',
'desc' => '请填写发件人姓名',
'id' => 'mail_name',
'std' => 'Kratos',
'type' => 'text');
$options[] = array(
'name' => '邮件服务器',
'desc' => '请填写SMTP服务器地址',
'id' => 'mail_host',
'std' => 'smtp.vtrois.com',
'type' => 'text');
$options[] = array(
'name' => '服务器端口',
'desc' => '请填写SMTP服务器端口',
'id' => 'mail_port',
'std' => '994',
'type' => 'text');
$options[] = array(
'name' => '邮箱帐号',
'desc' => '请填写邮箱账号',
'id' => 'mail_username',
'std' => '[email protected]',
'type' => 'text');
$options[] = array(
'name' => '邮箱密码',
'desc' => '请填写邮箱密码',
'id' => 'mail_passwd',
'std' => '123456789',
'type' => 'text');
$options[] = array(
'name' => '启用SMTPAuth服务',
'desc' => '是否启用SMTPAuth服务',
'id' => 'mail_smtpauth',
'std' => '1',
'type' => 'checkbox');
$options[] = array(
'name' => 'SMTPSecure设置',
'desc' => '若启用SMTPAuth服务则填写ssl,若不启用则留空',
'id' => 'mail_smtpsecure',
'std' => 'ssl',
'type' => 'text');
$options[] = array(
'name' => '页脚配置',
'type' => 'heading');
$options[] = array(
'name' => '工信部备案信息',
'desc' => '输入您的工信部备案号,针对国际版没有备案信息栏目的功能',
'id' => 'icp_num',
'type' => 'text');
$options[] = array(
'name' => '公安网备案信息',
'desc' => '输入您的公安网备案号',
'id' => 'gov_num',
'type' => 'text');
$options[] = array(
'name' => '公安网备案连接',
'desc' => '输入您的公安网备案的链接地址',
'id' => 'gov_link',
'type' => 'text');
$options[] = array(
'name' => '社交组件',
'type' => 'heading');
$options[] = array(
'name' => '新浪微博',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_weibo',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '腾讯微博',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_tweibo',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => 'Twitter',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_twitter',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => 'FaceBook',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_facebook',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => 'LinkedIn',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_linkedin',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => 'GitHub',
'desc' => '连接前要带有 http:// 或者 https:// ',
'id' => 'social_github',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => '广告配置',
'type' => 'heading');
$options[] = array(
'name' => '广告位置',
'desc' => '选择图片广告放置的位置',
'id' => 'ad_show',
'std' => array(
'top' => 0,
'footer' => 0),
'type' => 'multicheck',
'options' => array(
'top' => '文章页顶部',
'footer' => '文章页底部'));
$options[] = array(
'name' => '广告图片',
'desc' => '图片宽度大于750px',
'id' => 'ad_img',
'type' => 'upload');
$options[] = array(
'name' => '广告代码',
'desc' => '可放置浮动广告HTML代码',
'id' => 'ad_code',
'std' => '',
'type' => 'textarea');
return $options;
}