Settings) * Version: 2.3.4 * Author: AddInto * Author URI: http://www.addinto.com */ if (!defined('ADDINTOPLUGINDEFINE')) define('ADDINTOPLUGINDEFINE', 1); else return; if ( !defined('WP_CONTENT_URL') ) define('WP_CONTENT_URL', get_option('siteurl').'/wp-content'); if ( !defined('WP_PLUGIN_URL') ) define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins'); $addIntoPluginPath = WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)); load_plugin_textdomain('addinto', $addIntoPluginPath.'/lang', plugin_basename(dirname(__FILE__)).'/lang'); function addIntoPluginInit () { global $addIntoPluginPath; if (get_option('ai2_align') || get_option('addinto_settings') === false) { addIntoPluginDefaultOptions(); } add_filter('admin_menu', 'addIntoPluginAdminMenu'); add_filter('the_content', 'addIntoPluginDisplayButton'); $options = get_option('addinto_settings'); if (isset($options['ai2_on_excerpts']) && $options['ai2_on_excerpts'] == 'yes') { add_filter('the_excerpt', 'addIntoPluginDisplayButton'); } } // function addIntoPluginDefaultOptions () { $options = array( 'ai2_button_logo' => 'text_button', 'ai2_text_button' => __('Bookmark / Share', 'addinto'), 'ai2_url_button' => '', 'ai2_align' => 'left', 'ai2_on_home' => 'yes', 'ai2_on_pages' => 'no', 'ai2_on_archives' => 'yes', 'ai2_on_categories' => 'yes', 'ai2_on_excerpts' => 'yes', 'ai2_button_type' => 'dropdown', 'ai2_hide_embeds' => 'no', 'ai2_dd_onclick' => 'onmouseover_dd', 'ai2_nb_srvs' => '', 'ai2_nb_columns' => '', 'ai2_srv' => '', 'ai2_srvs' => '', 'ai2_sharebox_srvs' => '' ); // Recover old values if exists foreach ($options as $name => $value) { $old_value = get_option($name); if($old_value === false) { $options[$name] = $value; } else { $options[$name] = $old_value; } delete_option($name); } update_option('addinto_settings', $options); } function addIntoPluginAdminMenu () { $page = add_options_page('AddInto Options', 'AddInto', 'manage_options', __FILE__, 'addIntoPluginOptions'); add_filter('admin_print_styles-'.$page, 'addIntoPluginStyles'); add_filter('admin_print_scripts-'.$page, 'addIntoPluginScripts'); } function addIntoPluginStyles() { global $addIntoPluginPath; wp_enqueue_style('addinto', $addIntoPluginPath.'/css/ai2css.css'); } function addIntoPluginScripts() { global $addIntoPluginPath; wp_enqueue_script('addinto', $addIntoPluginPath.'/js/ai2js.js'); } function addIntoPluginOptions () { global $addIntoPluginPath; $lang = explode(",", get_bloginfo('language')); $lang = StrToLower(substr(chop($lang[0]),0,2)); $lang = ($lang == 'fr') ? 'fr' : 'en'; if (!current_user_can('manage_options')) return false; $new_addinto_options = array(); if(isset($_POST['Submit'])) { check_admin_referer('addinto-update-options'); $checkbox_array = array('ai2_on_home', 'ai2_on_pages', 'ai2_on_archives', 'ai2_on_categories', 'ai2_on_excerpts', 'ai2_hide_embeds'); foreach($checkbox_array as $checkbox) { if(!isset($_POST['addinto'][$checkbox])) $new_addinto_options[$checkbox] = 'no'; } foreach($_POST['addinto'] as $key => $value) { $new_addinto_options[$key] = $value; } update_option('addinto_settings', $new_addinto_options); ?>

/>
id="partager_v2" />
id="favoris_partage_v2" />
id="bookmark_share_v2" />
id="bookmark_v2" />
id="share_v2" />
id="text_button" />
id="url_button" />
URL :
/>
/>
/>
/>
/>
Bookmark, Facebook, Twitter, Google Buzz, Separator, More

()
/>
/>
/>
/>
()
:
Email, Bookmark, Print, Delicious, Yahoo, Digg, MySpace, Facebook, Live Favorites, Yahoo Buzz, Twitter, FriendFeed, Google Buzz, More

LightBox :
All services

