Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

@@ 457-465 (lines=9) @@
454
		if ( ! $_blog_id ) {
455
			$_blog_id = $blog_id;
456
		}
457
		if ( $service_name == false ) {
458
			if ( $post_id > 0 ) {
459
				// total number of shares for this post
460
				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 ) );
461
			} else {
462
				// total number of shares for this blog
463
				return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d', $_blog_id ) );
464
			}
465
		}
466
467
		if ( $post_id > 0 ) {
468
			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 ) );
@@ 467-470 (lines=4) @@
464
			}
465
		}
466
467
		if ( $post_id > 0 ) {
468
			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 ) );
469
		} else {
470
			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 ) );
471
		}
472
	}
473