WordPress Social Tools, Related Posts, Monetization – Shareaholic - Version 7.0.3.6

Version Description

  • New "Vertical" theme for Related Content!
  • Added a note about caching plugins; organized the "Advanced Settings" page
  • Shareaholic shortcode now support title, link and summary parameters
Download this release

Release Info

Developer shareaholic
Plugin Icon 128x128 WordPress Social Tools, Related Posts, Monetization – Shareaholic
Version 7.0.3.6
Comparing to
See all releases

Code changes from version 7.0.3.5 to 7.0.3.6

curl.php CHANGED
@@ -207,4 +207,4 @@ class ShareaholicCurl {
207
  }
208
  }
209
 
210
- ?>
207
  }
208
  }
209
 
210
+ ?>
deprecation.php CHANGED
@@ -74,5 +74,4 @@ class ShareaholicDeprecation {
74
 
75
  }
76
 
77
-
78
  ?>
74
 
75
  }
76
 
 
77
  ?>
public.php CHANGED
@@ -42,12 +42,25 @@ class ShareaholicPublic {
42
  }
43
 
44
  /**
45
- * The function that gets called for shortcoding.
46
  *
47
- * @param array $attributes this is passed two keys: `app` and `name`
 
48
  */
49
- public static function shortcode($attributes) {
50
- return self::canvas($attributes['id'], $attributes['app']);
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  /**
@@ -222,19 +235,26 @@ class ShareaholicPublic {
222
  *
223
  * @param string $id the location id for configuration
224
  * @param string $app the type of app
 
 
 
225
  */
226
- public static function canvas($id, $app) {
227
  global $post, $wp_query;
228
- $page_type = ShareaholicUtilities::page_type();
 
 
 
 
229
  $canvas = "<div class='shareaholic-canvas'
230
  data-app-id='$id'
231
  data-app='$app'
232
- data-title='" . htmlspecialchars($post->post_title, ENT_QUOTES) . "'
233
- data-link='" . get_permalink($post->ID) . "'
234
- data-summary='" . htmlspecialchars(strip_tags(strip_shortcodes($post->post_excerpt)), ENT_QUOTES) . "'></div>";
235
 
236
  return trim(preg_replace('/\s+/', ' ', $canvas));
237
  }
238
  }
239
 
240
- ?>
42
  }
43
 
44
  /**
45
+ * The function that gets called for shortcodes
46
  *
47
+ * @param array $attributes this is passed keys: `id`, `app`, `title`, `link`, `summary`
48
+ * @param string $content is the enclosed content (if the shortcode is used in its enclosing form)
49
  */
50
+ public static function shortcode($attributes, $content = NULL) {
51
+ extract(shortcode_atts(array(
52
+ "id" => NULL,
53
+ "app" => 'share_buttons',
54
+ "title" => NULL,
55
+ "link" => NULL,
56
+ "summary" => NULL
57
+ ), $attributes, 'shareaholic'));
58
+
59
+ if (isset($attributes['title'])) $title = esc_attr(trim($attributes['title']));
60
+ if (isset($attributes['link'])) $link = trim($attributes['link']);
61
+ if (isset($attributes['summary'])) $summary = esc_attr(trim($attributes['summary']));
62
+
63
+ return self::canvas($attributes['id'], $attributes['app'], $title, $link, $summary);
64
  }
65
 
66
  /**
235
  *
236
  * @param string $id the location id for configuration
237
  * @param string $app the type of app
238
+ * @param string $title the title of URL
239
+ * @param string $link url
240
+ * @param string $summary summary text for URL
241
  */
