Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

@@ 380-388 (lines=9) @@
377
		if ( !$_blog_id ) {
378
			$_blog_id = $blog_id;
379
		}
380
		if ( $service_name == false ) {
381
			if ( $post_id > 0 ) {
382
				// total number of shares for this post
383
				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 ) );
384
			} else {
385
				// total number of shares for this blog
386
				return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d", $_blog_id ) );
387
			}
388
		}
389
390
		if ( $post_id > 0 )
391
			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 ) );
@@ 390-393 (lines=4) @@
387
			}
388
		}
389
390
		if ( $post_id > 0 )
391
			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 ) );
392
		else
393
			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 ) );
394
	}
395
396
	public function get_services_total( $post_id = false ) {