Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

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