242
+ public static function canvas($id, $app, $title = NULL, $link = NULL, $summary = NULL) {
243
  global $post, $wp_query;
244
+
245
+ $data_title = ((trim($title) != NULL) ? $title : htmlspecialchars($post->post_title, ENT_QUOTES));
246
+ $data_link = ((trim($link) != NULL) ? trim($link) : get_permalink($post->ID));
247
+ $data_summary = ((trim($summary) != NULL) ? $summary : htmlspecialchars(strip_tags(strip_shortcodes($post->post_excerpt)), ENT_QUOTES));
248
+
249
  $canvas = "<div class='shareaholic-canvas'
250
  data-app-id='$id'
251
  data-app='$app'
252
+ data-title='$data_title'
253
+ data-link='$data_link'
254
+ data-summary='$data_summary'></div>";
255
 
256
  return trim(preg_replace('/\s+/', ' ', $canvas));
257
  }
258
  }
259
 
260
+ ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
3
  Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, wanelo, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
4
  Requires at least: 2.7
5
  Tested up to: 3.6
6
- Stable tag: 7.0.3.5
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
@@ -115,12 +115,21 @@ You can place Share Buttons, Related Content and any other Shareaholic app manua
115
  `[shareaholic app="share_buttons" id="<insert shareaholic app ID here>"]`
116
  `[shareaholic app="recommendations" id="<insert shareaholic app ID here>"]`
117
 
 
 
 
 
 
 
118
  In your PHP / theme template code, you would add:
119
 
120
  `<?php echo do_shortcode ('[shareaholic app="share_buttons" id="<insert shareaholic app ID here>"]'); ?>`
121
  `<?php echo do_shortcode ('[shareaholic app="recommendations" id="<insert shareaholic app ID here>"]'); ?>`
122
 
123
- Grab the corresponding App ID from your Shareaholic Dashboard for the App you want to manually insert into your theme. Shareaholic Shortcode's are full featured and support all available configuration options available. Enjoy!
 
 
 
124
 
125
  Old legacy methods (not officially supported as of version 7.0.0.0):
126
 
@@ -139,11 +148,16 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
139
 
140
  == Changelog ==
141
 
 
 
 
 
 
142
  = 7.0.3.5 =
143
- * Localizations
144
- * Added German (de_DE) by Lothar Schiborr
145
  * Added support for shareaholic:url meta tag
146
  * Bugfix: Now compatible with JavaScript minification plugins
 
 
147
 
148
  = 7.0.3.4 =
149
  * Fix for Cross-Site Request Forgery vulnerability. Upgrade immediately.
@@ -920,6 +934,9 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
920
 
921
  == Upgrade Notice ==
922
 
 
 
 
923
  = 7.0.3.5 =
924
  Language localizations and bugfixes.
925
 
3
  Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, wanelo, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
4
  Requires at least: 2.7
5
  Tested up to: 3.6
6
+ Stable tag: 7.0.3.6
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
115
  `[shareaholic app="share_buttons" id="<insert shareaholic app ID here>"]`
116
  `[shareaholic app="recommendations" id="<insert shareaholic app ID here>"]`
117
 
118
+ Notes: optionally, you can also specify `title`, `link` or `summary` as Shareaholic shortcode parameters. If you don't specify these optional parameters, the shortcode will automatically determine these values.
119
+
120
+ Example:
121
+
122
+ `[shareaholic app="recommendations" id="<insert shareaholic app ID here>" title="About Me" link="http://mysite.com/about"]`
123
+
124
  In your PHP / theme template code, you would add:
125
 
126
  `<?php echo do_shortcode ('[shareaholic app="share_buttons" id="<insert shareaholic app ID here>"]'); ?>`
127
  `<?php echo do_shortcode ('[shareaholic app="recommendations" id="<insert shareaholic app ID here>"]'); ?>`
128
 
