Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

@@ 408-416 (lines=9) @@
405
		if ( !$_blog_id ) {
406
			$_blog_id = $blog_id;
407
		}
408
		if ( $service_name == false ) {
409
			if ( $post_id > 0 ) {
410
				// total number of shares for this post
411
				return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d", $_blog_id, $post_id ) );
412
			} else {
413
				// total number of shares for this blog
414
				return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d", $_blog_id ) );
415
			}
416
		}
417
418
		if ( $post_id > 0 )
419
			return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $_blog_id, $post_id, $service_name ) );
@@ 418-421 (lines=4) @@
415
			}
416
		}
417
418
		if ( $post_id > 0 )
419
			return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $_blog_id, $post_id, $service_name ) );
420
		else
421
			return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s", $_blog_id, $service_name ) );
422
	}
423
424
	public function get_services_total( $post_id = false ) {