Hupso Share Buttons for Twitter, Facebook & Google+ - Version 1.0

Version Description

  • Initial release
Download this release

Release Info

Developer kasal
Plugin Icon 128x128 Hupso Share Buttons for Twitter, Facebook & Google+
Version 1.0
Comparing to
See all releases

Version 1.0

buttons/button100x23.png ADDED
Binary file
buttons/button120x28.png ADDED
Binary file
buttons/button140x33.png ADDED
Binary file
buttons/button160x37.png ADDED
Binary file
buttons/button60x14.png ADDED
Binary file
buttons/button80x19.png ADDED
Binary file
img/services/bebo.png ADDED
Binary file
img/services/blogger.png ADDED
Binary file
img/services/delicious.png ADDED
Binary file
img/services/digg.png ADDED
Binary file
img/services/facebook.png ADDED
Binary file
img/services/googleplus.png ADDED
Binary file
img/services/linkedin.png ADDED
Binary file
img/services/reddit.png ADDED
Binary file
img/services/stumbleupon.png ADDED
Binary file
img/services/twitter.png ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Hupso Share Buttons for Twitter, Facebook & Google+ ===
2
+ Contributors: kasal
3
+ Tags: twitter, facebook, google+, social, sharing, stumbleupon, addthis, sharethis, sexybookmarks, addtoany, lockerz, shareaholic
4
+ Requires at least: 2.8
5
+ Tested up to: 3.4
6
+ Stable tag: 1.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Help visitors share your posts on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit and others.
11
+
12
+ == Description ==
13
+
14
+ Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks:
15
+ Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous.
16
+
17
+ These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
18
+
19
+ Main features / advantages:
20
+
21
+ * Slick, minimalistic design.
22
+ * Very small and fast. The code for sharing button is very small (only a few KB), so share buttons will not slow down your website - even on devices with slow network connections. All images for social services will load on demand - only when your visitors click on them.
23
+ * All major social networks are supported.
24
+
25
+ Share Buttons are very easy to configure. Just select button size, button position and which social networking services do you want to offer to your visitors.
26
+ Button will apear below your articles or on top of them as you choose.
27
+
28
+ [Share Button Demo](http://www.hupso.com/share/).
29
+
30
+
31
+ == Installation ==
32
+
33
+ 1. Download plugin file (.zip)
34
+ 2. Extract zip file and upload folder /share-buttons-hupso/ to /wp-content/plugins/
35
+ 3. Go to "Plugins" and activate the plugin
36
+
37
+
38
+ == Frequently Asked Questions ==
39
+
40
+ = How do I change settings? =
41
+
42
+ From the Wordpress Administration go to "Plugins" and click on "Settings" under plugin name
43
+
44
+ = Which social networks are supported? =
45
+
46
+ All major social networks are supported: Twitter, Facebook, Google+, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicious.
47
+
48
+ = What settings are available? =
49
+
50
+ From Settings screen you are able to choose:
51
+ * button size (5 different sizes)
52
+ * social sharing services
53
+ * menu type
54
+ * button position (above or below your posts)
55
+
56
+ Please look at *Screenshots* for more information.
57
+
58
+ = Are share buttons using Javascript? =
59
+
60
+ Yes. Javascript is required for sharing buttons to function properly and it must be enabled. Menu interface for share buttons is loaded at run-time from our servers so we can add minor enhancements and fix browser bugs the moment they are discovered without forcing you to upgrade the plugin all the time. All images for social networks and for share buttons are loaded from your local Wordpress installation.
61
+
62
+ = Are share buttons free? =
63
+
64
+ Yes. Thay are free and will always be free. And you do not need to open an account to use them.
65
+
66
+ = When will floating toolbars be available? =
67
+
68
+ [Hupso Share Buttons](http://www.hupso.com/share/) provide other button types icluding flaoting toolbars. We plan to implement those in next versions of this plugin.
69
+
70
+
71
+ == Screenshots ==
72
+
73
+ 1. Share Buttons under post
74
+ 2. Share Buttons with drop down menu (icons and service names)
75
+ 3. Share Buttons with drop down menu (icons only)
76
+ 4. Settings in Wordpress Administration
77
+
78
+
79
+ == Changelog ==
80
+
81
+ = 1.0 =
82
+ * Initial release
83
+
84
+
85
+
86
+
87
+
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
share-buttons-hupso.php ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
+ Plugin URI: http://www.hupso.com/share
5
+ Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
+ Version: 1.0
7
+ Author: kasal
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+ */
11
+
12
+ $hupso_plugin_url = plugins_url() . '/share-buttons-hupso';
13
+ add_filter( 'the_content', 'hupso_the_content', 100 );
14
+ load_plugin_textdomain('share_buttons_hupso', false, dirname( __FILE__ ) . '/languages' );
15
+
16
+ if ( is_admin() ) {
17
+ add_filter( 'plugin_action_links', 'hupso_plugin_action_links', 10, 2 );
18
+ add_action( 'admin_menu', 'hupso_admin_menu' );
19
+ }
20
+
21
+ $all_services = array(
22
+ 'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
23
+ );
24
+ $default_services = array(
25
+ 'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
26
+ );
27
+
28
+
29
+ function hupso_admin_menu() {
30
+ add_options_page('', '', 'manage_options', __FILE__, 'hupso_admin_settings_show', '', 6);
31
+ }
32
+
33
+ function hupso_admin_settings_show() {
34
+ global $all_services, $default_services, $hupso_plugin_url;
35
+
36
+ if ( !current_user_can( 'manage_options' ) ) {
37
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
38
+ }
39
+
40
+ $msg = hupso_admin_settings_save();
41
+
42
+ echo '<div class="wrap" style="padding-bottom:100px;"><div class="icon32" id="icon-users"></div>';
43
+ echo '<h2>'. __('Hupso Share Buttons for Twitter, Facebook & Google+ (Settings)').'</h2>';
44
+ echo '<form method="post" action="">';
45
+ echo '<div style="float:right; padding: 20px 20px 20px 20px; margin-right:20px; margin-top:20px; background: #F7FFBF;">'.$msg.'</div>';
46
+
47
+ $start = '<!-- Hupso Share Buttons (http://www.hupso.com/share) -->';
48
+ $end = '<!-- Hupso Share Buttons -->';
49
+ $class_name = 'hupso_pop';
50
+ $alt = 'Social Sharing Buttons';
51
+ $class_url = ' href="http://www.hupso.com/share" ';
52
+ $style = 'padding-left:5px; padding-top:5px; padding-bottom:5px; margin:0';
53
+
54
+ $button_60_img = '<img style="'.$style.'" src="'.$hupso_plugin_url.'/buttons/button60x14.png" width="60" height="14" border="0" alt="'.$alt.'"/>';
55
+ $button_60 = $start;
56
+ $button_60 .= '<a class="'.$class_name.$class_url.'>'.$button_60_img.'</a>';
57
+ $button_60 .= $js_share;
58
+ $button_60 .= $end;
59
+
60
+ $button_80_img = '<img style="'.$style.'" src="'.$hupso_plugin_url.'/buttons/button80x19.png" width="80" height="19" border="0" alt="'.$alt.'"/>';
61
+ $button_80 = $start;
62
+ $button_80 .= '<a class="'.$class_name.$class_url.'>'.$button_80_img.'</a>';
63
+ $button_80 .= $js_share;
64
+ $button_80 .= $end;
65
+
66
+ $button_100_img = '<img style="'.$style.'" src="'.$hupso_plugin_url.'/buttons/button100x23.png" width="100" height="23" border="0" alt="'.$alt.'"/>';
67
+ $button_100 = $start;
68
+ $button_100 .= '<a class="'.$class_name.$class_url.'>'.$button_100_img.'</a>';
69
+ $button_100 .= $js_share;
70
+ $button_100 .= $end;
71
+
72
+ $button_120_img = '<img style="'.$style.'" src="'.$hupso_plugin_url.'/buttons/button120x28.png" width="120" height="28" border="0" alt="'.$alt.'"/>';
73
+ $button_120 = $start;
74
+ $button_120 .= '<a class="'.$class_name.$class_url.'>'.$button_120_img.'</a>';
75
+ $button_120 .= $js_share;
76
+ $button_120 .= $end;
77
+
78
+ $button_160_img = '<img style="'.$style.'" src="'.$hupso_plugin_url.'/buttons/button160x37.png" width="160" height="37" border="0" alt="'.$alt.'"/>';
79
+ $button_160 = $start;
80
+ $button_160 .= '<a class="'.$class_name.$class_url.'>'.$button_160_img.'</a>';
81
+ $button_160 .= $js_share;
82
+ $button_160 .= $end;
83
+
84
+ $checked = 'checked="checked"';
85
+ $current_button_size = get_option( 'hupso_button_size' , 'button120x28' );
86
+ switch ( $current_button_size ) {
87
+ case 'button60x14' : $button60_checked = $checked; break;
88
+ case 'button80x19' : $button80_checked = $checked; break;
89
+ case 'button100x23' : $button100_checked = $checked; break;
90
+ case 'button120x28' : $button120_checked = $checked; break;
91
+ case 'button160x37' : $button160_checked = $checked; break;
92
+ default:
93
+ $button120_checked = $checked; break;
94
+ }
95
+
96
+ ?>
97
+ <table border="0">
98
+ <tr>
99
+ <td style="width:170px;"><?php _e('Button size:'); ?></td>
100
+ <td>
101
+ <table border="0">
102
+ <tr><td><input type="radio" name="hupso_button_size" value="button60x14" <?php echo $button60_checked; ?> /></td><td style="padding-right:10px;"><?php echo $button_60_img ?></td></tr>
103
+ <tr><td><input type="radio" name="hupso_button_size" value="button80x19" <?php echo $button80_checked; ?>/></td><td style="padding-right:10px;"><?php echo $button_80_img ?></td></tr>
104
+ <tr><td><input type="radio" name="hupso_button_size" value="button100x23" <?php echo $button100_checked; ?>/></td><td style="padding-right:10px;"><?php echo $button_100_img ?></td></tr>
105
+ <tr><td><input type="radio" name="hupso_button_size" value="button120x28" <?php echo $button120_checked; ?>/></td><td style="padding-right:10px;"><?php echo $button_120_img ?></td></tr>
106
+ <tr><td><input type="radio" name="hupso_button_size" value="button160x37" <?php echo $button160_checked; ?>/></td><td style="padding-right:20px;"><?php echo $button_160_img ?></td></tr>
107
+ </table>
108
+ </td>
109
+ </tr>
110
+ <tr>
111
+ <td style="width:170px;"><?php _e('Social sharing services'); ?></td>
112
+ <td><hr style="height:1px;"/><?php hupso_settings_print_services(); ?></td>
113
+ </tr>
114
+ <tr>
115
+ <td><?php _e('Type of menu'); ?></td>
116
+ <?php
117
+ $menu_type = get_option( 'hupso_menu_type', 'labels' );
118
+ $checked = ' checked="checked" ';
119
+ switch ( $menu_type ) {
120
+ case 'labels': $hupso_labels_checked = $checked; break;
121
+ case 'icons' : $hupso_icons_checked = $checked; break;
122
+ default: $hupso_labels_checked = $checked;
123
+ }
124
+
125
+ ?>
126
+ <td><hr style="height:1px;"/><input type="radio" name="hupso_menu_type" value="labels" <?php echo $hupso_labels_checked; ?> /> <?php _e('Show icons and service names'); ?><br/>
127
+ <input type="radio" name="hupso_menu_type" value="icons" <?php echo $hupso_icons_checked; ?> /> <?php _e('Show icons only'); ?><br/></td>
128
+ </tr>
129
+ <tr>
130
+ <td><?php _e('Button position'); ?></td>
131
+ <?php
132
+ $button_position = get_option( 'hupso_button_position', 'below' );
133
+ $checked = ' checked="checked" ';
134
+ switch ( $button_position ) {
135
+ case 'below': $hupso_below_checked = $checked; break;
136
+ case 'above' : $hupso_above_checked = $checked; break;
137
+ default: $hupso_below_checked = $checked;
138
+ }
139
+
140
+ ?>
141
+ <td><hr style="height:1px;"/><input type="radio" name="hupso_button_position" value="below" <?php echo $hupso_below_checked; ?> /> <?php _e('Below the post'); ?><br/>
142
+ <input type="radio" name="hupso_button_position" value="above" <?php echo $hupso_above_checked; ?> /> <?php _e('Above the post'); ?><br/></td>
143
+ </tr>
144
+ </table>
145
+ <br/><br/><input class="button-primary" name="submit" type="submit" value="<?php _e('Save Settings'); ?>" />
146
+ </form>
147
+ </div>
148
+ <?php
149
+ }
150
+
151
+ function hupso_admin_settings_save() {
152
+
153
+ global $all_services, $default_services, $hupso_plugin_url;
154
+ $code = '';
155
+
156
+ if ( $_POST[ 'hupso_button_size' ] != '' )
157
+ $post = true;
158
+ else
159
+ $post = false;
160
+
161
+
162
+ /* save button size */
163
+ if ( $post ) {
164
+ $hupso_button_size = $_POST[ 'hupso_button_size' ];
165
+ update_option( 'hupso_button_size', $hupso_button_size );
166
+ } else {
167
+ $hupso_button_size = get_option ( 'hupso_button_size', 'button120x28');
168
+ }
169
+
170
+ $b_size = str_replace( 'button', '', $hupso_button_size);
171
+ list($width, $height) = split('x', $b_size);
172
+
173
+ /* save services */
174
+ $hupso_vars = 'var hupso_services=new Array(';
175
+ foreach ( $all_services as $service_text ) {
176
+ $service_name = strtolower( $service_text );
177
+ $service_name = str_replace( ' ', '', $service_name );
178
+ if ( $post ) {
179
+ $value = $_POST[ $service_name ];
180
+ update_option( 'hupso_' . $service_name, $value );
181
+ }
182
+ else {
183
+ $value = get_option ( 'hupso_' . $service_name, in_array( $service_text, $default_services ) );
184
+ }
185
+ if ( $value == '1' ) {
186
+ $hupso_vars .= '"' . $service_text .'",';
187
+ }
188
+ }
189
+ $hupso_vars .= ');';
190
+ $hupso_vars = str_replace(',)', ')', $hupso_vars);
191
+
192
+ /* save menu type */
193
+ if ( $post ) {
194
+ $hupso_menu_type = $_POST[ 'hupso_menu_type' ];
195
+ update_option( 'hupso_menu_type', $hupso_menu_type );
196
+ }
197
+ else {
198
+ $hupso_menu_type = get_option ( 'hupso_menu_type', 'labels');
199
+ }
200
+ $hupso_vars .= 'var icon_type = "'.$hupso_menu_type.'";';
201
+
202
+
203
+ /* save button position */
204
+ if ( $post ) {
205
+ $hupso_button_position = $_POST[ 'hupso_button_position' ];
206
+ update_option( 'hupso_button_position', $hupso_button_position );
207
+ }
208
+ else {
209
+ $hupso_button_position = get_option ( 'hupso_button_position', 'below');
210
+ }
211
+
212
+ /* create and save code */
213
+ /* all images are server from local Wordpress installation */
214
+ /* minified button code is served by Hupso Static Server */
215
+ $static_server = 'http://static.hupso.com/share/js/share.js';
216
+ $code = '<!-- Hupso Share Buttons (http://www.hupso.com/share) --><a class="hupso_pop" href="http://www.hupso.com/share"><img src="'.$hupso_plugin_url.'/buttons/'.$hupso_button_size.'.png" width="'.$width.'" height="'.$height.'" border="0" alt="Share Button"/></a><script type="text/javascript">';
217
+ $code .= $hupso_vars;
218
+ $code .= '</script><script type="text/javascript" src="' . $static_server . '"></script><!-- Hupso Share Buttons -->';
219
+ update_option( 'hupso_share_buttons_code', $code );
220
+
221
+ /* create preview */
222
+ $msg .= '<h3>' . __('Button Preview'). '</h3><br/>';
223
+ $msg .= $code . '<br/><br/>';
224
+ $msg .= __('Move your mouse over the button above to see the sharing menu.');
225
+ $msg .= '<br/><br/><br/>';
226
+ $msg .= '<input class="button-primary" name="submit" type="submit" value="' . __('Update Preview') . '" /> ';
227
+
228
+ return $msg;
229
+ }
230
+
231
+
232
+ function hupso_the_content( $content ) {
233
+
234
+ global $hupso_plugin_url;
235
+
236
+ /* default code */
237
+ $share_code = '<!-- Hupso Share Buttons (http://www.hupso.com/share) --><a class="hupso_pop" href="http://www.hupso.com/share"><img src="'.$hupso_plugin_url.'/buttons/button120x28.png" width="100" height="23" border="0" alt="Share Button"/></a><script type="text/javascript">var hupso_services=new Array("Twitter","Facebook","Google Plus","Linkedin","StumbleUpon");var icon_type = "labels";</script><!-- Hupso Share Buttons -->';
238
+
239
+ $code = get_option ( 'hupso_share_buttons_code', $share_code );
240
+
241
+ $position = get_option( 'hupso_button_position', 'below' );
242
+ if ($position == 'below')
243
+ $new_content = $content . $code;
244
+ else
245
+ $new_content = $code . $content;
246
+
247
+ return $new_content;
248
+ }
249
+
250
+ function hupso_settings_print_services() {
251
+
252
+ global $all_services, $default_services, $hupso_plugin_url;
253
+
254
+ foreach ( $all_services as $service_text ) {
255
+ $service_name = strtolower( $service_text );
256
+ $service_name = str_replace( ' ', '', $service_name );
257
+
258
+ $checked = '';
259
+ $value = get_option( 'hupso_' . $service_name , in_array( $service_text, $default_services ) );
260
+ if ( $value == "1" ) {
261
+ $checked = 'checked="checked"';
262
+ }
263
+ $text =' <img src="' . $hupso_plugin_url . '/img/services/' . $service_name . '.png"/> ' . $service_text;
264
+ echo '<input type="checkbox" name="' . $service_name . '" value="1" ' . $checked . ' /> ' . $text . '<br/>';
265
+ }
266
+ }
267
+
268
+ function hupso_plugin_action_links( $links, $file ) {
269
+ static $this_plugin;
270
+ if ( !$this_plugin ) {
271
+ $this_plugin = plugin_basename( __FILE__ );
272
+ }
273
+
274
+ // check to make sure we are on the correct plugin
275
+ if ( $file == $this_plugin ) {
276
+ $settings_link = '<a href="options-general.php?page=share-buttons-hupso/share-buttons-hupso.php">' . __('Settings') . '</a>';
277
+ array_unshift( $links, $settings_link );
278
+ }
279
+
280
+ return $links;
281
+ }
282
+
283
+
284
+ ?>