Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

@@ 389-397 (lines=9) @@
386
		if ( !$_blog_id ) {
387
			$_blog_id = $blog_id;
388
		}
389
		if ( $service_name == false ) {
390
			if ( $post_id > 0 ) {
391
				// total number of shares for this post
392
				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 ) );
393
			} else {
394
				// total number of shares for this blog
395
				return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d", $_blog_id ) );
396
			}
397
		}
398
399
		if ( $post_id > 0 )
400
			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 ) );
@@ 399-402 (lines=4) @@
396
			}
397
		}
398
399
		if ( $post_id > 0 )
400
			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 ) );
401
		else
402
			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 ) );
403
	}
404
405
	public function get_services_total( $post_id = false ) {