Advertisement
jmlapam

Juiz Sharer

Nov 18th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.47 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Juiz Social Post Sharer
  4. Plugin URI: http://www.creativejuiz.fr/blog/
  5. Description: Add buttons after your posts to allow visitors share your content (includes no JavaScript mode). The setting page is located in *Settings* submenu. <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=P39NJPCWVXGDY&amp;lc=FR&amp;item_name=Juiz%20Social%20Post%20Sharer%20%2d%20WP%20Plugin&amp;item_number=%23wp%2djsps&amp;currency_code=EUR&amp;bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted">Donate</a>
  6. Author: Geoffrey Crofte
  7. Version: 1.0.1
  8. Author URI: http://crofte.fr
  9. License: GPLv2 or later
  10. */
  11.  
  12. /*
  13.  
  14. Copyright 2012 Geoffrey Crofte (email : support@creativejuiz.com)
  15.  
  16.  
  17. This program is free software; you can redistribute it and/or
  18. modify it under the terms of the GNU General Public License
  19. as published by the Free Software Foundation; either version 2
  20. of the License, or (at your option) any later version.
  21.  
  22. This program is distributed in the hope that it will be useful,
  23. but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. GNU General Public License for more details.
  26.  
  27. You should have received a copy of the GNU General Public License
  28. along with this program; if not, write to the Free Software
  29. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  30.  
  31. */
  32.  
  33. define( 'JUIZ_SPS_PLUGIN_NAME', 'Juiz Social Post Sharer' );
  34. define( 'JUIZ_SPS_VERSION', '1.0.1' );
  35. define( 'JUIZ_SPS_DIRNAME', basename( dirname( __FILE__ ) ) );
  36. define( 'JUIZ_SPS_PLUGIN_URL', plugin_dir_url( __FILE__ ));
  37. define( 'JUIZ_SPS_SLUG', 'juiz-social-post-sharer' );
  38. define( 'JUIZ_SPS_SETTING_NAME', 'juiz_SPS_settings' );
  39.  
  40.  
  41.  
  42. // multilingue
  43.  
  44. add_action( 'init', 'make_juiz_sps_multilang' );
  45. function make_juiz_sps_multilang() {
  46. load_plugin_textdomain( 'jsps_lang', false, JUIZ_SPS_DIRNAME.'/languages' );
  47. }
  48.  
  49. if ( is_admin() || ( defined( 'DOING_AJAX' ) && !DOING_AJAX ) ) {
  50.  
  51. // uninstall hook
  52. register_uninstall_hook( __FILE__, 'juiz_sps_uninstaller' );
  53. function juiz_sps_uninstaller() {
  54. delete_option( JUIZ_SPS_SETTING_NAME );
  55. }
  56.  
  57. // activation hook
  58. register_activation_hook( __FILE__, 'juiz_sps_activation' );
  59. function juiz_sps_activation() {
  60. $juiz_sps_options = get_option ( JUIZ_SPS_SETTING_NAME );
  61. if ( !is_array($juiz_sps_options) ) {
  62.  
  63. $default_array = array(
  64. 'juiz_sps_style' => 1,
  65. 'juiz_sps_networks' => array(
  66. "facebook" => array(1, "Facebook"),
  67. "twitter" => array(1, "Twitter"),
  68. "google" => array(0, "Google+"),
  69. "pinterest" => array(0, "Pinterest"),
  70. "viadeo" => array(0, "Viadeo"),
  71. "linkedin" => array(0, "LinkedIn"),
  72. "digg" => array(0, "Digg"),
  73. "stumbleupon" => array(0, "StumbleUpon"),
  74. "mail" => array(1, "E-mail")
  75. ),
  76. 'juiz_sps_counter' => 0,
  77. 'juiz_sps_hide_social_name' => 0,
  78. 'juiz_sps_target_link' => 0
  79. );
  80.  
  81. update_option( JUIZ_SPS_SETTING_NAME , $default_array);
  82. }
  83. }
  84.  
  85. // description setting page
  86. add_filter( 'plugin_action_links_'.plugin_basename( __FILE__ ), 'juiz_sps_plugin_action_links', 10, 2);
  87. function juiz_sps_plugin_action_links( $links, $file ) {
  88. $links[] = '<a href="'.admin_url('options-general.php?page='.JUIZ_SPS_SLUG).'">' . __('Settings') .'</a>';
  89. return $links;
  90. }
  91.  
  92.  
  93. /*
  94. * Options page
  95. */
  96.  
  97.  
  98. // Settings page in admin menu
  99.  
  100. add_action('admin_menu', 'add_juiz_sps_settings_page');
  101. function add_juiz_sps_settings_page() {
  102. add_submenu_page(
  103. 'options-general.php',
  104. __('Social Post Sharer', 'jsma_lang'),
  105. __('Social Post Sharer', 'jsma_lang'),
  106. 'administrator',
  107. JUIZ_SPS_SLUG ,
  108. 'juiz_sps_settings_page'
  109. );
  110. }
  111.  
  112. // Some styles for settings page in admin
  113. add_action( 'admin_head-settings_page_'.JUIZ_SPS_SLUG, 'juiz_sps_custom_admin_header');
  114. function juiz_sps_custom_admin_header() {
  115. echo '
  116. <!-- '.JUIZ_SPS_PLUGIN_NAME.' styles -->
  117. <style rel="stylesheet">
  118. #juiz-sps h3 { font-size: 1.65em; color: #444; font-weight:normal; }
  119. .juiz_sps_section_intro {font-style: italic; color: #777; }
  120. #juiz-sps form {padding-left:45px}
  121. #juiz-sps th {font-weight:bold; padding-left:0}
  122. #juiz-sps th em {font-weight:normal;font-style: italic; color: #777;}
  123.  
  124. .jsps_demo_icon { display: inline-block; width: 16px; height: 16px; margin-right: 5px; vertical-align: middle; background: url('.JUIZ_SPS_PLUGIN_URL.'/img/sps_sprites.png) no-repeat 0 -16px;}
  125. .jsps_demo_icon_google { background-position: -16px -16px }
  126. .jsps_demo_icon_facebook { background-position: -32px -16px }
  127. .jsps_demo_icon_mail { background-position: -48px -16px }
  128. .jsps_demo_icon_pinterest { background-position: -64px -16px }
  129. .jsps_demo_icon_viadeo { background-position: -80px -16px }
  130. .jsps_demo_icon_linkedin { background-position: -96px -16px }
  131. .jsps_demo_icon_digg { background-position: -112px -16px }
  132. .jsps_demo_icon_stumbleupon { background-position: -128px -16px }
  133.  
  134. :checked + label .jsps_demo_icon_twitter { background-position: 0 0 }
  135. :checked + label .jsps_demo_icon_google { background-position: -16px 0 }
  136. :checked + label .jsps_demo_icon_facebook { background-position: -32px 0 }
  137. :checked + label .jsps_demo_icon_mail { background-position: -48px 0 }
  138. :checked + label .jsps_demo_icon_pinterest { background-position: -64px 0 }
  139. :checked + label .jsps_demo_icon_viadeo { background-position: -80px 0 }
  140. :checked + label .jsps_demo_icon_linkedin { background-position: -96px 0 }
  141. :checked + label .jsps_demo_icon_digg { background-position: -112px 0 }
  142. :checked + label .jsps_demo_icon_stumbleupon{ background-position: -128px 0 }
  143.  
  144. .juiz_sps_options_p { margin: .2em 5% .2em 0; }
  145.  
  146. .juiz_sps_styles_options {}
  147. .juiz_sps_demo_styles { display:inline-block; vertical-align:middle; width:592px; height:26px; background:url('.JUIZ_SPS_PLUGIN_URL.'/img/demo-sprites.png) no-repeat 0 -26px}
  148. [for="jsps_style_2"] .juiz_sps_demo_styles { background-position: 0 0 }
  149. [for="jsps_style_3"] .juiz_sps_demo_styles { height: 36px; background-position: 0 -93px }
  150. [for="jsps_style_4"] .juiz_sps_demo_styles { height: 36px; background-position: 0 -129px }
  151. .juiz_sps_style_name { display:inline-block; margin: 4px 0 0 18px; color: #777;}
  152. </style>
  153. <!-- end of '.JUIZ_SPS_PLUGIN_NAME.' styles -->
  154. ';
  155. }
  156.  
  157.  
  158. /*
  159. *****
  160. ***** Sections and fields for settings
  161. *****
  162. */
  163.  
  164. function add_juiz_sps_plugin_options() {
  165. // all options in single registration as array
  166. register_setting( JUIZ_SPS_SETTING_NAME, JUIZ_SPS_SETTING_NAME, 'juiz_sps_sanitize' );
  167.  
  168. add_settings_section('juiz_sps_plugin_main', __('Main settings','jsps_lang'), 'juiz_sps_section_text', JUIZ_SPS_SLUG);
  169. add_settings_field('juiz_sps_style_choice', __('Choose a style to display', 'jsps_lang'), 'juiz_sps_setting_radio_style_choice', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main');
  170. add_settings_field('juiz_sps_network_selection', __('Display those following social networks:', 'jsps_lang') , 'juiz_sps_setting_checkbox_network_selection', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main');
  171.  
  172.  
  173. add_settings_section('juiz_sps_plugin_advanced', __('Advanced settings','jsps_lang'), 'juiz_sps_section_text_advanced', JUIZ_SPS_SLUG);
  174. add_settings_field('juiz_sps_counter', __('Display counter of sharing?','jsps_lang').'<br /><em>('.__('need JavaScript','jsps_lang').')</em>', 'juiz_sps_setting_radio_counter', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced');
  175. add_settings_field('juiz_sps_hide_social_name', __('Show only social icon?', 'jsps_lang').'<br /><em>('.__('hide text, show it on mouse over or focus', 'jsps_lang').')</em>', 'juiz_sps_setting_radio_hide_social_name', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced');
  176. add_settings_field('juiz_sps_target_link', __('Open links in a new window?', 'jsps_lang').'<br /><em>('.sprintf(__('adds a %s attribute', 'jsps_lang'), '<code>target="_blank"</code>').')</em>', 'juiz_sps_setting_radio_target_link', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced');
  177.  
  178.  
  179. }
  180. add_filter('admin_init','add_juiz_sps_plugin_options');
  181.  
  182.  
  183. // sanitize posted data
  184.  
  185. function juiz_sps_sanitize($options) {
  186.  
  187. if( is_array( $options['juiz_sps_networks'] ) ) {
  188.  
  189. $temp_array = array('facebook'=>0, 'twitter'=>0, 'google'=>0, 'pinterest'=>0, 'viadeo'=>0, 'linkedin'=>0, 'digg'=>0, 'stumbleupon'=>0, 'mail' => 0);
  190. $juiz_sps_opt = get_option ( JUIZ_SPS_SETTING_NAME );
  191.  
  192. foreach( $options['juiz_sps_networks'] as $nw )
  193. $temp_array[$nw]=1;
  194.  
  195. foreach($temp_array as $k => $v)
  196. $juiz_sps_opt['juiz_sps_networks'][$k][0] = $v;
  197.  
  198. $newoptions['juiz_sps_networks'] = $juiz_sps_opt['juiz_sps_networks'];
  199. }
  200.  
  201.  
  202. $newoptions['juiz_sps_style'] = $options['juiz_sps_style']>=1 && $options['juiz_sps_style']<=4 ? (int)$options['juiz_sps_style'] : 1;
  203. $newoptions['juiz_sps_hide_social_name'] = (int)$options['juiz_sps_hide_social_name']==1 ? 1 : 0;
  204. $newoptions['juiz_sps_target_link'] = (int)$options['juiz_sps_target_link']==1 ? 1 : 0;
  205. $newoptions['juiz_sps_counter'] = (int)$options['juiz_sps_counter']==1 ? 1 : 0;
  206.  
  207. return $newoptions;
  208. }
  209.  
  210. // first section text
  211. function juiz_sps_section_text() {
  212. echo '<p class="juiz_sps_section_intro">'. __('Here, you can modify default settings of the SPS plugin', 'jsps_lang') .'</p>';
  213. }
  214.  
  215. // radio fields styles choice
  216. function juiz_sps_setting_radio_style_choice() {
  217. $n1 = $n2 = '';
  218. $options = get_option( JUIZ_SPS_SETTING_NAME );
  219. if ( is_array($options) )
  220. $n1 = $n2 = $n3 = $n4 = "";
  221. ${'n'.$options['juiz_sps_style']} = " checked='checked'";
  222.  
  223. echo '<p class="juiz_sps_styles_options">
  224. <input id="jsps_style_1" value="1" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_style]" type="radio" '.$n1.' />
  225. <label for="jsps_style_1"><span class="juiz_sps_demo_styles"></span><br /><span class="juiz_sps_style_name">'. __('Juizy Light Tone', 'jsps_lang') . '</span></label>
  226. </p>
  227. <p class="juiz_sps_styles_options">
  228. <input id="jsps_style_2" value="2" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_style]" type="radio" '.$n2.' />
  229. <label for="jsps_style_2"><span class="juiz_sps_demo_styles"></span><br /><span class="juiz_sps_style_name">'. __('Juizy Light Tone Reverse', 'jsps_lang') . '</span></label>
  230. </p>
  231. <p class="juiz_sps_styles_options">
  232. <input id="jsps_style_3" value="3" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_style]" type="radio" '.$n3.' />
  233. <label for="jsps_style_3"><span class="juiz_sps_demo_styles"></span><br /><span class="juiz_sps_style_name">'. __('Blue Metro Style', 'jsps_lang') . '</span></label>
  234. </p>
  235. <p class="juiz_sps_styles_options">
  236. <input id="jsps_style_4" value="4" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_style]" type="radio" '.$n4.' />
  237. <label for="jsps_style_4"><span class="juiz_sps_demo_styles"></span><br /><span class="juiz_sps_style_name">'. __('Gray Metro Style', 'jsps_lang') . '</span></label>
  238. </p>';
  239. }
  240.  
  241.  
  242. // checkboxes fields for networks
  243. function juiz_sps_setting_checkbox_network_selection() {
  244. $y = $n = '';
  245. $options = get_option( JUIZ_SPS_SETTING_NAME );
  246. if ( is_array($options) ) {
  247. foreach($options['juiz_sps_networks'] as $k => $v) {
  248.  
  249. $is_checked = ($v[0] == 1) ? ' checked="checked"' : '';
  250. $is_js_test = ($k == 'pinterest') ? ' <em>('.__('uses JavaScript to work','jsps_lang').')</em>' : '';
  251.  
  252. echo '<p class="juiz_sps_options_p">
  253. <input id="jsps_network_selection_'.$k.'" value="'.$k.'" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_networks][]" type="checkbox"
  254. '.$is_checked.' />
  255. <label for="jsps_network_selection_'.$k.'"><span class="jsps_demo_icon jsps_demo_icon_'.$k.'"></span>'.$v[1].''.$is_js_test.'</label>
  256. </p>';
  257. }
  258. }
  259. }
  260.  
  261. // Advanced section text
  262. function juiz_sps_section_text_advanced() {
  263. echo '<p class="juiz_sps_section_intro">'. __('Modify advanced settings of the plugin. Some of them needs JavaScript (only one file loaded)', 'jsps_lang') .'</p>';
  264. }
  265. // radio fields Y or N for counter
  266. function juiz_sps_setting_radio_counter() {
  267. $y = $n = '';
  268. $options = get_option( JUIZ_SPS_SETTING_NAME );
  269.  
  270. if ( is_array($options) )
  271. (isset($options['juiz_sps_counter']) AND $options['juiz_sps_counter']==1) ? $y = " checked='checked'" : $n = " checked='checked'";
  272.  
  273. echo ' <em style="color:#777;">' . __('This option will be enabled for a next version','jsps_lang') . '</em><br />
  274. <input id="jsps_counter_y" value="1" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_counter]" type="radio" '.$y.' disabled="disabled" />
  275. <label style="color:#777;" for="jsps_counter_y"> '. __('Yes', 'jsps_lang') . '</label>
  276. &nbsp;&nbsp;
  277. <input id="jsps_counter_n" value="0" name="'.JUIZ_SPS_SETTING_NAME.'[juiz_sps_counter]" type="radio" '.$n.' disabled="disabled" />
  278. <label style="color:#777;" for="jsps_counter_n"> '. __('No', 'jsps_lang') . '</label>';
  279. }
  280.  
  281. // radio fields Y or N for hide text
  282. function juiz_sps_setting_radio_hide_social_name() {
  283. $y = $n = '';
  284. $options = get_option( JUIZ_SPS_SETTING_NAME );
  285.  
  286. if ( is_array($options) )
  287. (isset($options['juiz_sps_hide_social_name']) AND $options['juiz_sps_hide_social_name']==1) ? $y = " checked='checked'" : $n = " checked='checked'";
  288.  
  289. echo " <input id='jsps_hide_name_y' value='1' name='".JUIZ_SPS_SETTING_NAME."[juiz_sps_hide_social_name]' type='radio' ".$y." />
  290. <label for='jsps_hide_name_y'> ". __('Yes', 'jsps_lang') . "</label>
  291. &nbsp;&nbsp;
  292. <input id='jsps_hide_name_n' value='0' name='".JUIZ_SPS_SETTING_NAME."[juiz_sps_hide_social_name]' type='radio' ".$n." />
  293. <label for='jsps_hide_name_n'> ". __('No', 'jsps_lang') . "</label>";
  294. }
  295.  
  296. // radio fields Y or N for target _blank
  297. function juiz_sps_setting_radio_target_link() {
  298. $y = $n = '';
  299. $options = get_option( JUIZ_SPS_SETTING_NAME );
  300.  
  301. if ( is_array($options) )
  302. (isset($options['juiz_sps_target_link']) AND $options['juiz_sps_target_link']==1) ? $y = " checked='checked'" : $n = " checked='checked'";
  303.  
  304. echo " <input id='jsps_target_link_y' value='1' name='".JUIZ_SPS_SETTING_NAME."[juiz_sps_target_link]' type='radio' ".$y." />
  305. <label for='jsps_target_link_y'> ". __('Yes', 'jsps_lang') . "</label>
  306. &nbsp;&nbsp;
  307. <input id='jsps_target_link_n' value='0' name='".JUIZ_SPS_SETTING_NAME."[juiz_sps_target_link]' type='radio' ".$n." />
  308. <label for='jsps_target_link_n'> ". __('No', 'jsps_lang') . "</label>";
  309. }
  310.  
  311.  
  312.  
  313.  
  314. // The page layout/form
  315.  
  316. function juiz_sps_settings_page() {
  317. ?>
  318. <div id="juiz-sps" class="wrap">
  319. <div id="icon-options-general" class="icon32">&nbsp;</div>
  320. <h2><?php _e('Manage Juiz Social Post Sharer', 'jsps_lang') ?></h2>
  321.  
  322. <form method="post" action="options.php">
  323. <?php
  324. settings_fields( JUIZ_SPS_SETTING_NAME );
  325. do_settings_sections( JUIZ_SPS_SLUG );
  326. submit_button();
  327. ?>
  328. </form>
  329.  
  330. <p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=P39NJPCWVXGDY&amp;lc=FR&amp;item_name=Juiz%20Social%20Post%20Sharer%20%2d%20WP%20Plugin&amp;item_number=%23wp%2djsps&amp;currency_code=EUR&amp;bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"><?php _e('Donate', 'jsps_lang') ?></a></p>
  331. </div>
  332. <?php
  333. }
  334.  
  335. } // end if is_admin
  336.  
  337. if (!is_admin()) {
  338. // Use appropriate hook :)
  339. add_action( 'wp_enqueue_scripts', 'juiz_sps_style_and_script');
  340. function juiz_sps_style_and_script() {
  341. $juiz_sps_options = get_option( JUIZ_SPS_SETTING_NAME );
  342. if(is_array($juiz_sps_options) && is_single() ) {
  343. if(is_numeric($juiz_sps_options['juiz_sps_style']))
  344. wp_enqueue_style( 'juiz_sps_styles', JUIZ_SPS_PLUGIN_URL.'/css/'.JUIZ_SPS_SLUG.'-'.$juiz_sps_options['juiz_sps_style'].'.css', false, false, 'all' );
  345. if(is_numeric($juiz_sps_options['juiz_sps_counter']) && $juiz_sps_options['juiz_sps_counter']==1)
  346. wp_enqueue_script( 'juiz_sps_scripts', JUIZ_SPS_PLUGIN_URL.'/js/'.JUIZ_SPS_SLUG.'.js', array('jquery'), false, true );
  347. }
  348. }
  349.  
  350. add_action('the_content', 'juiz_sps_print_links', 1, 10);
  351. function juiz_sps_print_links($content) {
  352. if(is_single()){
  353. global $post;
  354.  
  355. $juiz_sps_content = '';
  356. $juiz_sps_options = get_option( JUIZ_SPS_SETTING_NAME );
  357.  
  358.  
  359. if ( is_array($juiz_sps_options) ) {
  360.  
  361. $juiz_sps_target_link = ($juiz_sps_options['juiz_sps_target_link']==1) ? ' target="_blank"' : '';
  362. $juiz_sps_hidden_name_class = ($juiz_sps_options['juiz_sps_hide_social_name']==1) ? ' juiz_sps_hide_name' : '';
  363.  
  364. $juiz_sps_content = '<div class="juiz_sps_links">';
  365. $juiz_sps_content .= '<p class="screen-reader-text juiz_sps_maybe_hidden_text">'.__('Share the post','jsps_lang').' "'.get_the_title().'"</p>';
  366. $juiz_sps_content .= '<ul class="juiz_sps_links_list'.$juiz_sps_hidden_name_class.'">';
  367.  
  368. foreach($juiz_sps_options['juiz_sps_networks'] as $k => $v) {
  369. if( $v[0] == 1 ) {
  370. $api_link = $api_text = '';
  371. $text = urlencode($post->post_title);
  372. $url = urlencode($post->guid);
  373. switch ($k) {
  374. case "twitter" :
  375. $api_link = 'https://twitter.com/intent/tweet?source=webclient&amp;original_referer='.$url.'&amp;text='.$text.'&amp;url='.$url;
  376. $api_text = __('Share this article on Twitter','jsps_lang');
  377. break;
  378.  
  379. case "facebook" :
  380. $api_link = 'https://www.facebook.com/sharer/sharer.php?u='.$url;
  381. $api_text = __('Share this article on Facebook','jsps_lang');
  382. break;
  383.  
  384. case "google" :
  385. $api_link = 'https://plus.google.com/share?url='.$url;
  386. $api_text = __('Share this article on Google+','jsps_lang');
  387. break;
  388.  
  389. case "pinterest" :
  390. $api_link = "javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)})());";
  391. $api_text = __('Share an image of this article on Pinterest','jsps_lang');
  392. break;
  393.  
  394. case "viadeo" :
  395. $api_link = "http://www.viadeo.com/shareit/share/?url=".$url;
  396. $api_text = __('Share this article on Viadeo','jsps_lang');
  397. break;
  398.  
  399. case 'linkedin':
  400. $api_link = "http://www.linkedin.com/shareArticle?mini=true&amp;ro=true&amp;trk=JuizSocialPostSharer&amp;title=".$text."&amp;url=".$url;
  401. $api_text = __('Share this article on LinkedIn','jsps_lang');
  402. break;
  403.  
  404. case 'digg':
  405. $api_link = "http://digg.com/submit?phase=2%20&amp;url=".$url."&amp;title=".$text;
  406. $api_text = __('Share this article on Digg','jsps_lang');
  407. break;
  408.  
  409. case 'stumbleupon':
  410. $api_link = "http://www.stumbleupon.com/badge/?url=".$url;
  411. $api_text = __('Share this article on StumbleUpon','jsps_lang');
  412. break;
  413.  
  414. case "mail" :
  415. $api_link = 'mailto:?subject='.__('Visit this link','jsps_lang').'&amp;body='.__('Hi, I found this information for you! Have a nice day :)','jsps_lang')." : ".$url;
  416. $api_text = __('Share this article with a friend (email)','jsps_lang');
  417. break;
  418. }
  419.  
  420. $juiz_sps_content .= '<li class="juiz_sps_link_'.$k.'"><a href="'.$api_link.'" rel="nofollow" title="'.$api_text.'"'.$juiz_sps_target_link.'><span class="juiz_sps_icon"></span><span class="juis_sps_network_name">'.$v[1].'</span></a></li>';
  421.  
  422. }
  423. }
  424.  
  425. $juiz_sps_content .= '</ul>';
  426. $juiz_sps_content .= '</div>';
  427. $content .= $juiz_sps_content;
  428. }
  429. }
  430.  
  431. return $content;
  432. }
  433. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement