Skip to content

Commit 443925b

Browse files
authored
Merge pull request dimpurr#7 一点微小的 Patch from fengberd/master
一点微小的 Patch
2 parents b48a1ea + 412149e commit 443925b

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

functions.php

+14-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
// 加载内置插件
44
include( get_template_directory().'/func/wp-useragent.php');
55

6+
// 给 style.css 添加修改时间, 解决缓存问题
7+
add_filter('stylesheet_uri', 'clrs_css_mtime');
8+
function clrs_css_mtime() {
9+
echo get_template_directory_uri().'/style.css?t='.filemtime(get_stylesheet_directory().'/style.css');
10+
}
11+
612
// 加载语言包
713
add_action('after_setup_theme', 'my_theme_setup');
814
function my_theme_setup() {
@@ -146,9 +152,9 @@ function clrs_tjaj() {
146152

147153
function clrs_sns () {
148154
// 修改此顺序可以改变输出顺序,记得修改对应的注释
149-
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github");
150-
$clrs_snsn = array("个人页","Google+","Twitter","Facebook","SinaWeibo","QQ","Github");
151-
for ($i=0; $i<7; $i++) {
155+
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github","telegram");
156+
$clrs_snsn = array("个人页","Google+","Twitter","Facebook","SinaWeibo","QQ","Github","Telegram");
157+
for ($i=0; $i<8; $i++) {
152158
$clrs_sopt = 'clrs_s_' . $clrs_sns[$i];
153159
if( get_option($clrs_sopt) != null ) {
154160
echo '<a href="' . get_option($clrs_sopt) . '" title="' . $clrs_snsn[$i] . '" target="_blank"><button class="tr_' . $clrs_sns[$i] . '"></button></a>
@@ -325,10 +331,10 @@ function clrs_config(){ clrs_thtj(); ?>
325331
请带上 http:// <br>
326332
<?php
327333

328-
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github");
329-
$clrs_snsn = array("个人页","Google+","Twitter","Facebook","SinaWeibo","QQ / Qzone / QQWeibo","Github");
334+
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github","telegram");
335+
$clrs_snsn = array("个人页","Google+","Twitter","Facebook","SinaWeibo","QQ / Qzone / QQWeibo","Github","Telegram");
330336

331-
for ($i=0; $i<7; $i++) {
337+
for ($i=0; $i<8; $i++) {
332338
$clrs_sopt = 'clrs_s_' . $clrs_sns[$i];
333339
echo '<input type="text" size="80" name="' . $clrs_sopt . '" id="' . $clrs_sopt . '" placeholder="' . $clrs_snsn[$i] . '" value="' . get_option($clrs_sopt) . '"/>';
334340
}
@@ -386,8 +392,8 @@ function clrs_config(){ clrs_thtj(); ?>
386392
$clrs_upcl = stripslashes($_POST['clrs_upcl']);
387393
update_option( 'clrs_upcl', $clrs_upcl );
388394

389-
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github");
390-
for ($i=0; $i<7; $i++) {
395+
$clrs_sns = array("profile","gplus","twitter","fb","weibo","qqw","github","telegram");
396+
for ($i=0; $i<8; $i++) {
391397
$clrs_sopt = 'clrs_s_' . $clrs_sns[$i];
392398
update_option( $clrs_sopt, stripslashes($_POST[$clrs_sopt]) );
393399
}

header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
99
<?php if (get_option('clrs_opct') == "no") { ?>
10-
<link rel="stylesheet" href="<?=get_template_directory_uri(); ?>/style.opacity.css">
10+
<link rel="stylesheet" href="<?=get_template_directory_uri(); ?>/style.opacity.css?t=<?=@filemtime(get_template_directory().'/style.opacity.css'); ?>">
1111
<?php $bg = get_option('clrs_opbg'); if ( !empty( $bg ) ) { ?>
1212
<style>body { background-image: url("<?=$bg;?>"); };</style>
1313
<?php }; }; ?>

img/sns_telegram.png

1.86 KB
Loading

style.css

+5-4
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ blockquote , q { margin: 10px 30px 10px 50px; padding: 10px 5px;
8686
border-width: 1px 0 1px 0; border-style: dashed; border-color: #BBB; }
8787
blockquote p , q p { margin: 0; }
8888
ol , ul { font-size: 15px; padding-left: 70px; line-height: 24px; }
89-
pre , code { margin: 15px 0; padding: 10px; display: block;
89+
pre , :not(pre) > code { margin: 15px 0; padding: 10px; display: block;
9090
background: #FBFBFD; color: #222; border: 1.5px solid #e1e1e8;
9191
font-family: "Yahei Consolas Hybird", "Consolas", "Ubuntu Mono", Monaco, Menlo, "Courier New", monospace, sans-serif; font-size: 14px; word-break: break-all; word-wrap: break-word;
9292
-webkit-transition: all linear 0.2s; -moz-transition: all linear 0.2s; transition: all linear 0.2s; }
93-
p pre, p code, li pre, li code { display: inline; margin: 0 6px; padding: 2px; line-height: 24px; font-size: 12px; word-wrap: break-word; }
94-
pre:hover , code:hover { background: #FDFDFF; }
95-
pre:focus , code:focus { background: #FEFEFF; outline: none; border-color: #AAA; border-radius: 0; }
93+
p pre, p > code, li pre, li code { display: inline; margin: 0 6px; padding: 2px; line-height: 24px; font-size: 12px; word-wrap: break-word; }
94+
pre:hover , :not(pre) > code:hover { background: #FDFDFF; }
95+
pre:focus , :not(pre) > code:focus { background: #FEFEFF; outline: none; border-color: #AAA; border-radius: 0; }
9696
button , input[type="submit"] { border: 2px #DDD solid; background: #EFEFEF; padding: 5px 10px;
9797
-webkit-transition: background linear 0.2s, border linear 0.2s; -moz-transition: backgroundbackground linear 0.2s, border linear 0.2s; transition: background linear 0.2s, border linear 0.2s; }
9898
button:hover , input[type="submit"]:hover { background: #DDD; }
@@ -176,6 +176,7 @@ input:hover , textarea:hover , input:focus , textarea:focus { background: #FFF;
176176
#title_r .tr_fb { background-image: url(img/sns_fb.png); }
177177
#title_r .tr_gplus { background-image: url(img/sns_gplus.png); }
178178
#title_r .tr_weibo { background-image: url(img/sns_weibo.png); }
179+
#title_r .tr_telegram { background-image: url(img/sns_telegram.png); }
179180
#title_r .tr_qqw { background-image: url(img/sns_qqw.png); }
180181
#title_r .tr_github { background-image: url(img/sns_github.png); background-size: 30px; }
181182
#title_r .tr_profile { background-image: url(img/profile.png); }

style.opacity.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ a:hover, a:hover p, #sidebar a:hover, a:visited:hover, a:visited:hover p, #sideb
99
h2 a:hover, h2 a:visited:hover, a:hover p, a:visited:hover p { border: none; }
1010
a:visited, #sidebar a:visited { color: #DDD }
1111
blockquote , q { border-color: rgba(255,255,255,0.7); }
12-
pre , code { background: rgba(0,0,0,0.2); color: #FEFEFE; border: 1.5px solid #AAA; }
13-
pre:hover , code:hover { background: rgba(18,19,20,0.9); color: #FEFEFE; }
14-
pre:focus , code:focus { background: rgba(18,19,20,0.9); color: #FFF; border-color: #FFF; }
12+
pre , :not(pre) > code { background: rgba(0,0,0,0.2); color: #FEFEFE; border: 1.5px solid #AAA; }
13+
pre:hover , :not(pre) > code:hover { background: rgba(18,19,20,0.9); color: #FEFEFE; }
14+
pre:focus , :not(pre) > code:focus { background: rgba(18,19,20,0.9); color: #FFF; border-color: #FFF; }
1515
input , textarea, input:invalid, textarea:invalid { border: 2px #DDD solid; border-color: rgba(255,255,255,0.7); background: #FAFAFA; background: rgba(255,255,255,0.08); padding: 5px 10px; color: #EFEFEF;
1616
-webkit-transition: background linear 0.2s; -moz-transition: backgroundbackground linear 0.2s; transition: background linear 0.2s; }
1717
input:hover , textarea:hover , input:focus , textarea:focus { background: #FFF; background: rgba(255,255,255,0.0); }

0 commit comments

Comments
 (0)