ID)); $post_title = urlencode(get_the_title($post->ID)); $logo = $options['ai2_button_logo']; $logo_txt = $options['ai2_text_button']; $logo_url = $options['ai2_url_button']; $dd_srvs = ($options['ai2_srv'] != '') ? 'var ai2_bkmk = "'.$options['ai2_srv'].'";' : ''; // Dropdown services $pi_srvs = ($options['ai2_srvs'] != '') ? 'var ai2_bkmks = "'.$options['ai2_srvs'].'";' : ''; // PopIn services $hide_embeds = ($options['ai2_hide_embeds'] == 'yes') ? 'var ai2_hide_embeds = true;' : ''; $servs_nb = ( $options['ai2_nb_srvs'] && ctype_digit($options['ai2_nb_srvs']) ) ? 'var ai2_per_page = "'.$options['ai2_nb_srvs'].'";' : ''; $cols_nb = ($options['ai2_nb_columns'] != '') ? 'var ai2_cols = "'.$options['ai2_nb_columns'].'";' : ''; if($options['ai2_dd_onclick'] == 'onclick_dd') { $onclick_dd = 'onclick'; $onclick_box = ''; } else if($options['ai2_dd_onclick'] == 'onmouseover_dd') { $onclick_dd = 'onmouseover'; $onclick_box = ''; } else { $onclick_box = 'bkmk'; $onclick_dd = 'onclick'; } $onmouseout = ($options['ai2_dd_onclick'] != 'onclick_box') ? ' onmouseout="ai2close_bkmk();"' : ''; $text_button_style = ($logo == 'text_button') ? ' style="background:url(\''.$addIntoPluginPath.'/logos/ai2_16x16.png\') no-repeat scroll 0 0 transparent !important; vertical-align:text-bottom; line-height:16px; height:16px; padding:0 0 0 20px; display:inline-block; margin:0 3px;"' : ''; $btnType = $options['ai2_button_type']; $button = ''; $button .= '
'; // // Start building button if($btnType != 'sharebox') { if($btnType == 'static') // Static button, anchor opening { $button .= ''; } else // Dropdown button, anchor opening { $button .= ''; } // anchor content if($logo == 'url_button' && $logo_url != '') { $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } else if($logo == 'text_button' && $logo_txt != '') { $button .= $logo_txt; } else if($logo != '' && $logo != 'url_button' && $logo != 'text_button') { $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } else { $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } // colsing anchor $button .= ''; } else // ShareBox { $sharebox_servs = ($options['ai2_sharebox_srvs'] != '') ? strtolower($options['ai2_sharebox_srvs']) : 'bookmark,facebook,twitter,google_buzz,separator,more'; $arr_sharebox_servs = explode(",", $sharebox_servs); $button .= '
'; foreach($arr_sharebox_servs as $key => $srv) { $srv = str_replace(array(' ', '.'), '_', trim($srv)); if($srv == 'more') { switch($options['ai2_dd_onclick']) { case 'onclick_dd' : $srv = 'more_dd_click'; break; case 'onmouseover_dd' : $srv = 'more_dd'; break; default : $srv = 'more'; } if($logo == 'url_button' && $logo_url != '') { $button .= ''; $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } else if($logo == 'text_button' && $logo_txt != '') { $button .= ''; $button .= $logo_txt; } else { $button .= ''; if($logo != '' && $logo != 'url_button' && $logo != 'text_button') { $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } else { $button .= ''.__('Bookmark/share via AddInto', 'addinto').''; } } $button .= ''; } else { $button .= ''; } } $button .= '
'; } // // Options and script for Dropdown button/ShareBox if($btnType != 'static') { if( $dd_srvs != '' || $pi_srvs != '' || $hide_embeds != '' || $servs_nb != '' || $cols_nb != '' ) { $button .= ''; } $button .= ''; } // End building button $button .= '
'; return $button; } function addIntoPluginDisplayButton ($content) { $options = get_option('addinto_settings'); if ( ( is_single() ) || ( is_home() && $options['ai2_on_home'] == 'yes' ) || ( is_page() && $options['ai2_on_pages'] == 'yes' ) || ( is_archive() && !is_category() && $options['ai2_on_archives'] == 'yes' ) || ( is_category() && $options['ai2_on_categories'] == 'yes' ) ) { return $content .= addIntoPluginCreateButton(); } else { return $content; } } add_action('init', 'addIntoPluginInit'); ?>