$lacands_eget, 'url'=>$lacands_uget, 'name'=>$lacands_nget, 'desc'=>$lacands_dget, 'charset'=>$lacands_cget, 'version'=>$lacands_vget, 'lang'=>$lacands_lget, 'plugin'=>'cs'); lacands_http_post($link, $lacands_bloginfo); add_option('lacands-html-widget-counters-location', 'beforeAndafter'); add_option('lacands-html-widget-margin-top', '5'); add_option('lacands-html-widget-margin-right', '0'); add_option('lacands-html-widget-margin-bottom', '5'); add_option('lacands-html-widget-margin-left', '0'); add_option('lacands-html-widget-disable-cntr-display-after', '0'); } else if ($option == 'update') { if(!empty($_POST['lacands-html-widget-counters-location'])) { update_option('lacands-html-widget-counters-location', $_POST['lacands-html-widget-counters-location']); } if($_POST['lacands-html-widget-margin-top'] != NULL) { update_option('lacands-html-widget-margin-top', (string)$_POST['lacands-html-widget-margin-top']); } else { update_option('lacands-html-widget-margin-top', '0'); } if($_POST['lacands-html-widget-margin-right'] != NULL) { update_option('lacands-html-widget-margin-right', (string)$_POST['lacands-html-widget-margin-right']); } else { update_option('lacands-html-widget-margin-right', '0'); } if($_POST['lacands-html-widget-margin-bottom'] != NULL) { update_option('lacands-html-widget-margin-bottom', (string)$_POST['lacands-html-widget-margin-bottom']); } else { update_option('lacands-html-widget-margin-bottom', '0'); } if($_POST['lacands-html-widget-margin-left'] != NULL) { update_option('lacands-html-widget-margin-left', (string)$_POST['lacands-html-widget-margin-left']); } else { update_option('lacands-html-widget-margin-left', '0'); } if(!empty($_POST['lacands-html-widget-disable-cntr-display'])) { update_option('lacands-html-widget-disable-cntr-display', (string)$_POST['lacands-html-widget-disable-cntr-display']); } else { update_option('lacands-html-widget-disable-cntr-display', '0'); } } } function lacands_wp_filter_post_content ( $related_content ) { global $lacands_opt_widget_counters_location; global $lacands_widget_disable_cntr_display; $lacands_widget_disable_cntr_display = get_option('lacands-html-widget-disable-cntr-display'); $lacands_opt_widget_counters_location = get_option('lacands-html-widget-counters-location'); if($lacands_widget_disable_cntr_display == '0') { if($lacands_opt_widget_counters_location == "beforeAndafter") { $related_content_beforeAndafter = lacands_wp_filter_content_widget(FALSE); $related_content = $related_content_beforeAndafter.$related_content.$related_content_beforeAndafter; } else if($lacands_opt_widget_counters_location == "before") { $related_content = lacands_wp_filter_content_widget(FALSE).$related_content; } else if($lacands_opt_widget_counters_location == "after") { $related_content = $related_content.lacands_wp_filter_content_widget(FALSE); } } return ($related_content); } function lacands_wp_filter_content_widget ($show=TRUE) { global $lacands_opt_widget_counters_location, $lacands_widget_disable_cntr_display; global $lacands_opt_widget_margin_top, $lacands_opt_widget_margin_right, $lacands_opt_widget_margin_bottom, $lacands_opt_widget_margin_left; global $post; $p = $post; lacands_readOptionsValuesFromWPDatabase(); $position = ''; if( $lacands_widget_disable_cntr_display == '0') { $position = 'padding-top:'.$lacands_opt_widget_margin_top.'px;padding-right:'.$lacands_opt_widget_margin_right.'px;padding-bottom:'.$lacands_opt_widget_margin_bottom.'px;padding-left:'.$lacands_opt_widget_margin_left.'px;'; } if (is_single() || (is_home()) || (is_archive()) ) { $link1 = urlencode(get_permalink($p)); $lacands_widget_display_cntrs = '
'; if($show) { echo $lacands_widget_display_cntrs; return; } return $lacands_widget_display_cntrs; } return; } function lacands_wp_admin_options_settings () { global $lacands_opt_widget_counters_location, $lacands_widget_disable_cntr_display; global $lacands_opt_widget_margin_top, $lacands_opt_widget_margin_right, $lacands_opt_widget_margin_bottom, $lacands_opt_widget_margin_left; if (isset($_POST['lacands_widget_update'])) { if ( function_exists('current_user_can') && !current_user_can('manage_options') ) { die(__('Cheatin’ uh?')); } lacands_writeOptionsValuesToWPDatabase('update'); echo '

Settings saved for 1-click Retweet/Share/Like.

'; echo '

'; } lacands_readOptionsValuesFromWPDatabase(); $lacands_combo_iconWidget = ''; require("la-click-and-share-comboAdmin.html"); } function lacands_wp_admin() { if (function_exists('add_options_page')) { add_options_page('1-click Retweet/Share/Like', '1-click Retweet/Share/Like', 'manage_options', __FILE__, 'lacands_wp_admin_options_settings'); } } function lacands_activate() { lacands_writeOptionsValuesToWPDatabase('default'); } function lacands_main() { register_activation_hook( __FILE__, 'lacands_activate' ); add_action ( 'admin_menu', 'lacands_wp_admin') ; add_filter ( 'the_content', 'lacands_wp_filter_post_content'); } lacands_main(); ?>