129
+ Grab the corresponding App ID from your Shareaholic Dashboard for the App you want to manually insert into your theme. If use double quotes ("'s) in your title or summary, make sure to encode them properly as `&quot;`
130
+
131
+ Shareaholic Shortcode's are full featured and support all available configuration options available. Enjoy!
132
+
133
 
134
  Old legacy methods (not officially supported as of version 7.0.0.0):
135
 
148
 
149
  == Changelog ==
150
 
151
+ = 7.0.3.6 =
152
+ * New "Vertical" theme for Related Content!
153
+ * Added a note about caching plugins; organized the "Advanced Settings" page
154
+ * Shareaholic shortcode now support title, link and summary parameters
155
+
156
  = 7.0.3.5 =
 
 
157
  * Added support for shareaholic:url meta tag
158
  * Bugfix: Now compatible with JavaScript minification plugins
159
+ * Localizations
160
+ * Added German (de_DE) by Lothar Schiborr
161
 
162
  = 7.0.3.4 =
163
  * Fix for Cross-Site Request Forgery vulnerability. Upgrade immediately.
934
 
935
  == Upgrade Notice ==
936
 
937
+ = 7.0.3.6 =
938
+ New "Vertical" theme for Related Content! Organized the "Advanced Settings" page and Shareaholic shortcode now support title, link and summary parameters.
939
+
940
  = 7.0.3.5 =
941
  Language localizations and bugfixes.
942
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main and first file!
4
  *
5
  * @package shareaholic
6
- * @version 7.0.3.5
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
- Version: 7.0.3.5
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Credits & Thanks: https://shareaholic.com/tools/wordpress/credits
@@ -42,7 +42,7 @@ require_once(SHAREAHOLIC_DIR . '/deprecation.php');
42
  */
43
  class Shareaholic {
44
  const URL = 'https://shareaholic.com';
45
- const VERSION = '7.0.3.5';
46
  /**
47
  * Starts off as false so that ::get_instance() returns
48
  * a new instance.
3
  * The main and first file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.0.3.6
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
+ Version: 7.0.3.6
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Credits & Thanks: https://shareaholic.com/tools/wordpress/credits
42
  */
43
  class Shareaholic {
44
  const URL = 'https://shareaholic.com';
45
+ const VERSION = '7.0.3.6';
46
  /**
47
  * Starts off as false so that ::get_instance() returns
48
  * a new instance.
six_to_seven.php CHANGED
@@ -68,7 +68,8 @@ class ShareaholicSixToSeven {
68
  'site_name' => ShareaholicUtilities::site_name(),
69
  'domain' => ShareaholicUtilities::site_url(),
70
  'verification_key' => $verification_key,
71
- 'platform' => 'wordpress'
 
72
  ),
73
  );
74
 
@@ -417,4 +418,4 @@ class ShareaholicSixToSeven {
417
  }
418
  }
419
 
420
- ?>
68
  'site_name' => ShareaholicUtilities::site_name(),
69
  'domain' => ShareaholicUtilities::site_url(),
70
  'verification_key' => $verification_key,
71
+ 'platform_id' => '12',
72
+ 'language_id' => ShareaholicUtilities::site_language()
73
  ),
74
  );
75
 
418
  }
419
  }
420
 
421
+ ?>
templates/advanced_settings.php CHANGED
@@ -2,40 +2,50 @@
2
  <div id="icon-options-general" class="icon32"></div>
3
  <h2><?php echo sprintf(__('Shareaholic: Advanced Settings', 'shareaholic')); ?></h2>
4
  <div style="margin-top:20px;"></div>
5
- <?php echo sprintf(__('You rarely should need to edit the settings on this page.', 'shareaholic')); ?>
6
- <div style="min-height:300px;">
 
 
 
7
  <form name='advanced_settings' method='post' action='<?php echo $action ?>'>
8
  <?php wp_nonce_field($action, 'nonce_field') ?>
9
  <input type='hidden' name='already_submitted' value='Y'>
10
  <div class='clear'>
11
- <fieldset>
 
12
  <input type='checkbox' id='tracking' name='shareaholic[disable_tracking]' class='check'
13
  <?php if (isset($settings['disable_tracking'])) { ?>
14
  <?php echo ($settings['disable_tracking'] == 'on' ? 'checked' : '') ?>
15
  <?php } ?>>
16
- <label style="display: inline-block;" for="tracking"><?php echo sprintf(__('Disable Analytics', 'shareaholic')); ?> <?php echo sprintf(__('(it is recommended NOT to disable analytics)', 'shareaholic')); ?></label>
17
  <br />
18
  <input type='checkbox' id='og_tags' name='shareaholic[disable_og_tags]' class='check'
19
  <?php if (isset($settings['disable_og_tags'])) { ?>
20
  <?php echo ($settings['disable_og_tags'] == 'on' ? 'checked' : '') ?>
21
  <?php } ?>>
22
- <label style="display: inline-block;" for="og_tags"><?php echo sprintf(__('Do not automatically include <code>Open Graph</code> tags', 'shareaholic')); ?> <?php echo sprintf(__('(it is recommended NOT to disable open graph tags)', 'shareaholic')); ?></label>
 
 
 
23
  </fieldset>
24
- </div>
25
-
26
- <div class='clear' style="padding-top:20px; padding-bottom:35px;">
27
- <input type='submit' value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
28
- </div>
29
  </form>
30
-
 
 
31
  <form name='reset_settings' method='post' action='<?php echo $action ?>'>
32
  <?php wp_nonce_field($action, 'nonce_field') ?>
33
  <input type='hidden' name='reset_settings' value='Y'>
34
- <fieldset>
35
- <p><?php echo sprintf(__('Clicking this button will reset all of your settings and start you from scratch.', 'shareaholic')); ?></p>
36
- <input type='submit' value='<?php echo sprintf(__('Reset Everything', 'shareaholic')); ?>'>
 
 
37
  </fieldset>
38
- </form>
 
 
 
39
  </div>
40
  </div>
41
  <?php ShareaholicAdmin::show_footer(); ?>
2
  <div id="icon-options-general" class="icon32"></div>
3
  <h2><?php echo sprintf(__('Shareaholic: Advanced Settings', 'shareaholic')); ?></h2>
4
  <div style="margin-top:20px;"></div>
5
+
6
+ <div class='unit size4of5' style="min-height:300px;">
7
+
8
+ <span class="helper"><i class="icon-star"></i> <?php echo sprintf(__('You rarely should need to edit the settings on this page.', 'shareaholic')); ?> <?php echo sprintf(__('After changing any Shareaholic advanced setting, it is good practice to clear any WordPress caching plugins (if you are using one).', 'shareaholic')); ?></p></span>
9
+
10
  <form name='advanced_settings' method='post' action='<?php echo $action ?>'>
11
  <?php wp_nonce_field($action, 'nonce_field') ?>
12
  <input type='hidden' name='already_submitted' value='Y'>
13
  <div class='clear'>
14
+ <fieldset class="app">
15
+ <legend><h2><?php echo sprintf(__('Advanced', 'shareaholic')); ?></h2></legend>
16
  <input type='checkbox' id='tracking' name='shareaholic[disable_tracking]' class='check'
17
  <?php if (isset($settings['disable_tracking'])) { ?>
18
  <?php echo ($settings['disable_tracking'] == 'on' ? 'checked' : '') ?>
19
  <?php } ?>>
20
+ <label style="display: inline-block; font-size:12px;" for="tracking"><?php echo sprintf(__('Disable Analytics', 'shareaholic')); ?> <?php echo sprintf(__('(it is recommended NOT to disable analytics)', 'shareaholic')); ?></label>
21
  <br />
22
  <input type='checkbox' id='og_tags' name='shareaholic[disable_og_tags]' class='check'
23
  <?php if (isset($settings['disable_og_tags'])) { ?>
24
  <?php echo ($settings['disable_og_tags'] == 'on' ? 'checked' : '') ?>
25
  <?php } ?>>
26
+ <label style="display: inline-block; font-size:12px;" for="og_tags"><?php echo sprintf(__('Do not automatically include <code>Open Graph</code> tags', 'shareaholic')); ?> <?php echo sprintf(__('(it is recommended NOT to disable open graph tags)', 'shareaholic')); ?></label>
27
+
28
+ <div class='clear' style="padding-top:10px;"></div>
29
+ <input type='submit' onclick="this.value='<?php echo sprintf(__('Saving Changes...', 'shareaholic')); ?>';" value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
30
  </fieldset>
31
+ </div>
 
 
 
 
32
  </form>
33
+
34
+ <div class='clear'></div>
35
+
36
  <form name='reset_settings' method='post' action='<?php echo $action ?>'>
37
  <?php wp_nonce_field($action, 'nonce_field') ?>
38
  <input type='hidden' name='reset_settings' value='Y'>
39
+ <fieldset class="app">
40
+ <legend><h2><?php echo sprintf(__('Reset', 'shareaholic')); ?></h2></legend>
41
+ <?php echo sprintf(__('This will reset all of your settings and start you from scratch. This can not be undone.', 'shareaholic')); ?>
42
+ <div class='clear'></div>
43
+ <input type='submit' onclick="this.value='<?php echo sprintf(__('Resetting Plugin...', 'shareaholic')); ?>';" value='<?php echo sprintf(__('Reset Plugin', 'shareaholic')); ?>'>
44
  </fieldset>
45
+
46
+ <div class='clear' style="padding-bottom:35px;"></div>
47
+
48
+ </form>
49
  </div>
50
  </div>
51
  <?php ShareaholicAdmin::show_footer(); ?>
templates/settings.php CHANGED
@@ -11,6 +11,7 @@
11
  window.first_part_of_url = '<?php echo Shareaholic::URL . '/publisher_tools/' . $settings['api_key']?>/';
12
  window.verification_key = '<?php echo $settings['verification_key'] ?>'
13
  </script>
 
14
  <div class='unit size3of5'>
15
  <form name="settings" method="post" action="<?php echo $action; ?>"></iframe>
16
  <?php wp_nonce_field($action, 'nonce_field') ?>
@@ -18,11 +19,11 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
18
 
19
  <div id='app_settings'>
20
 
21
- <fieldset class="app" style="line-height:18px;"><?php echo sprintf(__('First time here? Read %sUnderstanding the new Shareaholic for WordPress interface and configuration settings.%s', 'shareaholic'), '<a href="https://blog.shareaholic.com/2013/07/understanding-the-new-shareaholic-for-wordpress-interface-and-configuration-settings/" target="_blank">','</a>'); ?> <?php echo sprintf(__('If you are upgrading from an earlier version of Shareaholic for WordPress and need help, have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="#" onclick="SnapEngage.startLink();">','</a>'); ?>
22
  </fieldset>
23
 
24
  <fieldset class="app"><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/sharebuttons@2x.png" height=32 width=32 /> <?php echo sprintf(__('Share Buttons', 'shareaholic')); ?></h2></legend>
25
- <span class="helper"><i class="icon-question-sign"></i><?php echo sprintf(__('Pick where you want your buttons to be displayed. Click "Edit" to customize look & feel, themes, share counters, alignment, etc.', 'shareaholic')); ?></span>
26
 
27
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
28
  <fieldset id='sharebuttons'>
@@ -49,7 +50,7 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
49
  <div class='clear'></div>
50
 
51
  <fieldset class="app"><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/related_content@2x.png" height=32 width=32 /> <?php echo sprintf(__('Related Content / Recommendations', 'shareaholic')); ?></h2></legend>
52
- <span class="helper"><i class="icon-question-sign"></i><?php echo sprintf(__('Pick where you want Related Content to be displayed. Click "Edit" to customize look & feel, themes, block lists, etc.', 'shareaholic')); ?></span>
53
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
54
  <?php if (isset($settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"])) { ?>
55
  <?php $location_id = $settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"] ?>
@@ -86,7 +87,7 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
86
 
87
  <div class='clear'></div>
88
  <div class="row" style="padding-top:20px; padding-bottom:35px;">
89
- <div class="span2"><input type='submit' value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'></div>
90
  </div>
91
  </form>
92
  </div>
11
  window.first_part_of_url = '<?php echo Shareaholic::URL . '/publisher_tools/' . $settings['api_key']?>/';
12
  window.verification_key = '<?php echo $settings['verification_key'] ?>'
13
  </script>
14
+
15
  <div class='unit size3of5'>
16
  <form name="settings" method="post" action="<?php echo $action; ?>"></iframe>
17
  <?php wp_nonce_field($action, 'nonce_field') ?>
19
 
20
  <div id='app_settings'>
21
 
22
+ <fieldset class="app" style="line-height:18px;"><?php echo sprintf(__('First time here? Read %sUnderstanding the new Shareaholic for WordPress interface and configuration settings.%s', 'shareaholic'), '<a href="https://blog.shareaholic.com/understanding-the-new-shareaholic-for-wordpress-interface-and-configuration-settings/" target="_blank">','</a>'); ?> <?php echo sprintf(__('If you are upgrading from an earlier version of Shareaholic for WordPress and need help, have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="#" onclick="SnapEngage.startLink();">','</a>'); ?>
23
  </fieldset>
24
 
25
  <fieldset class="app"><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/sharebuttons@2x.png" height=32 width=32 /> <?php echo sprintf(__('Share Buttons', 'shareaholic')); ?></h2></legend>
26
+ <span class="helper"><i class="icon-star"></i> <?php echo sprintf(__('Pick where you want your buttons to be displayed. Click "Edit" to customize look & feel, themes, share counters, alignment, etc.', 'shareaholic')); ?></span>
27
 
28
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
29
  <fieldset id='sharebuttons'>
50
  <div class='clear'></div>
51
 
52
  <fieldset class="app"><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>img/related_content@2x.png" height=32 width=32 /> <?php echo sprintf(__('Related Content / Recommendations', 'shareaholic')); ?></h2></legend>
53
+ <span class="helper"><i class="icon-star"></i> <?php echo sprintf(__('Pick where you want Related Content to be displayed. Click "Edit" to customize look & feel, themes, block lists, etc.', 'shareaholic')); ?></span>
54
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
55
  <?php if (isset($settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"])) { ?>
56
  <?php $location_id = $settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"] ?>
87
 
88
  <div class='clear'></div>
89
  <div class="row" style="padding-top:20px; padding-bottom:35px;">
90
+ <div class="span2"><input type='submit' onclick="this.value='<?php echo sprintf(__('Saving Changes...', 'shareaholic')); ?>';" value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'></div>
91
  </div>
92
  </form>
93
  </div>
utilities.php CHANGED
@@ -64,6 +64,7 @@ class ShareaholicUtilities {
64
  * @return bool
65
  */
66
  public static function destroy_settings() {
 
67
  return delete_option('shareaholic_settings');
68
  }
69
 
@@ -134,9 +135,7 @@ class ShareaholicUtilities {
134
  */
135
  public static function update_options($array) {
136
  $old_settings = self::get_settings();
137
-
138
  $new_settings = self::array_merge_recursive_distinct($old_settings, $array);
139
-
140
  update_option('shareaholic_settings', $new_settings);
141
  }
142
 
@@ -451,6 +450,9 @@ class ShareaholicUtilities {
451
  if (is_plugin_active('sexybookmarks/sexy-bookmarks.php')) {
452
  deactivate_plugins('sexybookmarks/sexy-bookmarks.php');
453
  }
 
 
 
454
  }
455
 
456
  /**
@@ -483,7 +485,8 @@ class ShareaholicUtilities {
483
  'verification_key' => $verification_key,
484
  'site_name' => self::site_name(),
485
  'domain' => self::site_url(),
486
- 'platform' => 'wordpress',
 
487
  'shortener' => 'shrlc',
488
  'recommendations_attributes' => array(
489
  'locations_attributes' => array(
@@ -554,10 +557,47 @@ class ShareaholicUtilities {
554
  return preg_replace('/https?:\/\//', '', site_url());
555
  }
556
 
 
 
 
 
 
557
  public static function site_name() {
558
  return get_bloginfo('name') ? get_bloginfo('name') : site_url();
559
  }
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  /**
562
  * Shockingly the built in PHP array_merge_recursive function is stupid.
563
  * this is stolen from the PHP docs and will overwrite existing keys instead
64
  * @return bool
65
  */
66
  public static function destroy_settings() {
67
+ delete_option('shareaholic_get_or_create_api_key');
68
  return delete_option('shareaholic_settings');
69
  }
70
 
135
  */
136
  public static function update_options($array) {
137
  $old_settings = self::get_settings();
 
138
  $new_settings = self::array_merge_recursive_distinct($old_settings, $array);
 
139
  update_option('shareaholic_settings', $new_settings);
140
  }
141
 
450
  if (is_plugin_active('sexybookmarks/sexy-bookmarks.php')) {
451
  deactivate_plugins('sexybookmarks/sexy-bookmarks.php');
452
  }
453
+ if (is_plugin_active('sexybookmarks/shareaholic.php')) {
454
+ deactivate_plugins('sexybookmarks/shareaholic.php');
455
+ }
456
  }
457
 
458
  /**
485
  'verification_key' => $verification_key,
486
  'site_name' => self::site_name(),
487
  'domain' => self::site_url(),
488
+ 'platform_id' => '12',
489
+ 'language_id' => self::site_language(),
490
  'shortener' => 'shrlc',
491
  'recommendations_attributes' => array(
492
  'locations_attributes' => array(
557
  return preg_replace('/https?:\/\//', '', site_url());
558
  }
559
 
560
+ /**
561
+ * Returns the site's name
562
+ *
563
+ * @return string
564
+ */
565
  public static function site_name() {
566
  return get_bloginfo('name') ? get_bloginfo('name') : site_url();
567
  }
568
 
569
+ /**
570
+ * Returns the site's primary locale / language
571
+ *
572
+ * @return string
573
+ */
574
+ public static function site_language() {
575
+ $site_language = strtolower(get_bloginfo('language'));
576
+
577
+ if (strpos($site_language, 'en-') !== false) {
578
+ $language_id = 9; // English
579
+ } elseif (strpos($site_language, 'da-') !== false) {
580
+ $language_id = 7; // Danish
581
+ } elseif (strpos($site_language, 'de-') !== false) {
582
+ $language_id = 13; // German
583
+ } elseif (strpos($site_language, 'es-') !== false) {
584
+ $language_id = 31; // Spanish
585
+ } elseif (strpos($site_language, 'fr-') !== false) {
586
+ $language_id = 12; // French
587
+ } elseif (strpos($site_language, 'pt-') !== false) {
588
+ $language_id = 25; // Portuguese
589
+ } elseif (strpos($site_language, 'it-') !== false) {
590
+ $language_id = 18; // Italian
591
+ } elseif (strpos($site_language, 'zh-cn') !== false) {
592
+ $language_id = 3; // Chinese (Simplified)
593
+ } elseif (strpos($site_language, 'zh-tw') !== false) {
594
+ $language_id = 4; // Chinese (Traditional)
595
+ } else {
596
+ $language_id = NULL;
597
+ }
598
+ return $language_id;
599
+ }
600
+
601
  /**
602
  * Shockingly the built in PHP array_merge_recursive function is stupid.
603
  * this is stolen from the PHP docs and will overwrite existing keys instead