WP Social Bookmarking Light - Version 1.0.1

Version Description

  • Fix for img style.
Download this release

Release Info

Developer utahvich
Plugin Icon wp plugin WP Social Bookmarking Light
Version 1.0.1
Comparing to
See all releases

Version 1.0.1

.svnignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .settings
2
+ .buildpath
3
+ .project
4
+ .DS_Store
images/buzzurl.gif ADDED
Binary file
images/choix.gif ADDED
Binary file
images/delicious.png ADDED
Binary file
images/digg.png ADDED
Binary file
images/facebook.png ADDED
Binary file
images/fc2.gif ADDED
Binary file
images/friendfeed.png ADDED
Binary file
images/google-buzz.png ADDED
Binary file
images/google.png ADDED
Binary file
images/hatena.gif ADDED
Binary file
images/livedoor.gif ADDED
Binary file
images/newsing.gif ADDED
Binary file
images/nifty.gif ADDED
Binary file
images/tumblr.png ADDED
Binary file
images/twib.gif ADDED
Binary file
images/yahoo.gif ADDED
Binary file
po/wp-social-bookmarking-light-ja.mo ADDED
Binary file
po/wp-social-bookmarking-light-ja.po ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: wp-social-bookmarking-light\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-06-05 22:34+0900\n"
6
+ "PO-Revision-Date: 2010-06-05 22:44+0900\n"
7
+ "Last-Translator: utah <labs.ninxit@gmail.com>\n"
8
+ "Language-Team: utahvich <labs.ninxit@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: /Users/utah/work/repos/\n"
14
+ "X-Poedit-Language: Japanese\n"
15
+ "X-Poedit-Country: JAPAN\n"
16
+ "X-Poedit-SearchPath-0: wp-social-bookmarking-light\n"
17
+
18
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:79
19
+ msgid "Bookmark this on Hatena Bookmark"
20
+ msgstr "このエントリーをはてなブックマークに追加"
21
+
22
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:86
23
+ #, php-format
24
+ msgid "Hatena Bookmark - %s"
25
+ msgstr "はてなブックマーク - %s"
26
+
27
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:97
28
+ msgid "Post to Twitter"
29
+ msgstr ""
30
+
31
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:104
32
+ #, php-format
33
+ msgid "Tweets - %s"
34
+ msgstr ""
35
+
36
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:127
37
+ msgid "Bookmark this on Livedoor Clip"
38
+ msgstr ""
39
+
40
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:134
41
+ #, php-format
42
+ msgid "Livedoor Clip - %s"
43
+ msgstr ""
44
+
45
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:145
46
+ msgid "Bookmark this on Yahoo Bookmark"
47
+ msgstr ""
48
+
49
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:160
50
+ msgid "Bookmark this on BuzzURL"
51
+ msgstr ""
52
+
53
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:167
54
+ #, php-format
55
+ msgid "BuzzURL - %s"
56
+ msgstr ""
57
+
58
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:178
59
+ msgid "Bookmark this on @nifty clip"
60
+ msgstr ""
61
+
62
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:185
63
+ #, php-format
64
+ msgid "@nifty clip - %s"
65
+ msgstr ""
66
+
67
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:196
68
+ msgid "Share on Tumblr"
69
+ msgstr ""
70
+
71
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:207
72
+ msgid "Bookmark this on FC2 Bookmark"
73
+ msgstr ""
74
+
75
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:214
76
+ #, php-format
77
+ msgid "FC2 Bookmark - %s"
78
+ msgstr ""
79
+
80
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:225
81
+ msgid "Newsing it!"
82
+ msgstr ""
83
+
84
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:236
85
+ msgid "Choix it!"
86
+ msgstr ""
87
+
88
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:247
89
+ msgid "Bookmark this on Google Bookmarks"
90
+ msgstr ""
91
+
92
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:258
93
+ msgid "Post to Google Buzz"
94
+ msgstr ""
95
+
96
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:269
97
+ msgid "Bookmark this on Delicious"
98
+ msgstr ""
99
+
100
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:280
101
+ msgid "Bookmark this on Digg"
102
+ msgstr ""
103
+
104
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:291
105
+ msgid "Share on FriendFeed"
106
+ msgstr ""
107
+
108
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:302
109
+ msgid "Share on Facebook"
110
+ msgstr ""
111
+
112
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:389
113
+ msgid "Options saved."
114
+ msgstr ""
115
+
116
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:394
117
+ msgid "Reset options."
118
+ msgstr ""
119
+
120
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:451
121
+ msgid "Save Changes"
122
+ msgstr ""
123
+
124
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:452
125
+ msgid "Reset"
126
+ msgstr ""
127
+
128
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:457
129
+ msgid "Service Code"
130
+ msgstr ""
131
+
132
+ #: wp-social-bookmarking-light/wp-social-bookmarking-light.php:457
133
+ msgid "Explain"
134
+ msgstr ""
135
+
readme.txt ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Social Bookmarking Light ===
2
+ Contributors: utahvich
3
+ Donate link: http://www.ninxit.com/blog/
4
+ Tags: links, social, bookmarks, bookmarking, Hatena, Livedoor Clip, BuzzURL, @nifty clip, Twitter, Tumblr, FC2 Bookmark, newsing, Choix, Yahoo!JAPAN Bookmark, Google Bookmark, Delicious, Digg, FriendFeed, Google Buzz, Facebook
5
+ Requires at least: 2.9.0
6
+ Tested up to: 2.9.2
7
+ Stable tag: 1.0.1
8
+
9
+ This plugin inserts social share links at the top or bottom of each post.
10
+
11
+ == Description ==
12
+
13
+ This plugin inserts social share links at the top or bottom of each post.
14
+
15
+ This is the list of used social sites:
16
+
17
+ * Hatena
18
+ * Facebook
19
+ * Twitter
20
+ * Livedoor Clip
21
+ * BuzzURL
22
+ * @nifty clip
23
+ * Tumblr
24
+ * FC2 Bookmark
25
+ * newsing
26
+ * Choix
27
+ * Yahoo!JAPAN Bookmark
28
+ * Google Bookmark
29
+ * Google Buzz
30
+ * Delicious
31
+ * Digg
32
+ * FriendFeed
33
+
34
+ == Installation ==
35
+
36
+ 1. Upload this directory to the 'wp-content/plugins/' directory
37
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
38
+ 3. Open 'WP Social Bookmarking Light Options' control panel through the 'Settings' menu and change configurations (This step is not required, the plugin has default settings)
39
+
40
+ == Screenshots ==
41
+
42
+ 1. This is how the plugin looks in your blog.
43
+ 2. This is how the plugin looks in settings.
44
+
45
+ == Changelog ==
46
+
47
+ = 1.0.1 =
48
+
49
+ * Fix for img style.
50
+
51
+ = 1.0.0 =
52
+
53
+ * First Release
54
+
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
wp-social-bookmarking-light.php ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP Social Bookmarking Light
4
+ Plugin URI: http://www.ninxit.com/blog/
5
+ Description: This plugin inserts social share links at the top or bottom of each post.
6
+ Author: utahta
7
+ Author URI: http://www.ninxit.com/blog/
8
+ Version: 1.0.1
9
+ */
10
+ /*
11
+ Copyright 2010 utahta (email : labs.ninxit@gmail.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License as published by
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
+ */
27
+
28
+ define( "WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL", WP_PLUGIN_URL."/wp-social-bookmarking-light/images" );
29
+ define( "WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN", "wp-social-bookmarking-light" );
30
+
31
+ load_plugin_textdomain( WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN,
32
+ "wp-content/plugins/wp-social-bookmarking-light/po" );
33
+
34
+ class WpSocialBookmarkingLight
35
+ {
36
+ var $url;
37
+ var $title;
38
+ var $encode_url;
39
+ var $encode_title;
40
+ var $encode_blogname;
41
+
42
+ function WpSocialBookmarkingLight( $url, $title, $blogname )
43
+ {
44
+ $title = $this->to_utf8( $title );
45
+ $blogname = $this->to_utf8( $blogname );
46
+ $this->url = $url;
47
+ $this->title = $title;
48
+ $this->encode_url = rawurlencode( $url );
49
+ $this->encode_title = rawurlencode( $title );
50
+ $this->encode_blogname = rawurlencode( $blogname );
51
+ }
52
+
53
+ function to_utf8( $str )
54
+ {
55
+ $charset = get_settings( 'blog_charset' );
56
+ if( strcasecmp( $charset, 'UTF-8' ) != 0 && function_exists('mb_convert_encoding') ){
57
+ $str = mb_convert_encoding( $str, 'UTF-8', $charset );
58
+ }
59
+ return $str;
60
+ }
61
+
62
+ function link_raw( $url ){
63
+ return "<li>".$url."</li>";
64
+ }
65
+ function link( $url, $alt, $icon, $width, $height ){
66
+ $width = $width ? "width='$width'" : "";
67
+ $height = $height ? "height='$height'" : "";
68
+ return $this->link_raw( "<a href='{$url}' title='{$alt}' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank>"
69
+ ."<img src='{$icon}' alt='{$alt}' title='{$alt}' $width $height class='wp_social_bookmarking_light_img' />"
70
+ ."</a>" );
71
+ }
72
+
73
+ /**
74
+ * @brief Hatena Bookmark
75
+ */
76
+ function hatena()
77
+ {
78
+ $url = "http://b.hatena.ne.jp/add?mode=confirm&url={$this->encode_url}&title={$this->encode_title}";
79
+ $alt = __( "Bookmark this on Hatena Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
80
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/hatena.gif";
81
+ return $this->link( $url, $alt, $icon, 16, 12 );
82
+ }
83
+ function hatena_users()
84
+ {
85
+ $url = "http://b.hatena.ne.jp/entry/{$this->url}";
86
+ $alt = sprintf( __("Hatena Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
87
+ $icon = "http://b.hatena.ne.jp/entry/image/{$this->url}";
88
+ return $this->link( $url, $alt, $icon, null, null );
89
+ }
90
+
91
+ /**
92
+ * @brief twib
93
+ */
94
+ function twib()
95
+ {
96
+ $url = "http://twib.jp/share?url={$this->encode_url}";
97
+ $alt = __( "Post to Twitter", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
98
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/twib.gif";
99
+ return $this->link( $url, $alt, $icon, 18, 18 );
100
+ }
101
+ function twib_users()
102
+ {
103
+ $url = "http://twib.jp/url/{$this->url}";
104
+ $alt = sprintf( __("Tweets - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
105
+ $icon = "http://image.twib.jp/counter/{$this->url}";
106
+ return $this->link( $url, $alt, $icon, null, null );
107
+ }
108
+
109
+ /**
110
+ * @brief tweetmeme
111
+ */
112
+ function tweetmeme()
113
+ {
114
+ return $this->link_raw( "<script type='text/javascript'>"
115
+ ."tweetmeme_style = 'compact';"
116
+ ."tweetmeme_url='{$this->url}';"
117
+ ."</script>"
118
+ ."<script type='text/javascript' src='http://tweetmeme.com/i/scripts/button.js'></script>" );
119
+ }
120
+
121
+ /**
122
+ * @brief Livedoor Clip
123
+ */
124
+ function livedoor()
125
+ {
126
+ $url = "http://clip.livedoor.com/redirect?link={$this->encode_url}&title={$this->encode_blogname}%20-%20{$this->encode_title}&ie=utf-8";
127
+ $alt = __( "Bookmark this on Livedoor Clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
128
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/livedoor.gif";
129
+ return $this->link( $url, $alt, $icon, 16, 16 );
130
+ }
131
+ function livedoor_users()
132
+ {
133
+ $url = "http://clip.livedoor.com/page/{$this->url}";
134
+ $alt = sprintf( __("Livedoor Clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
135
+ $icon = "http://image.clip.livedoor.com/counter/{$this->url}";
136
+ return $this->link( $url, $alt, $icon, null, null );
137
+ }
138
+
139
+ /**
140
+ * @brief Yahoo!JAPAN Bookmark
141
+ */
142
+ function yahoo()
143
+ {
144
+ $url = "http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t={$this->encode_title}&u={$this->encode_url}&ei=UTF-8";
145
+ $alt = __( "Bookmark this on Yahoo Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
146
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/yahoo.gif";
147
+ return $this->link( $url, $alt, $icon, 16, 16 );
148
+ }
149
+ function yahoo_users()
150
+ {
151
+ return $this->link_raw( "<script src='http://num.bookmarks.yahoo.co.jp/numimage.js?disptype=small'></script>" );
152
+ }
153
+
154
+ /**
155
+ * @brief BuzzURL
156
+ */
157
+ function buzzurl()
158
+ {
159
+ $url = "http://buzzurl.jp/entry/{$this->url}";
160
+ $alt = __( "Bookmark this on BuzzURL", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
161
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/buzzurl.gif";
162
+ return $this->link( $url, $alt, $icon, 21, 15 );
163
+ }
164
+ function buzzurl_users()
165
+ {
166
+ $url = "http://buzzurl.jp/entry/{$this->url}";
167
+ $alt = sprintf( __("BuzzURL - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
168
+ $icon = "http://api.buzzurl.jp/api/counter/v1/image?url={$this->encode_url}";
169
+ return $this->link( $url, $alt, $icon, null, null );
170
+ }
171
+
172
+ /**
173
+ * @brief nifty clip
174
+ */
175
+ function nifty()
176
+ {
177
+ $url = "http://clip.nifty.com/create?url={$this->encode_url}&title={$this->encode_title}";
178
+ $alt = __( "Bookmark this on @nifty clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
179
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/nifty.gif";
180
+ return $this->link( $url, $alt, $icon, 16, 16 );
181
+ }
182
+ function nifty_users()
183
+ {
184
+ $url = '#';
185
+ $alt = sprintf( __("@nifty clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
186
+ $icon = "http://api.clip.nifty.com/api/v1/image/counter/{$this->url}";
187
+ return $this->link( $url, $alt, $icon, null, null );
188
+ }
189
+
190
+ /**
191
+ * @brief Tumblr
192
+ */
193
+ function tumblr()
194
+ {
195
+ $url = "http://www.tumblr.com/share?v=3&u={$this->encode_url}&t={$this->encode_title}";
196
+ $alt = __( "Share on Tumblr", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
197
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/tumblr.png";
198
+ return $this->link( $url, $alt, $icon, 16, 16 );
199
+ }
200
+
201
+ /**
202
+ * @brief FC2 Bookmark
203
+ */
204
+ function fc2()
205
+ {
206
+ $url = "http://bookmark.fc2.com/user/post?url={$this->encode_url}&title={$this->encode_title}";
207
+ $alt = __( "Bookmark this on FC2 Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
208
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/fc2.gif";
209
+ return $this->link( $url, $alt, $icon, 16, 16 );
210
+ }
211
+ function fc2_users()
212
+ {
213
+ $url = "http://bookmark.fc2.com/search/detail?url={$this->encode_url}";
214
+ $alt = sprintf( __("FC2 Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
215
+ $icon = "http://bookmark.fc2.com/image/users/{$this->url}";
216
+ return $this->link( $url, $alt, $icon, null, null );
217
+ }
218
+
219
+ /**
220
+ * @brief newsing
221
+ */
222
+ function newsing()
223
+ {
224
+ $url = "http://newsing.jp/nbutton?url={$this->encode_url}&title={$this->encode_title}";
225
+ $alt = __( "Newsing it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
226
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/newsing.gif";
227
+ return $this->link( $url, $alt, $icon, 16, 16 );
228
+ }
229
+
230
+ /**
231
+ * @brief Choix
232
+ */
233
+ function choix()
234
+ {
235
+ $url = "http://www.choix.jp/bloglink/{$this->url}";
236
+ $alt = __( "Choix it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
237
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/choix.gif";
238
+ return $this->link( $url, $alt, $icon, 16, 16 );
239
+ }
240
+
241
+ /**
242
+ * @brief Google Bookmarks
243
+ */
244
+ function google()
245
+ {
246
+ $url = "http://www.google.com/bookmarks/mark?op=add&bkmk={$this->encode_url}&title={$this->encode_title}";
247
+ $alt = __( "Bookmark this on Google Bookmarks", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
248
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google.png";
249
+ return $this->link( $url, $alt, $icon, 16, 16 );
250
+ }
251
+
252
+ /**
253
+ * @brief Google Buzz
254
+ */
255
+ function google_buzz()
256
+ {
257
+ $url = "http://www.google.com/buzz/post?url={$this->encode_url}&message={$this->encode_title}";
258
+ $alt = __( "Post to Google Buzz", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
259
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google-buzz.png";
260
+ return $this->link( $url, $alt, $icon, 16, 16 );
261
+ }
262
+
263
+ /**
264
+ * @brief Delicious
265
+ */
266
+ function delicious()
267
+ {
268
+ $url = "http://delicious.com/save?url={$this->encode_url}&title={$this->encode_title}";
269
+ $alt = __( "Bookmark this on Delicious", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
270
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/delicious.png";
271
+ return $this->link( $url, $alt, $icon, 16, 16 );
272
+ }
273
+
274
+ /**
275
+ * @brief Digg
276
+ */
277
+ function digg()
278
+ {
279
+ $url = "http://digg.com/submit?url={$this->encode_url}&title={$this->encode_title}";
280
+ $alt = __( "Bookmark this on Digg", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
281
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/digg.png";
282
+ return $this->link( $url, $alt, $icon, 16, 16 );
283
+ }
284
+
285
+ /**
286
+ * @brief Friend feed
287
+ */
288
+ function friendfeed()
289
+ {
290
+ $url = "http://friendfeed.com/?url={$this->encode_url}&title={$this->encode_title}";
291
+ $alt = __( "Share on FriendFeed", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
292
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/friendfeed.png";
293
+ return $this->link( $url, $alt, $icon, 16, 16 );
294
+ }
295
+
296
+ /**
297
+ * @brief Facebook
298
+ */
299
+ function facebook()
300
+ {
301
+ $url = "http://www.facebook.com/share.php?u={$this->encode_url}";
302
+ $alt = __( "Share on Facebook", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
303
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/facebook.png";
304
+ return $this->link( $url, $alt, $icon, 16, 16 );
305
+ }
306
+
307
+ }
308
+
309
+ function wp_social_bookmarking_light_default_options()
310
+ {
311
+ return array( "services" => "hatena, hatena_users, facebook, google_buzz, yahoo, livedoor, friendfeed, tweetmeme",
312
+ "position" => "top",
313
+ "single_page" => true );
314
+ }
315
+
316
+ function wp_social_bookmarking_light_options()
317
+ {
318
+ return array_merge( wp_social_bookmarking_light_default_options(), get_option("wp_social_bookmarking_light_options", array()) );
319
+ }
320
+
321
+ function wp_social_bookmarking_light_wp_head()
322
+ {
323
+ ?>
324
+ <style>
325
+ ul.wp_social_bookmarking_light{list-style:none;border:0;padding:0;margin:0;}
326
+ ul.wp_social_bookmarking_light li{float:left;border:0;padding:0 4px 0 0;margin:0;height:17px;}
327
+ ul.wp_social_bookmarking_light img{border:0;padding:0;margin:0;}
328
+ wp_social_bookmarking_light_clear{clear:both;}
329
+ </style>
330
+ <?php
331
+ }
332
+
333
+ function wp_social_bookmarking_light_admin_menu()
334
+ {
335
+ if( function_exists('add_options_page') ){
336
+ add_options_page( 'WP Social Bookmarking Light Options',
337
+ 'WP Social Bookmarking Light Options',
338
+ 'manage_options',
339
+ __FILE__,
340
+ 'wp_social_bookmarking_light_options_page' );
341
+ }
342
+ }
343
+
344
+ function wp_social_bookmarking_light_the_content( $content )
345
+ {
346
+ if( is_feed() || is_404() || is_robots() || is_comments_popup() || (function_exists( 'is_ktai' ) && is_ktai()) ){
347
+ return $content;
348
+ }
349
+
350
+ $options = wp_social_bookmarking_light_options();
351
+ if( $options['single_page'] && !is_singular() ){
352
+ return $content;
353
+ }
354
+
355
+ $wp = new WpSocialBookmarkingLight( get_permalink(), get_the_title(), get_bloginfo('name') );
356
+
357
+ $out = '';
358
+ foreach( explode(",", $options['services']) as $service ){
359
+ $service = trim($service);
360
+ $out .= call_user_func( array( $wp, $service ) ); // call WpSocialBookmarkingLight method
361
+ }
362
+
363
+ if( $out == '' ){
364
+ return $content;
365
+ }
366
+ if( $options['position'] == 'top' ){
367
+ return "<ul class='wp_social_bookmarking_light'>{$out}</ul><br class='wp_social_bookmarking_light_clear' />{$content}";
368
+ }
369
+ else if( $options['position'] == 'bottom' ){
370
+ return "{$content}<ul class='wp_social_bookmarking_light'>{$out}</ul><br class='wp_social_bookmarking_light_clear' />";
371
+ }
372
+ return $content;
373
+ }
374
+
375
+ function wp_social_bookmarking_light_init()
376
+ {
377
+ add_action( 'wp_head', 'wp_social_bookmarking_light_wp_head' );
378
+ add_action( 'admin_menu', 'wp_social_bookmarking_light_admin_menu' );
379
+ add_filter( 'the_content', 'wp_social_bookmarking_light_the_content' );
380
+ }
381
+ add_action( 'init', 'wp_social_bookmarking_light_init' );
382
+
383
+ // options page
384
+ function wp_social_bookmarking_light_options_page()
385
+ {
386
+ if( isset( $_POST['save'] ) ){
387
+ $options = array( "services" => $_POST["services"],
388
+ "position" => $_POST["position"],
389
+ "single_page" => $_POST["single_page"] == 'true' );
390
+ update_option( 'wp_social_bookmarking_light_options', $options );
391
+ echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
392
+ }
393
+ else if( isset( $_POST['reset'] ) ){
394
+ $options = wp_social_bookmarking_light_default_options();
395
+ update_option( 'wp_social_bookmarking_light_options', $options );
396
+ echo '<div class="updated"><p><strong>'.__( 'Reset options.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
397
+ }
398
+ else{
399
+ $options = wp_social_bookmarking_light_options();
400
+ }
401
+ ?>
402
+ <style>
403
+ .wp_social_bookmarking_light_options{
404
+ border: 1px solid #CCCCCC;
405
+ background-color: #F8F8EB;
406
+ vertical-align: top;
407
+ margin: 0px 10px 10px 0px;
408
+ padding: 0px;
409
+ }
410
+ .wp_social_bookmarking_light_options th{
411
+ background-color: #E8E8DB;
412
+ text-align: center;
413
+ margin: 0px;
414
+ padding: 3px;
415
+ }
416
+ .wp_social_bookmarking_light_options td{
417
+ text-align: left;
418
+ margin: 0px;
419
+ padding: 3px;
420
+ }
421
+ </style>
422
+ <div class="wrap">
423
+ <h2>WP Social Bookmarking Light Options</h2>
424
+
425
+ <h3>Required</h3>
426
+ <form method='POST' action="<?php echo $_SERVER['REQUEST_URI'] ?>">
427
+ <table class='form-table'>
428
+ <tr>
429
+ <th scope="row">Position:</th>
430
+ <td>
431
+ <select name='position'>
432
+ <option value='top' <?php if( $options['position'] == 'top' ) echo 'selected'; ?>>Top</option>
433
+ <option value='bottom' <?php if( $options['position'] == 'bottom' ) echo 'selected'; ?>>Bottom</option>
434
+ <option value='none' <?php if( $options['position'] == 'none' ) echo 'selected'; ?>>None</option>
435
+ </select>
436
+ </td>
437
+ </tr>
438
+ <tr>
439
+ <th scope="row">Single Page:</th>
440
+ <td>
441
+ <select name='single_page'>
442
+ <option value='true' <?php if( $options['single_page'] == true ) echo 'selected'; ?>>True</option>
443
+ <option value='false' <?php if( $options['single_page'] == false ) echo 'selected'; ?>>False</option>
444
+ </select>
445
+ </td>
446
+ </tr>
447
+ <tr>
448
+ <th scope="row">Services: <br/> <span style="font-size:10px">(comma-separated)</span></th>
449
+ <td><input type="text" name='services' value="<?php echo $options['services'] ?>"size=80 /></td>
450
+ </tr>
451
+ </table>
452
+ <p class="submit">
453
+ <input class="button-primary" type="submit" name='save' value='<?php _e('Save Changes') ?>' />
454
+ <input type="submit" name='reset' value='<?php _e('Reset') ?>' />
455
+ </p>
456
+ </form>
457
+
458
+ <table class='wp_social_bookmarking_light_options'>
459
+ <tr><th><?php _e("Service Code") ?></th><th><?php _e("Explain") ?></th></tr>
460
+ <tr><td>hatena</td><td>Hatena Bookmark</td></tr>
461
+ <tr><td>hatena_users</td><td>Hatena Bookmark Users</td></tr>
462
+ <tr><td>twib</td><td>Twib - Twitter</td></tr>
463
+ <tr><td>twib_users</td><td>Twib Users - Twitter</td></tr>
464
+ <tr><td>tweetmeme</td><td>TweetMeme - Twitter</td></tr>
465
+ <tr><td>livedoor</td><td>Livedoor Clip</td></tr>
466
+ <tr><td>livedoor_users</td><td>Livedoor Clip Users</td></tr>
467
+ <tr><td>yahoo</td><td>Yahoo!JAPAN Bookmark</td></tr>
468
+ <tr><td>yahoo_users</td><td>Yahoo!JAPAN Bookmark Users</td></tr>
469
+ <tr><td>buzzurl</td><td>BuzzURL</td></tr>
470
+ <tr><td>buzzurl_users</td><td>BuzzURL Users</td></tr>
471
+ <tr><td>nifty</td><td>@nifty Clip</td></tr>
472
+ <tr><td>nifty_users</td><td>@nifty Clip Users</td></tr>
473
+ <tr><td>tumblr</td><td>Tumblr</td></tr>
474
+ <tr><td>fc2</td><td>FC2 Bookmark</td></tr>
475
+ <tr><td>fc2_users</td><td>FC2 Bookmark Users</td></tr>
476
+ <tr><td>newsing</td><td>newsing</td></tr>
477
+ <tr><td>choix</td><td>Choix</td></tr>
478
+ <tr><td>google</td><td>Google Bookmarks</td></tr>
479
+ <tr><td>google_buzz</td><td>Google Buzz</td></tr>
480
+ <tr><td>delicious</td><td>Delicious</td></tr>
481
+ <tr><td>digg</td><td>Digg</td></tr>
482
+ <tr><td>friendfeed</td><td>FriendFeed</td></tr>
483
+ <tr><td>facebook</td><td>Facebook Share</td></tr>
484
+ </table>
485
+ </div>
486
+ <?php
487
+ }
488
+
489
+
490
+
491
+ ?>