Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

@@ 421-429 (lines=9) @@
418
		if ( !$_blog_id ) {
419
			$_blog_id = $blog_id;
420
		}
421
		if ( $service_name == false ) {
422
			if ( $post_id > 0 ) {
423
				// total number of shares for this post
424
				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 ) );
425
			} else {
426
				// total number of shares for this blog
427
				return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d", $_blog_id ) );
428
			}
429
		}
430
431
		if ( $post_id > 0 )
432
			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 ) );
@@ 431-434 (lines=4) @@
428
			}
429
		}
430
431
		if ( $post_id > 0 )
432
			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 ) );
433
		else
434
			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 ) );
435
	}
436
437
	public function get_services_total( $post_id = false ) {