/
sns-buttons-default.php
213 lines (190 loc) · 7.94 KB
/
sns-buttons-default.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
<?php
/**
* SNSシェアボタン用テンプレート、シェアボタンが表示されるときは全てこのテンプレートが呼び出されます
*/
?>
<?php
if ( is_all_sns_share_btns_visible() ):
global $g_is_small;
?>
<div class="sns-buttons">
<?php
/**
* シェアボタン用のメッセージを取得
*/
if ( get_share_msg() ):
?>
<p><?php echo esc_html( get_share_msg() ) ?></p>
<?php endif; ?>
<ul class="snsb clearfix">
<?php
/**
* Twitterボタンを表示するか
*/
if ( is_twitter_btn_visible() ):
?>
<li class="twitter-btn">
<a
href = "https://twitter.com/share"
class = "twitter-share-button"
data-via = ""
data-url = "<?php the_permalink(); ?>"
data-text = "<?php the_title(); ?>"
data-count = "<?php echo ($g_is_small ? 'horizontal' : 'vertical') ?>">Tweet
</a>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
</li>
<?php endif; ?>
<?php
/**
* Facebookボタンを表示するか
*/
if ( is_facebook_btn_visible() ):
?>
<li class="facebook-btn">
<div id="fb-root"></div>
<div
class="fb-like"
data-href="<?php the_permalink(); ?>"
data-layout="<?php echo ($g_is_small ? 'button_count' : 'box_count') ?>"
data-action="like"
data-show-faces="false"
data-share="false">
</div>
</li>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<?php endif; //Facebook <------ need? ?>
<?php
/**
* Google+ボタンを表示するか
*/
if ( is_google_plus_btn_visible() ):
?>
<li class="google-plus-btn">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="g-plusone"<?php echo ($g_is_small ? '' : ' data-size="tall"') ?> data-href="<?php the_permalink(); ?>"></div>
</li>
<?php endif;?>
<?php
/**
* はてなボタンを表示するか
*/
if ( is_hatena_btn_visible() ):
?>
<li class="hatena-btn">
<a
href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>"
class="hatena-bookmark-button"
data-hatena-bookmark-title="<?php the_title(); ?>|<?php bloginfo('name'); ?>"
data-hatena-bookmark-layout="<?php echo ($g_is_small ? 'standard' : 'vertical-balloon') ?>"
title="このエントリーをはてなブックマークに追加">
<img
src="http://b.st-hatena.com/images/entry-button/button-only.gif"
alt="このエントリーをはてなブックマークに追加"
width="20" height="20"
style="border: none;" />
</a>
<script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>
</li>
<?php endif; ?>
<?php
/**
* pocketボタンを表示するか
*/
if ( is_pocket_btn_visible() ):
?>
<li class="pocket-btn">
<a
data-pocket-label="pocket"
data-pocket-count="<?php echo ($g_is_small ? 'horizontal' : 'vertical') ?>"
class="pocket-btn"
data-lang="en">
</a>
<script type="text/javascript">!function(d,i){if(!d.getElementById(i)){var j=d.createElement("script");j.id=i;j.src="https://widgets.getpocket.com/v1/j/btn.js?v=1";var w=d.getElementById(i);d.body.appendChild(j);}}(document,"pocket-btn-js");</script>
</li>
<?php endif; ?>
<?php
/**
* Evernoteボタンを表示するか
*/
if ( is_evernote_btn_visible() ):
?>
<li class="evernote-btn">
<a
href="#"
onclick="Evernote.doClip({url:'<?php the_permalink();?>',
providerName:'<?php bloginfo('name'); ?>',
title:'<?php the_title();?>',
contentId:'the-content',
}); return false;"
class="evernote-btn-link">
<img
src="<?php echo get_template_directory_uri();?>/images/article-clipper-vert.png"
alt="Evernoteに保存"
class="evernote-btn-img" />
<img
src="<?php echo get_template_directory_uri();?>/images/article-clipper.png"
alt="Evernoteに保存"
class="evernote-btn-img-mini" />
</a>
</li>
<?php endif; ?>
<?php
/**
* feedlyボタンを表示するか
*/
if ( is_feedly_btn_visible() ):
?>
<?php
// 横型の小さいfeedlyボタン
if ($g_is_small):
?>
<li class="feedly-btn feedly-btn-horizontal">
<a
href='http://feedly.com/index.html#subscription%2Ffeed%2F<?php urlencode(bloginfo('rss2_url')); ?>'
target='blank'>
<img
id='feedly-follow'
src='http://s3.feedly.com/img/follows/feedly-follow-rectangle-flat-medium_2x.png'
alt="">
</a>
<span class="arrow_box">
<a
href='http://feedly.com/index.html#subscription%2Ffeed%2F<?php urlencode(bloginfo('rss2_url')); ?>'
target='blank'><?php echo get_feedly_count(); ?>
</a>
</span>
</li>
<?php
//縦型の大きなfeedlyボタン
else:
?>
<li class="feedly-btn feedly-btn-vertical">
<div id="feedly-followers">
<span id="feedly-count" class="fdly-count">
<a
href='http://feedly.com/index.html#subscription%2Ffeed%2F<?php urlencode(bloginfo('rss2_url')); ?>'
target='blank'><?php echo get_feedly_count(); ?>
</a>
</span>
<a href='http://feedly.com/index.html#subscription%2Ffeed%2F<?php urlencode(bloginfo('rss2_url')); ?>' target='blank'>
<img id='feedly-follow' src='http://s3.feedly.com/img/follows/feedly-follow-rectangle-flat-medium_2x.png' alt="">
</a>
</div>
</li>
<?php endif; ?>
<?php
//is_feedly_btn_visible
endif;
?>
</ul>
</div>
<?php endif; ?>