Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-sources.php 2 locations

@@ 281-293 (lines=13) @@
278
		return $return;
279
	}
280
281
	public function get_total( $post = false ) {
282
		global $wpdb, $blog_id;
283
284
		$name = strtolower( $this->get_id() );
285
286
		if ( $post == false ) {
287
			// get total number of shares for service
288
			return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $blog_id, $name ) );
289
		}
290
291
		// get total shares for a post
292
		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 ) );
293
	}
294
295
	public function get_posts_total() {
296
		global $wpdb, $blog_id;
@@ 1205-1217 (lines=13) @@
1202
		}
1203
	}
1204
1205
	public function get_total( $post = false ) {
1206
		global $wpdb, $blog_id;
1207
1208
		$name = strtolower( $this->get_id() );
1209
1210
		if ( $post == false ) {
1211
			// get total number of shares for service
1212
			return $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $blog_id, $name ) );
1213
		}
1214
1215
		// get total shares for a post
1216
		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 ) );
1217
	}
1218
}
1219
1220
class Share_Custom extends Sharing_Advanced_Source {