Code Duplication    Length = 4-9 lines in 2 locations

modules/sharedaddy/sharing-service.php 2 locations

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