Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-sources.php 2 locations

@@ 270-282 (lines=13) @@
267
		return $return;
268
	}
269
270
	public function get_total( $post = false ) {
271
		global $wpdb, $blog_id;
272
273
		$name = strtolower( $this->get_id() );
274
275
		if ( $post == false ) {
276
			// get total number of shares for service
277
			return (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s", $blog_id, $name ) );
278
		}
279
280
		// get total shares for a post
281
		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $blog_id, $post->ID, $name ) );
282
	}
283
284
	public function get_posts_total() {
285
		global $wpdb, $blog_id;
@@ 1150-1162 (lines=13) @@
1147
		}
1148
	}
1149
1150
	public function get_total( $post = false ) {
1151
		global $wpdb, $blog_id;
1152
1153
		$name = strtolower( $this->get_id() );
1154
1155
		if ( $post == false ) {
1156
			// get total number of shares for service
1157
			return $wpdb->get_var( $wpdb->prepare( "SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s", $blog_id, $name ) );
1158
		}
1159
1160
		//get total shares for a post
1161
		return $wpdb->get_var( $wpdb->prepare( "SELECT count FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s", $blog_id, $post->ID, $name ) );
1162
	}
1163
}
1164
1165
class Share_Custom extends Sharing_Advanced_Source {