Social Media Feather | social media sharing - Version 1.2.1

Version Description

  • Added Pinterest as sharing and following network
  • Added ability to automatically append following buttons as well
  • Added ability to disable automatic appending for posts with custom fields
  • Added class, show and hide parameters to shortcodes
Download this release

Release Info

Developer Synved
Plugin Icon 128x128 Social Media Feather | social media sharing
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.0 to 1.2.1

readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Social Media Feather ===
2
  Contributors: Synved
3
  Donate link: http://synved.com/wordpress-social-media-feather/
4
- Tags: shortcode, shortcodes, link, links, url, permalink, permalinks, time, icons, button, buttons, free, content, plugin, Share, sharing, page, pages, widget, CSS, list, media, profile, shortlinks, social, social media, twitter, google, Facebook, Reddit, youtube, bookmark, bookmarks, bookmarking, linkedin, image, edit, manage, mail, Post, posts, Style, seo, title
5
  Requires at least: 3.1
6
- Tested up to: 3.4.2
7
  Stable tag: trunk
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Super lightweight, simple, nice, modern looking and effective social sharing and
12
 
13
  == Description ==
14
 
15
- [WordPress Social Media Feather](http://synved.com/wordpress-social-media-feather/ "WordPress Social Media Feather – lightweight social sharing and following") is a super lightweight free social media WordPress plugin that allows you to quickly and painlessly add **social sharing and following** features to all your posts, pages and custom post types.
16
 
17
  The primary goal behind the plugin is to provide very lightweight WordPress social sharing and following that doesn’t add any unnecessary burden to your site and especially on your users.
18
 
@@ -24,7 +24,7 @@ By keeping load times at a minimum, you ensure that all the social sharing aspec
24
 
25
  On the other hand, given the widespread focus on WordPress social media integration, your site will still provide social bookmarks to improve visibility of your posts and content and improve your overall global reach.
26
 
27
- The WordPress social media sharing offered by the plugin includes all major social sharing providers like Facebook, Twitter, Google+, reddit, Linkedin and even e-mail.
28
 
29
  The plugin also offers widgets for sharing and following buttons that you can place in any widgetized area in your site. Widgets also expose some settings to tweak appearance.
30
 
@@ -32,15 +32,15 @@ The plugin also offers widgets for sharing and following buttons that you can pl
32
  * Integrated WordPress social sharing
33
  * WordPress social sharing and following widgets
34
  * Supports all major providers of social features
35
- * Sharing with Facebook, Twitter, Google+, reddit, Linkedin and e-mail
36
- * Following on Facebook, Twitter, Google+, Linkedin, YouTube or RSS Feed
37
  * Each social provider can be enabled or disabled
38
  * Ability to select what services each provider will be exposed for
39
  * Full customization for titles and URLs for each provider
40
  * Super lightweight social sharing and following
41
  * Comes with a default modern icon set
42
  * For further customization more [social icons skins](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!") are available
43
- * Potential skins can be quadrupled by [fading and greying out](http://synved.com/product/feather-grey-fade/ "Quadruple the amount of available social icon skins!") social icons
44
 
45
  = Example Shortcodes =
46
 
@@ -62,11 +62,22 @@ The next shortcode will create a list of social following buttons that allow vis
62
  The next shortcode will create a list of social following buttons that allow visitors to follow you, using the "Balloon" icons skin with a size of 64 pixels:
63
  `[feather_follow skin="balloon" size="64"]`
64
 
 
 
 
 
 
 
 
 
 
 
 
65
  = Related Links: =
66
 
67
  * [WordPress Social Media Feather Official Page](http://synved.com/wordpress-social-media-feather/ "WordPress Social Media Feather – lightweight social sharing and following")
68
  * [Extra Social Icons Skins](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!")
69
- * [Grey Fade addon that can grey out and fade out any social icons set](http://synved.com/product/feather-grey-fade/ "Quadruple the amount of available social icon skins!")
70
  * [Our own site](http://synved.com/) where you can see social sharing and following in action
71
  * [Stripefolio theme demo](http://wpdemo.synved.com/stripefolio/) where you can see some of the social sharing and following features in action
72
  * [The free Stripefolio WordPress portfolio theme](http://synved.com/stripefolio-free-wordpress-portfolio-theme/ "A free WordPress theme that serves as a readable blog and a full-screen portfolio showcase") the Official page for the theme in the above demo link
@@ -89,14 +100,19 @@ Have a look at [our site](http://synved.com/) or the [Stripefolio portfolio them
89
  1. An example of how the sharing or following buttons appear in the front-end at 64 pixel resolution
90
  2. An example of how the sharing or following buttons appear in the front-end at 24 pixel resolution
91
  3. An example of how the sharing or following buttons appear in the front-end using the [Extra Social Icons addon](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!")
92
- 4. Showing how using the [Grey Fade addon](http://synved.com/product/feather-grey-fade/ "Quadruple the amount of available social icon skins!") transforms the sharing or following buttons in the front-end
93
  5. A demo of how providers can be customized in the back-end
94
  6. An view of some of the settings that can be customized in the back-end
95
  7. This shows the available social sharing and following widgets and their settings
96
 
97
  == Changelog ==
98
 
 
 
 
 
 
 
99
  = 1.0 =
100
  * First public release.
101
 
102
-
1
  === Social Media Feather ===
2
  Contributors: Synved
3
  Donate link: http://synved.com/wordpress-social-media-feather/
4
+ Tags: shortcode, shortcodes, link, links, url, permalink, permalinks, time, icons, button, buttons, free, content, plugin, Share, sharing, page, pages, widget, CSS, list, media, profile, shortlinks, social, social media, Like, twitter, google, Facebook, Reddit, youtube, bookmark, bookmarks, bookmarking, pinterest, linkedin, image, edit, manage, mail, Post, posts, Style, seo, title, filter
5
  Requires at least: 3.1
6
+ Tested up to: 3.5.1
7
  Stable tag: trunk
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
  == Description ==
14
 
15
+ [WordPress Social Media Feather](http://synved.com/wordpress-social-media-feather/ "Lightweight WordPress social sharing and following") is a super lightweight free social media WordPress plugin that allows you to quickly and painlessly add **social sharing and following** features to all your posts, pages and custom post types.
16
 
17
  The primary goal behind the plugin is to provide very lightweight WordPress social sharing and following that doesn’t add any unnecessary burden to your site and especially on your users.
18
 
24
 
25
  On the other hand, given the widespread focus on WordPress social media integration, your site will still provide social bookmarks to improve visibility of your posts and content and improve your overall global reach.
26
 
27
+ The WordPress social media sharing offered by the plugin includes all major social sharing providers like Facebook, Twitter, Google+, reddit, Pinterest, Linkedin and even e-mail.
28
 
29
  The plugin also offers widgets for sharing and following buttons that you can place in any widgetized area in your site. Widgets also expose some settings to tweak appearance.
30
 
32
  * Integrated WordPress social sharing
33
  * WordPress social sharing and following widgets
34
  * Supports all major providers of social features
35
+ * Sharing with Facebook, Twitter, Google+, reddit, Pinterest, Linkedin and e-mail
36
+ * Following on Facebook, Twitter, Google+, Pinterest, Linkedin, YouTube or RSS Feed
37
  * Each social provider can be enabled or disabled
38
  * Ability to select what services each provider will be exposed for
39
  * Full customization for titles and URLs for each provider
40
  * Super lightweight social sharing and following
41
  * Comes with a default modern icon set
42
  * For further customization more [social icons skins](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!") are available
43
+ * Available skins can be customized with cool effects like [fading and greying out](http://synved.com/product/feather-grey-fade/ "Customize any of the available social icon skins with 2 cool effects!") social icons
44
 
45
  = Example Shortcodes =
46
 
62
  The next shortcode will create a list of social following buttons that allow visitors to follow you, using the "Balloon" icons skin with a size of 64 pixels:
63
  `[feather_follow skin="balloon" size="64"]`
64
 
65
+ = Template Tags =
66
+
67
+ If you don't want to use shortcodes but instead prefer to use PHP directly, there are 2 PHP functions/template tags you can use.
68
+
69
+ For sharing buttons you can use:
70
+ `synved_social_share_markup();`
71
+
72
+ For following buttons you can use:
73
+ `synved_social_follow_markup();`
74
+
75
+
76
  = Related Links: =
77
 
78
  * [WordPress Social Media Feather Official Page](http://synved.com/wordpress-social-media-feather/ "WordPress Social Media Feather – lightweight social sharing and following")
79
  * [Extra Social Icons Skins](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!")
80
+ * [Grey Fade addon that can grey out and fade out any social icons set](http://synved.com/product/feather-grey-fade/ "Customize any of the available social icon skins with 2 cool effects!")
81
  * [Our own site](http://synved.com/) where you can see social sharing and following in action
82
  * [Stripefolio theme demo](http://wpdemo.synved.com/stripefolio/) where you can see some of the social sharing and following features in action
83
  * [The free Stripefolio WordPress portfolio theme](http://synved.com/stripefolio-free-wordpress-portfolio-theme/ "A free WordPress theme that serves as a readable blog and a full-screen portfolio showcase") the Official page for the theme in the above demo link
100
  1. An example of how the sharing or following buttons appear in the front-end at 64 pixel resolution
101
  2. An example of how the sharing or following buttons appear in the front-end at 24 pixel resolution
102
  3. An example of how the sharing or following buttons appear in the front-end using the [Extra Social Icons addon](http://synved.com/product/feather-extra-social-icons/ "Add 8 extra social icon skins to the Social Media Feather plugin!")
103
+ 4. Showing how using the [Grey Fade addon](http://synved.com/product/feather-grey-fade/ "Customize any of the available social icon skins with 2 cool effects!") transforms the sharing or following buttons in the front-end
104
  5. A demo of how providers can be customized in the back-end
105
  6. An view of some of the settings that can be customized in the back-end
106
  7. This shows the available social sharing and following widgets and their settings
107
 
108
  == Changelog ==
109
 
110
+ = 1.2.1 =
111
+ * Added Pinterest as sharing and following network
112
+ * Added ability to automatically append following buttons as well
113
+ * Added ability to disable automatic appending for posts with custom fields
114
+ * Added class, show and hide parameters to shortcodes
115
+
116
  = 1.0 =
117
  * First public release.
118
 
 
social-media-feather.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Social Media Feather
4
  Plugin URI: http://synved.com/wordpress-social-media-feather/
5
  Description: Super lightweight social media plugin to add nice and effective social sharing and following buttons and icons anywhere on your site without the extra burden
6
  Author: Synved
7
- Version: 1.0
8
  Author URI: http://synved.com/
9
 
10
  LEGAL STATEMENTS
4
  Plugin URI: http://synved.com/wordpress-social-media-feather/
5
  Description: Super lightweight social media plugin to add nice and effective social sharing and following buttons and icons anywhere on your site without the extra burden
6
  Author: Synved
7
+ Version: 1.2.1
8
  Author URI: http://synved.com/
9
 
10
  LEGAL STATEMENTS
synved-option/addons/option-type-addon/script/custom.js CHANGED
@@ -109,7 +109,7 @@ jQuery(document).ready(function() {
109
  container: containerId,
110
  //drop_element: '',
111
  file_data_name: fileField,
112
- max_file_size: '1mb',
113
  max_file_count: 1,
114
  flash_swf_url: SynvedOptionVars.flash_swf_url,
115
  silverlight_xap_url: SynvedOptionVars.silverlight_xap_url,
109
  container: containerId,
110
  //drop_element: '',
111
  file_data_name: fileField,
112
+ max_file_size: '3mb',
113
  max_file_count: 1,
114
  flash_swf_url: SynvedOptionVars.flash_swf_url,
115
  silverlight_xap_url: SynvedOptionVars.silverlight_xap_url,
synved-option/script/custom.js CHANGED
@@ -96,5 +96,24 @@ jQuery(document).ready(function() {
96
  });
97
 
98
  jQuery('.synved-option-tag-selector').suggest(ajaxurl + '?action=ajax-tag-search&tax=post_tag', {multiple: true, multipleSep: ','});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  });
100
 
96
  });
97
 
98
  jQuery('.synved-option-tag-selector').suggest(ajaxurl + '?action=ajax-tag-search&tax=post_tag', {multiple: true, multipleSep: ','});
99
+
100
+ jQuery('.synved-option-reset-button').click(function (e) {
101
+ var jthis = jQuery(this);
102
+ var input = jthis.parentsUntil('tr').find('input, textarea');
103
+
104
+ if (input.size() > 0)
105
+ {
106
+ var placeholder = input.attr('placeholder');
107
+
108
+ if (placeholder != null)
109
+ {
110
+ input.val(placeholder);
111
+ }
112
+ }
113
+
114
+ e.preventDefault();
115
+
116
+ return false;
117
+ });
118
  });
119
 
synved-option/synved-option-item.php CHANGED
@@ -731,7 +731,7 @@ function synved_option_item_sanitize_value($id, $name, $value, array $item = nul
731
 
732
  if ($sanitize_raw != null)
733
  {
734
- return $sanitize_raw->Invoke(array($value, $name, $id));
735
  }
736
 
737
  $value = synved_option_item_sanitize_value_basic($item, $value, $default);
@@ -771,7 +771,7 @@ function synved_option_item_sanitize_value($id, $name, $value, array $item = nul
771
  {
772
  if ($sanitize != null)
773
  {
774
- $value = $sanitize->Invoke(array($value, $name, $id));
775
  }
776
 
777
  return $value;
731
 
732
  if ($sanitize_raw != null)
733
  {
734
+ return $sanitize_raw->Invoke(array($value, $name, $id, $item));
735
  }
736
 
737
  $value = synved_option_item_sanitize_value_basic($item, $value, $default);
771
  {
772
  if ($sanitize != null)
773
  {
774
+ $value = $sanitize->Invoke(array($value, $name, $id, $item));
775
  }
776
 
777
  return $value;
synved-option/synved-option-render.php CHANGED
@@ -346,7 +346,7 @@ function synved_option_render_item($id, $name, $item = null, $render = false, $p
346
  }
347
  case 'color':
348
  {
349
- $out .= '<div style="position:relative;">';
350
  $out .= '<input name="' . $out_name . '" id="' . $out_id . '" type="text" value="' . esc_attr($value) . '" class="code medium-text color-input"' . $placeholder . ' />';
351
  $out .= '<div class="synved-option-color-input-picker" style="background:white;border:solid 1px #ccc;display:none;position:absolute;top:100%;left:0;z-index:10000;"></div>';
352
  $out .= '</div>';
@@ -420,6 +420,11 @@ function synved_option_render_item($id, $name, $item = null, $render = false, $p
420
  break;
421
  }
422
  }
 
 
 
 
 
423
  }
424
 
425
  $item_render = synved_option_item_render($item);
346
  }
347
  case 'color':
348
  {
349
+ $out .= '<div style="position:relative; float: left;">';
350
  $out .= '<input name="' . $out_name . '" id="' . $out_id . '" type="text" value="' . esc_attr($value) . '" class="code medium-text color-input"' . $placeholder . ' />';
351
  $out .= '<div class="synved-option-color-input-picker" style="background:white;border:solid 1px #ccc;display:none;position:absolute;top:100%;left:0;z-index:10000;"></div>';
352
  $out .= '</div>';
420
  break;
421
  }
422
  }
423
+
424
+ if ($hint != null)
425
+ {
426
+ $out .= ' <span class="snvdopt"><a class="button synved-option-reset-button" title="' . __('Set value to default hinted background value', 'synved-option') . '" style="display: inline-block; padding: 0; vertical-align: middle; cursor: pointer;"><span class="ui-icon ui-icon-arrowrefresh-1-w"> </span></a></span>';
427
+ }
428
  }
429
 
430
  $item_render = synved_option_item_render($item);
synved-option/synved-option.php CHANGED
@@ -25,8 +25,8 @@ include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'synved-option-setting.ph
25
 
26
 
27
  define('SYNVED_OPTION_LOADED', true);
28
- define('SYNVED_OPTION_VERSION', 100030009);
29
- define('SYNVED_OPTION_VERSION_STRING', '1.3.9');
30
 
31
 
32
  $synved_option = array();
25
 
26
 
27
  define('SYNVED_OPTION_LOADED', true);
28
+ define('SYNVED_OPTION_VERSION', 100040001);
29
+ define('SYNVED_OPTION_VERSION_STRING', '1.4.1');
30
 
31
 
32
  $synved_option = array();
synved-social/image/social-feather-light-prompt-demo.png ADDED
Binary file
synved-social/image/social/regular/16x16/pinterest.png ADDED
Binary file
synved-social/image/social/regular/24x24/pinterest.png ADDED
Binary file
synved-social/image/social/regular/32x32/pinterest.png ADDED
Binary file
synved-social/image/social/regular/48x48/pinterest.png ADDED
Binary file
synved-social/image/social/regular/64x64/pinterest.png ADDED
Binary file
synved-social/image/social/regular/96x96/pinterest.png ADDED
Binary file
synved-social/synved-social-setup.php CHANGED
@@ -21,18 +21,32 @@ function synved_social_provider_settings()
21
  if (isset($share_providers[$provider_name]))
22
  {
23
  $display_set .= ',share=Share';
24
- $display_default = 'share';
 
 
 
 
25
  }
26
 
27
  if (isset($follow_providers[$provider_name]))
28
  {
29
  $display_set .= ',follow=Follow';
30
- $display_default = 'follow';
31
 
32
  if (isset($share_providers[$provider_name]))
33
  {
34
  $display_set .= ',both=Share & Follow';
35
- $display_default = 'both';
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  }
38
 
@@ -100,7 +114,7 @@ $synved_social_options = array(
100
  'sections' => array(
101
  'section_general' => array(
102
  'label' => __('General Settings', 'synved-social'),
103
- 'tip' => __('Settings affecting the general behavior of the plugin', 'synved-social'),
104
  'settings' => array(
105
  'use_shortlinks' => array(
106
  'default' => false, 'label' => __('Use Shortlinks', 'synved-social'),
@@ -110,21 +124,59 @@ $synved_social_options = array(
110
  'default' => true, 'label' => __('Shortcodes In Widgets', 'synved-social'),
111
  'tip' => __('Allow shortcodes in Text widgets', 'synved-social')
112
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  'automatic_share' => array(
114
  'default' => false, 'label' => __('Display Sharing Buttons', 'synved-social'),
115
- 'tip' => __('Tries to automatically append sharing buttons to your posts', 'synved-social')
116
  ),
117
  'automatic_share_post_types' => array(
118
  'type' => 'custom',
119
  'default' => 'post',
120
- 'set' => synved_option_callback('synved_social_automatic_share_post_types_set', array('post', 'page')),
121
  'label' => __('Share Post Types', 'synved-social'),
122
- 'tip' => __('Post types for which automatic appending should be attempted (CTRL + click to select multiple ones)', 'synved-social'),
123
- 'render' => 'synved_social_automatic_share_post_types_render'
124
  ),
125
- 'show_credit' => array(
126
- 'default' => true, 'label' => __('Show Credit', 'synved-social'),
127
- 'tip' => __('Display a small icon with a link to the Social Media Feather page', 'synved-social')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  ),
129
  )
130
  ),
@@ -155,6 +207,14 @@ $synved_social_options = array(
155
  'label' => __('Grey Fade Effect', 'synved-social'),
156
  'tip' => synved_option_callback('synved_social_option_addon_grey_fade_tip', __('Click the button to install the "Grey Fade" addon, get it <a target="_blank" href="http://synved.com/product/feather-grey-fade/">here</a>.', 'synved-social'))
157
  ),
 
 
 
 
 
 
 
 
158
  'icon_size' => array(
159
  'default' => 48,
160
  'set' => '16=16x16,24=24x24,32=32x32,48=48x48,64=64x64,96=96x96',
@@ -188,6 +248,16 @@ synved_option_register('synved_social', $synved_social_options);
188
  synved_option_include_module_addon_list('synved-social');
189
 
190
 
 
 
 
 
 
 
 
 
 
 
191
  function synved_social_page_settings_tip($tip, $item)
192
  {
193
  if (!function_exists('synved_shortcode_version'))
@@ -269,7 +339,7 @@ function synved_social_icon_skin_render($value, $params, $id, $name, $item)
269
  }
270
 
271
 
272
- function synved_social_automatic_share_post_types_set($set, $item)
273
  {
274
  if ($set != null && !is_array($set))
275
  {
@@ -287,7 +357,7 @@ function synved_social_automatic_share_post_types_set($set, $item)
287
  return $set;
288
  }
289
 
290
- function synved_social_automatic_share_post_types_render($value, $params, $id, $name, $item)
291
  {
292
  $uri = synved_social_path_uri();
293
  $icons = synved_social_icon_skin_list();
@@ -327,7 +397,15 @@ function synved_social_option_addon_extra_icons_tip($tip, $item)
327
  {
328
  if (synved_option_addon_installed('synved_social', 'addon_extra_icons'))
329
  {
330
- $tip .= ' <span style="background:#eee;padding:5px 8px;">' . __('The "Extra Social Icons" addon is already installed! You can use the button to re-install it.', 'synved-social') . '</span>';
 
 
 
 
 
 
 
 
331
  }
332
 
333
  return $tip;
@@ -349,6 +427,22 @@ function synved_social_option_addon_grey_fade_tip($tip, $item)
349
  return $tip;
350
  }
351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  function synved_social_path($path = null)
353
  {
354
  $root = dirname(__FILE__);
@@ -517,16 +611,76 @@ function synved_social_register_widgets()
517
  register_widget('SynvedSocialFollowWidget');
518
  }
519
 
520
- function synved_social_wp_the_content($content)
521
  {
522
- if (synved_option_get('synved_social', 'automatic_share'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  {
524
- $post_type = get_post_type();
525
- $type_list = synved_option_get('synved_social', 'automatic_share_post_types');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
 
527
- if (in_array($post_type, $type_list))
 
 
 
 
 
 
 
 
 
 
 
 
 
528
  {
529
- $content .= synved_social_share_markup();
 
 
 
530
  }
531
  }
532
 
@@ -579,24 +733,45 @@ function synved_social_init()
579
  }
580
  }
581
 
582
- $sh_params = array(
 
 
 
 
 
 
 
 
583
  'skin' => __('Specify which skin to use for the icons', 'synved-social'),
584
  'size' => sprintf(__('Specify the size for the icons, possible values are %s', 'synved-social'), $size_set),
585
  'spacing' => __('Determines how much blank space there will be between the buttons, in pixels', 'synved-social'),
 
586
  );
587
 
588
  $share_params = array(
589
  'url' => __('URL to use for the sharing buttons, default is the current post URL', 'synved-social'),
590
  'title' => __('Title to use for the sharing buttons, default is the current post title', 'synved-social'),
591
  );
 
 
 
 
 
 
 
 
 
 
 
 
592
 
593
  synved_shortcode_item_help_set('feather_share', array(
594
  'tip' => __('Creates a list of buttons for social sharing as selected in the Social Media options', 'synved-social'),
595
- 'parameters' => array_merge($sh_params, $share_params)
596
  ));
597
  synved_shortcode_item_help_set('feather_follow', array(
598
  'tip' => __('Creates a list of buttons for social following as selected in the Social Media options', 'synved-social'),
599
- 'parameters' => $sh_params
600
  ));
601
  }
602
  else
@@ -618,7 +793,7 @@ function synved_social_init()
618
 
619
  if (synved_option_get('synved_social', 'automatic_share'))
620
  {
621
- add_filter('the_content', 'synved_social_wp_the_content');
622
  }
623
  }
624
 
21
  if (isset($share_providers[$provider_name]))
22
  {
23
  $display_set .= ',share=Share';
24
+
25
+ if (!isset($share_providers[$provider_name]['default-display']) || $share_providers[$provider_name]['default-display'])
26
+ {
27
+ $display_default = 'share';
28
+ }
29
  }
30
 
31
  if (isset($follow_providers[$provider_name]))
32
  {
33
  $display_set .= ',follow=Follow';
 
34
 
35
  if (isset($share_providers[$provider_name]))
36
  {
37
  $display_set .= ',both=Share & Follow';
38
+ }
39
+
40
+ if (!isset($follow_providers[$provider_name]['default-display']) || $follow_providers[$provider_name]['default-display'])
41
+ {
42
+ if ($display_default == 'share')
43
+ {
44
+ $display_default = 'both';
45
+ }
46
+ else
47
+ {
48
+ $display_default = 'follow';
49
+ }
50
  }
51
  }
52
 
114
  'sections' => array(
115
  'section_general' => array(
116
  'label' => __('General Settings', 'synved-social'),
117
+ 'tip' => __('Settings affecting the general behaviour of the plugin', 'synved-social'),
118
  'settings' => array(
119
  'use_shortlinks' => array(
120
  'default' => false, 'label' => __('Use Shortlinks', 'synved-social'),
124
  'default' => true, 'label' => __('Shortcodes In Widgets', 'synved-social'),
125
  'tip' => __('Allow shortcodes in Text widgets', 'synved-social')
126
  ),
127
+ 'show_credit' => array(
128
+ 'default' => true, 'label' => __('Show Credit', 'synved-social'),
129
+ 'tip' => __('Display a small icon with a link to the Social Media Feather page', 'synved-social')
130
+ ),
131
+ 'share_message_default' => array(
132
+ 'default' => __('Hey check this out', 'synved-social'), 'label' => __('Default Message', 'synved-social'),
133
+ 'tip' => __('Specify the default message to use when sharing content, this is what gets replaced into the %%message%% variable', 'synved-social')
134
+ ),
135
+ )
136
+ ),
137
+ 'section_automatic_display' => array(
138
+ 'label' => __('Automatic Display', 'synved-social'),
139
+ 'tip' => __('Settings affecting automating appending of social buttons to post contents', 'synved-social'),
140
+ 'settings' => array(
141
  'automatic_share' => array(
142
  'default' => false, 'label' => __('Display Sharing Buttons', 'synved-social'),
143
+ 'tip' => __('Tries to automatically append sharing buttons to your posts (disable for specific posts by setting custom field synved_social_exclude or synved_social_exclude_share to yes)', 'synved-social')
144
  ),
145
  'automatic_share_post_types' => array(
146
  'type' => 'custom',
147
  'default' => 'post',
148
+ 'set' => synved_option_callback('synved_social_automatic_append_post_types_set', array('post', 'page')),
149
  'label' => __('Share Post Types', 'synved-social'),
150
+ 'tip' => __('Post types for which automatic appending for share buttons should be attempted (CTRL + click to select multiple ones)', 'synved-social'),
151
+ 'render' => 'synved_social_automatic_append_post_types_render'
152
  ),
153
+ 'automatic_follow' => array(
154
+ 'default' => false, 'label' => __('Display Follow Buttons', 'synved-social'),
155
+ 'tip' => __('Tries to automatically append follow buttons to your posts (disable for specific posts by setting custom field synved_social_exclude or synved_social_exclude_follow to yes)', 'synved-social')
156
+ ),
157
+ 'automatic_follow_post_types' => array(
158
+ 'type' => 'custom',
159
+ 'default' => 'post',
160
+ 'set' => synved_option_callback('synved_social_automatic_append_post_types_set', array('post', 'page')),
161
+ 'label' => __('Follow Post Types', 'synved-social'),
162
+ 'tip' => __('Post types for which automatic appending for follow buttons should be attempted (CTRL + click to select multiple ones)', 'synved-social'),
163
+ 'render' => 'synved_social_automatic_append_post_types_render'
164
+ ),
165
+ 'automatic_follow_before_share' => array(
166
+ 'default' => false, 'label' => __('Follow Before Share', 'synved-social'),
167
+ 'tip' => __('When automatically appending, place follow buttons before share buttons', 'synved-social')
168
+ ),
169
+ 'automatic_append_prefix' => array(
170
+ 'default' => '', 'label' => __('Prefix Markup', 'synved-social'),
171
+ 'tip' => __('When automatically appending, place this markup before the buttons markup', 'synved-social')
172
+ ),
173
+ 'automatic_append_separator' => array(
174
+ 'default' => '<br/>', 'label' => __('Separator Markup', 'synved-social'),
175
+ 'tip' => __('When automatically appending both, use this markup as separator between the set of share buttons and the set of follow buttons', 'synved-social')
176
+ ),
177
+ 'automatic_append_postfix' => array(
178
+ 'default' => '', 'label' => __('Postfix Markup', 'synved-social'),
179
+ 'tip' => __('When automatically appending, place this markup after all of the buttons markup', 'synved-social')
180
  ),
181
  )
182
  ),
207
  'label' => __('Grey Fade Effect', 'synved-social'),
208
  'tip' => synved_option_callback('synved_social_option_addon_grey_fade_tip', __('Click the button to install the "Grey Fade" addon, get it <a target="_blank" href="http://synved.com/product/feather-grey-fade/">here</a>.', 'synved-social'))
209
  ),
210
+ 'addon_light_prompt' => array(
211
+ 'type' => 'addon',
212
+ 'target' => SYNVED_SOCIAL_ADDON_PATH,
213
+ 'folder' => 'light-prompt',
214
+ 'style' => 'addon-important',
215
+ 'label' => __('Light Prompt Overlay', 'synved-social'),
216
+ 'tip' => synved_option_callback('synved_social_option_addon_light_prompt_tip', __('Click the button to install the "Light Prompt" addon, get it <a target="_blank" href="http://synved.com/product/feather-light-prompt/">here</a>.', 'synved-social'))
217
+ ),
218
  'icon_size' => array(
219
  'default' => 48,
220
  'set' => '16=16x16,24=24x24,32=32x32,48=48x48,64=64x64,96=96x96',
248
  synved_option_include_module_addon_list('synved-social');
249
 
250
 
251
+ function synved_social_provider_option_value_sanitize($value, $name, $id, $item)
252
+ {
253
+ $default = synved_option_item_default($item);
254
+
255
+ if ($value == $default)
256
+ {
257
+
258
+ }
259
+ }
260
+
261
  function synved_social_page_settings_tip($tip, $item)
262
  {
263
  if (!function_exists('synved_shortcode_version'))
339
  }
340
 
341
 
342
+ function synved_social_automatic_append_post_types_set($set, $item)
343
  {
344
  if ($set != null && !is_array($set))
345
  {
357
  return $set;
358
  }
359
 
360
+ function synved_social_automatic_append_post_types_render($value, $params, $id, $name, $item)
361
  {
362
  $uri = synved_social_path_uri();
363
  $icons = synved_social_icon_skin_list();
397
  {
398
  if (synved_option_addon_installed('synved_social', 'addon_extra_icons'))
399
  {
400
+ // missing icons for installed extra-icons addon
401
+ if (!function_exists('synved_social_addon_extra_icons_version'))
402
+ {
403
+ $tip .= ' <span style="background:#ecc;padding:5px 8px;">' . __('The "Extra Social Icons" addon is already installed but requires an update for recently added providers, please use your download link or <a href="http://synved.com/about/contact/?subject=Feather%20Extra%20Icons%20new%20link">request a new one</a>', 'synved-social') . '</span>';
404
+ }
405
+ else
406
+ {
407
+ $tip .= ' <span style="background:#eee;padding:5px 8px;">' . __('The "Extra Social Icons" addon is already installed! You can use the button to re-install it.', 'synved-social') . '</span>';
408
+ }
409
  }
410
 
411
  return $tip;
427
  return $tip;
428
  }
429
 
430
+ function synved_social_option_addon_light_prompt_tip($tip, $item)
431
+ {
432
+ $uri = synved_social_path_uri();
433
+
434
+ if (synved_option_addon_installed('synved_social', 'addon_light_prompt'))
435
+ {
436
+ $tip .= ' <span style="background:#eee;padding:5px 8px;">' . __('The "Light Prompt" addon is already installed! You can use the button to re-install it.', 'synved-social') . '</span>';
437
+ }
438
+ else
439
+ {
440
+ $tip .= '<div style="clear:both"><p style="font-size:120%;"><b>The <a target="_blank" href="http://synved.com/product/feather-light-prompt/">Light Prompt addon</a> allows you to achieve the nice overlay below when users click on a share button, <a target="_blank" href="http://synved.com/product/feather-light-prompt/">get it now</a>!</b></p> <a target="_blank" href="http://synved.com/product/feather-light-prompt/"><img src="' . $uri . '/image/social-feather-light-prompt-demo.png" /></a></div>';
441
+ }
442
+
443
+ return $tip;
444
+ }
445
+
446
  function synved_social_path($path = null)
447
  {
448
  $root = dirname(__FILE__);
611
  register_widget('SynvedSocialFollowWidget');
612
  }
613
 
614
+ function synved_social_wp_the_content($content, $id = null)
615
  {
616
+ $exclude = false;
617
+ $exclude_share = false;
618
+ $exclude_follow = false;
619
+
620
+ $extra = null;
621
+ $separator = null;
622
+
623
+ if ($id == null)
624
+ {
625
+ $id = get_the_ID();
626
+
627
+ if ($id == null)
628
+ {
629
+ global $post;
630
+
631
+ $id = $post->ID;
632
+ }
633
+ }
634
+
635
+ if ($id != null)
636
  {
637
+ $exclude = get_post_meta($id, 'synved_social_exclude', true) == 'yes' ? true : false;
638
+ $exclude_share = get_post_meta($id, 'synved_social_exclude_share', true) == 'yes' ? true : false;
639
+ $exclude_follow = get_post_meta($id, 'synved_social_exclude_follow', true) == 'yes' ? true : false;
640
+ }
641
+
642
+ if ($exclude == false)
643
+ {
644
+ if ($exclude_share == false && synved_option_get('synved_social', 'automatic_share'))
645
+ {
646
+ $post_type = get_post_type();
647
+ $type_list = synved_option_get('synved_social', 'automatic_share_post_types');
648
+
649
+ if (in_array($post_type, $type_list))
650
+ {
651
+ $extra .= synved_social_share_markup();
652
+ }
653
+ }
654
+
655
+ if ($extra != null)
656
+ {
657
+ $separator = synved_option_get('synved_social', 'automatic_append_separator');
658
+ }
659
+
660
+ if ($exclude_follow == false && synved_option_get('synved_social', 'automatic_follow'))
661
+ {
662
+ $post_type = get_post_type();
663
+ $type_list = synved_option_get('synved_social', 'automatic_follow_post_types');
664
 
665
+ if (in_array($post_type, $type_list))
666
+ {
667
+ if (synved_option_get('synved_social', 'automatic_follow_before_share'))
668
+ {
669
+ $extra = synved_social_follow_markup() . $separator . $extra;
670
+ }
671
+ else
672
+ {
673
+ $extra .= $separator . synved_social_follow_markup();
674
+ }
675
+ }
676
+ }
677
+
678
+ if ($extra != null)
679
  {
680
+ $prefix = synved_option_get('synved_social', 'automatic_append_prefix');
681
+ $postfix = synved_option_get('synved_social', 'automatic_append_postfix');
682
+
683
+ $content .= $prefix . $extra . $postfix;
684
  }
685
  }
686
 
733
  }
734
  }
735
 
736
+ $providers_share = array_keys(synved_social_service_provider_list('share'));
737
+ $providers_follow = array_keys(synved_social_service_provider_list('follow'));
738
+
739
+ $providers_params = array(
740
+ 'show' => __('Specify a comma-separated list of %1$s providers to show and their order, possible values are %2$s', 'synved-social'),
741
+ 'hide' => __('Specify a comma-separated list of %1$s providers to hide, possible values are %2$s', 'synved-social'),
742
+ );
743
+
744
+ $common_params = array(
745
  'skin' => __('Specify which skin to use for the icons', 'synved-social'),
746
  'size' => sprintf(__('Specify the size for the icons, possible values are %s', 'synved-social'), $size_set),
747
  'spacing' => __('Determines how much blank space there will be between the buttons, in pixels', 'synved-social'),
748
+ 'class' => __('Select additional CSS classes for the buttons, separated by spaces', 'synved-social'),
749
  );
750
 
751
  $share_params = array(
752
  'url' => __('URL to use for the sharing buttons, default is the current post URL', 'synved-social'),
753
  'title' => __('Title to use for the sharing buttons, default is the current post title', 'synved-social'),
754
  );
755
+
756
+ $follow_params = array(
757
+ );
758
+
759
+ $share_params = array_merge($common_params, $share_params);
760
+ $follow_params = array_merge($common_params, $follow_params);
761
+
762
+ foreach ($providers_params as $param_name => $param_value)
763
+ {
764
+ $share_params[$param_name] = sprintf($param_value, 'share', implode(', ', $providers_share));
765
+ $follow_params[$param_name] = sprintf($param_value, 'follow', implode(', ', $providers_follow));
766
+ }
767
 
768
  synved_shortcode_item_help_set('feather_share', array(
769
  'tip' => __('Creates a list of buttons for social sharing as selected in the Social Media options', 'synved-social'),
770
+ 'parameters' => $share_params
771
  ));
772
  synved_shortcode_item_help_set('feather_follow', array(
773
  'tip' => __('Creates a list of buttons for social following as selected in the Social Media options', 'synved-social'),
774
+ 'parameters' => $follow_params
775
  ));
776
  }
777
  else
793
 
794
  if (synved_option_get('synved_social', 'automatic_share'))
795
  {
796
+ add_filter('the_content', 'synved_social_wp_the_content', 10, 2);
797
  }
798
  }
799
 
synved-social/synved-social.php CHANGED
@@ -3,7 +3,7 @@
3
  Module Name: Synved Social
4
  Description: Social sharing and following tools
5
  Author: Synved
6
- Version: 1.0
7
  Author URI: http://synved.com/
8
  License: GPLv2
9
 
@@ -18,8 +18,8 @@ In no event shall Synved Ltd. be liable to you or any third party for any direct
18
 
19
 
20
  define('SYNVED_SOCIAL_LOADED', true);
21
- define('SYNVED_SOCIAL_VERSION', 100000000);
22
- define('SYNVED_SOCIAL_VERSION_STRING', '1.0');
23
 
24
  define('SYNVED_SOCIAL_ADDON_PATH', str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, dirname(__FILE__) . '/addons'));
25
 
@@ -226,6 +226,10 @@ function synved_social_service_provider_list($context, $raw = false)
226
  'link' => 'http://www.reddit.com/submit?url=%%url%%&title=%%title%%',
227
  'title' => __('Share on Reddit'),
228
  ),
 
 
 
 
229
  'linkedin' => array(
230
  'link' => 'http://www.linkedin.com/shareArticle?mini=true&url=%%url%%&title=%%title%%',
231
  'title' => __('Share on Linkedin'),
@@ -251,6 +255,11 @@ function synved_social_service_provider_list($context, $raw = false)
251
  'link' => 'http://plus.google.com/needlessly_long_google_plus_id',
252
  'title' => __('Follow us on Google+'),
253
  ),
 
 
 
 
 
254
  'linkedin' => array(
255
  'link' => 'http://www.linkedin.com/in/yourid',
256
  'title' => __('Find us on Linkedin'),
@@ -367,10 +376,132 @@ function synved_social_icon_skin_current()
367
  return synved_social_icon_skin_get();
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  function synved_social_button_list_shortcode($atts, $content = null, $code = '', $context = null)
371
  {
372
  $vars_def = array('url' => null, 'title' => null);
373
- $params_def = array('skin' => null, 'size' => null, 'spacing' => null);
374
  $vars = shortcode_atts($vars_def, $atts);
375
  $params = shortcode_atts($params_def, $atts);
376
  $vars = array_filter($vars);
@@ -398,6 +529,66 @@ function synved_social_follow_shortcode($atts, $content = null, $code = '')
398
  return synved_social_button_list_shortcode($atts, $content, $code, 'follow');
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  function synved_social_button_list_markup($context, $vars = null, $buttons = null, $params = null)
402
  {
403
  $buttons_default = synved_social_service_provider_list($context);
@@ -437,6 +628,27 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
437
  $vars['url'] = $url;
438
  }
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  if (!isset($vars['title']))
441
  {
442
  $vars['title'] = get_the_title();
@@ -444,7 +656,32 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
444
 
445
  if (!isset($vars['message']))
446
  {
447
- $vars['message'] = __('Hey check this out');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
448
  }
449
 
450
  $vars = apply_filters('synved_social_markup_variable_list', $vars, $context, $params);
@@ -454,7 +691,7 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
454
  {
455
  $vars = urlencode_deep($vars);
456
 
457
- // XXX the + character is not recognized as space
458
  $vars['message'] = str_replace('+', '%20', $vars['message']);
459
  }
460
 
@@ -490,40 +727,6 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
490
  }
491
  }
492
 
493
- $sizes = glob($skin_path . '*', GLOB_ONLYDIR);
494
- $sizes = array_map('basename', $sizes);
495
- $size_list = array();
496
-
497
- foreach ($sizes as $size_dir)
498
- {
499
- $size_parts = explode('x', $size_dir);
500
- $size_width = (int) $size_parts[0];
501
-
502
- if ($size_width != null)
503
- {
504
- $size_list[] = $size_width;
505
- }
506
- }
507
-
508
- sort($size_list, SORT_NUMERIC);
509
- $size_count = count($size_list);
510
- $size_used = $size;
511
-
512
- if (array_search($size_used, $size_list) === false)
513
- {
514
- for ($i = 0; $i < $size_count; $i++)
515
- {
516
- $size_width = $size_list[$i];
517
-
518
- if ($size_width > $size || $i == ($size_count - 1))
519
- {
520
- $size_used = $size_width;
521
-
522
- break;
523
- }
524
- }
525
- }
526
-
527
  $icon_spacing = synved_option_get('synved_social', 'icon_spacing');
528
  $spacing = 5;
529
 
@@ -537,21 +740,49 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
537
  $spacing = $params['spacing'];
538
  }
539
 
540
- $class = null;
 
 
541
 
542
- if (isset($params['class']))
543
  {
544
- $class = $params['class'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
 
546
- if (!is_array($class))
 
 
 
 
 
547
  {
548
- $class = array($class);
 
 
 
549
  }
550
  }
551
 
552
  $out = null;
 
 
553
  $index = 0;
554
  $count = count($buttons);
 
555
 
556
  foreach ($buttons as $button_key => $button_item)
557
  {
@@ -576,31 +807,17 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
576
  }
577
  }
578
 
579
- $image_sub = '/' . $button_key . '.png';
580
- $image_size = $size_used;
581
- $size_name = $image_size . 'x' . $image_size;
582
- $image_path = $skin_path . $size_name . $image_sub;
583
- $image_uri = $skin_uri . $size_name . $image_sub;
584
-
585
- while (!file_exists($image_path))
586
- {
587
- $size_index = array_search($image_size, $size_list);
588
-
589
- if ($size_index === false || $size_index == $size_count - 1)
590
- {
591
- break;
592
- }
593
-
594
- $image_size = $size_list[$size_index + 1];
595
- $size_name = $image_size . 'x' . $image_size;
596
- $image_path = $skin_path . $size_name . $image_sub;
597
- $image_uri = $skin_uri . $size_name . $image_sub;
598
- }
599
 
600
  if (!file_exists($image_path))
601
  {
602
- $image_path = apply_filters('synved_social_button_image_path', $image_path, $image_uri, $size_used, $image_sub, $skin_path, $skin_uri, $size_list);
603
- $image_uri = apply_filters('synved_social_button_image_uri', $image_uri, $image_path, $size_used, $image_sub, $skin_path, $skin_uri, $size_list);
 
604
  }
605
 
606
  $style = 'margin:0;';
@@ -622,16 +839,42 @@ function synved_social_button_list_markup($context, $vars = null, $buttons = nul
622
  $class_extra = ' ' . implode(' ', $class);
623
  }
624
 
625
- $out .= '<a class="synved-social-button synved-social-button-' . $context . $class_extra . '" target="_blank" rel="nofollow" title="' . $title . '" href="' . esc_url($href) . '">';
626
- $out .= '<img alt="' . esc_attr($button_key) . '" class="synved-share-image" width="' . $size . '" style="width:' . $size . 'px;' . $style . '" src="' . esc_attr($image_uri) . '" />';
627
- $out .= '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
 
629
  $index++;
630
  }
631
 
 
 
 
 
 
 
 
632
  if (synved_option_get('synved_social', 'show_credit'))
633
  {
634
- $out .= '<a target="_blank" title="' . __('WordPress Social Media Feather', 'synved-social') . '" href="http://synved.com/wordpress-social-media-feather/" style="color:#444; text-decoration:none; font-size:8px; margin-left:5px;vertical-align:10px;white-space:nowrap;"><span>' . __('by ', 'synved-social') . '<img style="margin:0;padding:0;" alt="feather" src="' . $uri . '/image/icon.png" /></a></span>';
635
  }
636
 
637
  return $out;
3
  Module Name: Synved Social
4
  Description: Social sharing and following tools
5
  Author: Synved
6
+ Version: 1.2.1
7
  Author URI: http://synved.com/
8
  License: GPLv2
9
 
18
 
19
 
20
  define('SYNVED_SOCIAL_LOADED', true);
21
+ define('SYNVED_SOCIAL_VERSION', 100020001);
22
+ define('SYNVED_SOCIAL_VERSION_STRING', '1.2.1');
23
 
24
  define('SYNVED_SOCIAL_ADDON_PATH', str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, dirname(__FILE__) . '/addons'));
25
 
226
  'link' => 'http://www.reddit.com/submit?url=%%url%%&title=%%title%%',
227
  'title' => __('Share on Reddit'),
228
  ),
229
+ 'pinterest' => array(
230
+ 'link' => 'http://pinterest.com/pin/create/button/?url=%%url%%&media=%%image%%&description=%%title%%',
231
+ 'title' => __('Pin it with Pinterest'),
232
+ ),
233
  'linkedin' => array(
234
  'link' => 'http://www.linkedin.com/shareArticle?mini=true&url=%%url%%&title=%%title%%',
235
  'title' => __('Share on Linkedin'),
255
  'link' => 'http://plus.google.com/needlessly_long_google_plus_id',
256
  'title' => __('Follow us on Google+'),
257
  ),
258
+ 'pinterest' => array(
259
+ 'link' => 'http://pinterest.com/MyUserName/',
260
+ 'title' => __('Our board on Pinterest'),
261
+ 'default-display' => false
262
+ ),
263
  'linkedin' => array(
264
  'link' => 'http://www.linkedin.com/in/yourid',
265
  'title' => __('Find us on Linkedin'),
376
  return synved_social_icon_skin_get();
377
  }
378
 
379
+ function synved_social_icon_skin_get_size_list($skin)
380
+ {
381
+ $path = synved_social_path();
382
+ $skin_path = isset($skin['path']) ? $skin['path'] : ($path . '/image/social/regular/');
383
+
384
+ $sizes = glob($skin_path . '*', GLOB_ONLYDIR);
385
+ $sizes = array_map('basename', $sizes);
386
+ $size_list = array();
387
+
388
+ foreach ($sizes as $size_dir)
389
+ {
390
+ $size_parts = explode('x', $size_dir);
391
+ $size_width = (int) $size_parts[0];
392
+
393
+ if ($size_width != null)
394
+ {
395
+ $size_list[] = $size_width;
396
+ }
397
+ }
398
+
399
+ sort($size_list, SORT_NUMERIC);
400
+
401
+ return $size_list;
402
+ }
403
+
404
+ function synved_social_icon_skin_get_image_list_raw($skin, $name_list, $forced_size = null)
405
+ {
406
+ $path = synved_social_path();
407
+ $uri = synved_social_path_uri();
408
+ $skin_default = synved_social_icon_skin_get('regular');
409
+
410
+ $skin_default_path = isset($skin_default['path']) ? $skin_default['path'] : ($path . '/image/social/regular/');
411
+ $skin_default_uri = isset($skin_default['uri']) ? $skin_default['uri'] : ($uri . '/image/social/regular/');
412
+ $skin_sel_path = isset($skin['path']) ? $skin['path'] : ($path . '/image/social/regular/');
413
+ $skin_sel_uri = isset($skin['uri']) ? $skin['uri'] : ($uri . '/image/social/regular/');
414
+
415
+ $default_size_list = synved_social_icon_skin_get_size_list($skin_default);
416
+ $sel_size_list = synved_social_icon_skin_get_size_list($skin);
417
+
418
+ $skin_list = array(
419
+ array(
420
+ 'path' => $skin_sel_path,
421
+ 'uri' => $skin_sel_uri,
422
+ 'list' => $sel_size_list,
423
+ ),
424
+ array(
425
+ 'path' => $skin_default_path,
426
+ 'uri' => $skin_default_uri,
427
+ 'list' => $default_size_list,
428
+ ),
429
+ );
430
+
431
+ $image_list = array();
432
+
433
+ foreach ($name_list as $name)
434
+ {
435
+ foreach ($skin_list as $skin)
436
+ {
437
+ $skin_path = $skin['path'];
438
+ $skin_uri = $skin['uri'];
439
+ $size_list = $skin['list'];
440
+ $size_count = count($size_list);
441
+
442
+ $image_size_list = array();
443
+ $image_size_list_skipped = array();
444
+
445
+ for ($i = 0; $i < $size_count; $i++)
446
+ {
447
+ $image_size = $size_list[$i];
448
+ $image_sub = '/' . $name . '.png';
449
+ $size_name = $image_size . 'x' . $image_size;
450
+ $image_path = $skin_path . $size_name . $image_sub;
451
+ $image_uri = $skin_uri . $size_name . $image_sub;
452
+
453
+ if (file_exists($image_path))
454
+ {
455
+ $image_size_meta = array(
456
+ 'name' => $size_name,
457
+ 'sub' => $image_sub,
458
+ 'path' => $image_path,
459
+ 'uri' => $image_uri,
460
+ );
461
+
462
+ foreach ($image_size_list_skipped as $image_size_skipped)
463
+ {
464
+ $image_size_list[$image_size_skipped] = $image_size_meta;
465
+ }
466
+
467
+ $image_size_skipped = array();
468
+ $image_size_list[$image_size] = $image_size_meta;
469
+
470
+ if ($forced_size != null && ($image_size > $forced_size || $i == $size_count - 1) && !isset($image_size_list[$forced_size]))
471
+ {
472
+ $image_size_list[$forced_size] = $image_size_meta;
473
+ }
474
+ }
475
+ else
476
+ {
477
+ $image_size_skipped[] = $image_size;
478
+ }
479
+ }
480
+
481
+ if ($image_size_list != null)
482
+ {
483
+ break;
484
+ }
485
+ }
486
+
487
+ $image_list[$name] = $image_size_list;
488
+ }
489
+
490
+ return $image_list;
491
+ }
492
+
493
+ function synved_social_icon_skin_get_image_list($skin, $name_list, $forced_size = null)
494
+ {
495
+ $image_list = synved_social_icon_skin_get_image_list_raw($skin, $name_list, $forced_size);
496
+ $image_list = apply_filters('synved_social_skin_image_list', $image_list, $skin, $name_list, $forced_size);
497
+
498
+ return $image_list;
499
+ }
500
+
501
  function synved_social_button_list_shortcode($atts, $content = null, $code = '', $context = null)
502
  {
503
  $vars_def = array('url' => null, 'title' => null);
504
+ $params_def = array('skin' => null, 'size' => null, 'spacing' => null, 'class' => null, 'show' => null, 'hide' => null, 'prompt' => null, 'custom1' => null, 'custom2' => null, 'custom3' => null);
505
  $vars = shortcode_atts($vars_def, $atts);
506
  $params = shortcode_atts($params_def, $atts);
507
  $vars = array_filter($vars);
529
  return synved_social_button_list_shortcode($atts, $content, $code, 'follow');
530
  }
531
 
532
+ function synved_social_button_list_markup_item_out($out_item)
533
+ {
534
+ $out = null;
535
+ $tag = isset($out_item['tag']) ? $out_item['tag'] : null;
536
+ $content = isset($out_item['content']) ? $out_item['content'] : null;
537
+ $list = isset($out_item['child-list']) ? $out_item['child-list'] : null;
538
+
539
+ unset($out_item['tag']);
540
+ unset($out_item['content']);
541
+ unset($out_item['child-list']);
542
+
543
+ if ($tag != null)
544
+ {
545
+ $out .= '<' . $tag;
546
+
547
+ foreach ($out_item as $attr_name => $attr_value)
548
+ {
549
+ if (in_array($attr_name, array('href', 'src')))
550
+ {
551
+ $attr_value = esc_url($attr_value);
552
+ }
553
+ else
554
+ {
555
+ $attr_value = esc_attr($attr_value);
556
+ }
557
+
558
+ $out .= ' ' . $attr_name . '="' . $attr_value . '"';
559
+ }
560
+
561
+ if ($list != null || $content != null)
562
+ {
563
+ $out .= '>';
564
+ }
565
+ else
566
+ {
567
+ $out .= ' />';
568
+ }
569
+ }
570
+
571
+ if ($list != null)
572
+ {
573
+ foreach ($list as $child)
574
+ {
575
+ $out .= synved_social_button_list_markup_item_out($child);
576
+ }
577
+ }
578
+
579
+ if ($content != null)
580
+ {
581
+ $out .= $content;
582
+ }
583
+
584
+ if ($tag != null && ($list != null || $content != null))
585
+ {
586
+ $out .= '</' . $tag . '>';
587
+ }
588
+
589
+ return $out;
590
+ }
591
+
592
  function synved_social_button_list_markup($context, $vars = null, $buttons = null, $params = null)
593
  {
594
  $buttons_default = synved_social_service_provider_list($context);
628
  $vars['url'] = $url;
629
  }
630
 
631
+ if (!isset($vars['image']))
632
+ {
633
+ $id = get_the_ID();
634
+ $image_src = null;
635
+
636
+ if ($id == null)
637
+ {
638
+ global $post;
639
+
640
+ $id = $post->ID;
641
+ }
642
+
643
+ if ($id != null)
644
+ {
645
+ $src = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full');
646
+ $image_src = $src[0];
647
+ }
648
+
649
+ $vars['image'] = $image_src;
650
+ }
651
+
652
  if (!isset($vars['title']))
653
  {
654
  $vars['title'] = get_the_title();
656
 
657
  if (!isset($vars['message']))
658
  {
659
+ $message = synved_option_get('synved_social', 'share_message_default');
660
+
661
+ if ($message == null)
662
+ {
663
+ $message = __('Hey check this out', 'synved-social');
664
+ }
665
+
666
+ $vars['message'] = $message;
667
+ }
668
+
669
+ if (isset($params['class']) && !is_array($params['class']))
670
+ {
671
+ $class = explode(' ', $params['class']);
672
+ $params['class'] = array_map('trim', $class);
673
+ }
674
+
675
+ if (isset($params['show']) && !is_array($params['show']))
676
+ {
677
+ $show = explode(',', $params['show']);
678
+ $params['show'] = array_map('trim', $show);
679
+ }
680
+
681
+ if (isset($params['hide']) && !is_array($params['hide']))
682
+ {
683
+ $hide = explode(',', $params['hide']);
684
+ $params['hide'] = array_map('trim', $hide);
685
  }
686
 
687
  $vars = apply_filters('synved_social_markup_variable_list', $vars, $context, $params);
691
  {
692
  $vars = urlencode_deep($vars);
693
 
694
+ // The next line is required because the + character is not recognized as space
695
  $vars['message'] = str_replace('+', '%20', $vars['message']);
696
  }
697
 
727
  }
728
  }
729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  $icon_spacing = synved_option_get('synved_social', 'icon_spacing');
731
  $spacing = 5;
732
 
740
  $spacing = $params['spacing'];
741
  }
742
 
743
+ $class = isset($params['class']) ? $params['class'] : null;
744
+ $show = isset($params['show']) ? $params['show'] : null;
745
+ $hide = isset($params['hide']) ? $params['hide'] : null;
746
 
747
+ if ($show != null)
748
  {
749
+ $button_list = array();
750
+
751
+ foreach ($show as $button_key)
752
+ {
753
+ if (isset($buttons[$button_key]))
754
+ {
755
+ $button_list[$button_key] = $buttons[$button_key];
756
+
757
+ unset($buttons[$button_key]);
758
+ }
759
+ }
760
+
761
+ foreach ($buttons as $button_key => $button_item)
762
+ {
763
+ $button_list[$button_key] = $button_item;
764
+ }
765
 
766
+ $buttons = $button_list;
767
+ }
768
+
769
+ if ($hide != null)
770
+ {
771
+ foreach ($hide as $button_key)
772
  {
773
+ if (isset($buttons[$button_key]))
774
+ {
775
+ unset($buttons[$button_key]);
776
+ }
777
  }
778
  }
779
 
780
  $out = null;
781
+ $out_list = array();
782
+ $out_params = array();
783
  $index = 0;
784
  $count = count($buttons);
785
+ $image_list = synved_social_icon_skin_get_image_list($skin, array_keys($buttons), $size);
786
 
787
  foreach ($buttons as $button_key => $button_item)
788
  {
807
  }
808
  }
809
 
810
+ $image = $image_list[$button_key];
811
+ $image_size = $image[$size];
812
+ $image_sub = $image_size['sub'];
813
+ $image_path = $image_size['path'];
814
+ $image_uri = $image_size['uri'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815
 
816
  if (!file_exists($image_path))
817
  {
818
+ $size_list = array_keys($image);
819
+ $image_path = apply_filters('synved_social_button_image_path', $image_path, $image_uri, $size, $image_sub, $skin_path, $skin_uri, $size_list);
820
+ $image_uri = apply_filters('synved_social_button_image_uri', $image_uri, $image_path, $size, $image_sub, $skin_path, $skin_uri, $size_list);
821
  }
822
 
823
  $style = 'margin:0;';
839
  $class_extra = ' ' . implode(' ', $class);
840
  }
841
 
842
+ $out_button = array(
843
+ 'tag' => 'a',
844
+ 'class' => 'synved-social-button synved-social-button-' . $context . ' synved-social-provider-' . $button_key . $class_extra,
845
+ 'data-provider' => $button_key,
846
+ 'target' => $button_key != 'mail' ? '_blank' : '',
847
+ 'rel' => 'nofollow',
848
+ 'title' => $title,
849
+ 'href' => $href,
850
+ 'child-list' => array(
851
+ array(
852
+ 'tag' => 'img',
853
+ 'alt' => $button_key,
854
+ 'class' => 'synved-share-image',
855
+ 'width' => $size,
856
+ 'style' => 'width:' . $size . 'px;' . $style,
857
+ 'src' => $image_uri,
858
+ )
859
+ )
860
+ );
861
+
862
+ $out_list[$button_key] = $out_button;
863
+ $out_params[$button_key] = array();
864
 
865
  $index++;
866
  }
867
 
868
+ $out_list = apply_filters('synved_social_button_list_markup', $out_list, $out_params, $context, $vars, $params);
869
+
870
+ foreach ($out_list as $button_key => $out_item)
871
+ {
872
+ $out .= synved_social_button_list_markup_item_out($out_item);
873
+ }
874
+
875
  if (synved_option_get('synved_social', 'show_credit'))
876
  {
877
+ $out .= '<a target="_blank" title="' . __('WordPress Social Media Feather', 'synved-social') . '" href="http://synved.com/wordpress-social-media-feather/" style="color:#444; text-decoration:none; font-size:8px; margin-left:5px;vertical-align:10px;white-space:nowrap;"><span>' . __('by ', 'synved-social') . '</span><img style="margin:0;padding:0;" alt="feather" src="' . $uri . '/image/icon.png" /></a>';
878
  }
879
 
880
  return $out;