'cube3x_social', 'description' => 'New Trend in Social Sharing' ); /* Widget control settings. */ $control_ops = array( 'width' => 350, 'height' => 350, 'id_base' => 'cube3x-social' ); /* Create the widget. */ $this->WP_Widget( 'cube3x-social', 'All in One Social Lite', $widget_ops, $control_ops ); } function widget( $args, $instance ) { if($instance['show_in_single'] == 1) if(!is_single()) return; extract( $args ); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title'] ); /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) echo $before_title . $title . $after_title; $all_in_one_social_options = get_option('all_in_one_social_settings'); //Reading General Settings for the widget $services = array(); $social_names = array(); $facebook_graph_html = $twitter_graph_html = $gplus_graph_html = $linkedin_graph_html = $stumple_graph_html = ''; if($instance['list_of_services_facebook']){ array_push($services, '{"name":"facebook","id":"'.$all_in_one_social_options['facebook_id'].'","subscriber_count":"'.$all_in_one_social_options['facebook_fans'].'"}'); array_push($social_names, '"facebook"'); $facebook_graph_html = <<
EOT; } if($instance['list_of_services_twitter']){ array_push($services, '{"name":"twitter","id":"'.$all_in_one_social_options['twitter_id'].'","subscriber_count":"'.$all_in_one_social_options['twitter_fans'].'"}'); array_push($social_names, '"twitter"'); $twitter_graph_html = << EOT; } if($instance['list_of_services_gplus']){ array_push($services, '{"name":"gplus","id":"'.$all_in_one_social_options['gplus_id'].'","subscriber_count":"'.$all_in_one_social_options['gplus_fans'].'"}'); array_push($social_names, '"gplus"'); $gplus_graph_html = <<