addInto_plugin_logos = get_bloginfo('wpurl').'/wp-content/plugins/addinto/logos'; $this->bloginfo_lng = get_bloginfo('language'); if($_POST['addinto']) { $this->update_vars($_POST['addinto']); update_option( 'ai_srv', $_POST['ai_srv'] ); update_option( 'ai_srvs', $_POST['ai_srvs'] ); } } function update_vars ($vars) { foreach($vars as $key => $value) { if(get_option($key)) { update_option($key, $value); } else { add_option($key, $value); } } } function admin_menu () { add_options_page('AddInto Options', 'AddInto', 8, __FILE__, array(&$this, 'plugin_options')); } function plugin_options () { $langue = explode(",",$this->bloginfo_lng); $langue = StrToLower(substr(chop($langue[0]),0,2)); $langue = ($langue == 'fr') ? 'fr' : 'en'; // ----- $logo_addinto = (get_option('ai_button_logo') == 'logo_addinto') ? ' checked="checked"' : ''; $logo4 = (get_option('ai_button_logo') == 'logo4') ? ' checked="checked"' : ''; $logo1 = (get_option('ai_button_logo') == 'logo1') ? ' checked="checked"' : ''; $logo5 = (get_option('ai_button_logo') == 'logo5_fr' or get_option('ai_button_logo') == 'logo5_en') ? ' checked="checked"' : ''; $logo7 = (get_option('ai_button_logo') == 'logo7_fr' or get_option('ai_button_logo') == 'logo7_en') ? ' checked="checked"' : ''; // ----- $align_left = (get_option('ai_align') == 'left') ? ' selected="selected"' : ''; $align_center = (get_option('ai_align') == 'center') ? ' selected="selected"' : ''; $align_right = (get_option('ai_align') == 'right') ? ' selected="selected"' : ''; // ----- $display_on_home_yes = (get_option('ai_display_on_home') == 'yes') ? ' checked="checked"' : ''; $display_on_home_no = (get_option('ai_display_on_home') == 'no') ? ' checked="checked"' : ''; $display_on_pages_yes = (get_option('ai_display_on_pages') == 'yes') ? ' checked="checked"' : ''; $display_on_pages_no = (get_option('ai_display_on_pages') == 'no') ? ' checked="checked"' : ''; $display_on_archives_yes = (get_option('ai_display_on_archives') == 'yes') ? ' checked="checked"' : ''; $display_on_archives_no = (get_option('ai_display_on_archives') == 'no') ? ' checked="checked"' : ''; $display_on_categories_yes = (get_option('ai_display_on_categories') == 'yes') ? ' checked="checked"' : ''; $display_on_categories_no = (get_option('ai_display_on_categories') == 'no') ? ' checked="checked"' : ''; ?>

id="logo_addinto" /> id="logo4" /> id="logo1" /> id="logo5" /> id="logo7" />
: /> />
: /> />
: /> />
: /> />
leave empty to use the default services)', 'addinto') ?>
: [X]
: [X]

ID)); $logo = get_option('ai_button_logo'); $align = get_option('ai_align'); $ai_srv = (get_option('ai_srv') != '') ? 'var ai2_bkmk = "'.get_option('ai_srv').'";' : ''; $ai_srvs = (get_option('ai_srvs') != '') ? 'var ai2_bkmks = "'.get_option('ai_srvs').'";' : ''; $button = ''; $button .= '
'; $button .= ''; $button .= ''.__('Bookmark/share with AddInto !', 'addinto').''; $button .= ''; $button .= '
'; if($ai_srv != '' || $ai_srvs != '') $button .= ''; $button .= ''; return $button; } /*function addinto_js () { $ai_srv = (get_option('ai_srv') != '') ? 'var ai2_bkmk = "'.get_option('ai_srv').'";' : ''; $ai_srvs = (get_option('ai_srvs') != '') ? 'var ai2_bkmks = "'.get_option('ai_srvs').'";' : ''; if($ai_srv != '' || $ai_srvs != '') echo ''; echo ''; }*/ function display ($content) { $display_home = get_option('ai_display_on_home'); $display_pages = get_option('ai_display_on_pages'); $display_archives = get_option('ai_display_on_archives'); $display_categories = get_option('ai_display_on_categories'); if (is_feed()) return $content; elseif (is_single()) return $content .= $this->write_button(); elseif (is_home() && $display_home == 'yes') return $content .= $this->write_button(); elseif (is_page() && $display_pages == 'yes') return $content .= $this->write_button(); elseif (is_archive() && $display_archives == 'yes') return $content .= $this->write_button(); elseif (is_category() && $display_categories == 'yes') return $content .= $this->write_button(); } } $AddInto =& new AddInto_plugin(); ?>