Code Duplication    Length = 10-12 lines in 2 locations

ad/manager.php 2 locations

@@ 151-160 (lines=10) @@
148
	 * @param    array $ad_ids IDs of ads to increment views
149
	 * @return    void
150
	 */
151
	public function increment_ads_views($ad_ids)
152
	{
153
		if (!empty($ad_ids))
154
		{
155
			$sql = 'UPDATE ' . $this->ads_table . '
156
				SET ad_views = ad_views + 1
157
				WHERE ' . $this->db->sql_in_set('ad_id', $ad_ids);
158
			$this->db->sql_query($sql);
159
		}
160
	}
161
162
	/**
163
	 * Increment clicks for specified ad
@@ 246-257 (lines=12) @@
243
	 * @param    array $user_ids User IDs
244
	 * @return    void
245
	 */
246
	public function remove_ad_owner(array $user_ids)
247
	{
248
		if (empty($user_ids))
249
		{
250
			return;
251
		}
252
253
		$sql = 'UPDATE ' . $this->ads_table . '
254
			SET ad_owner = 0
255
			WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids);
256
		$this->db->sql_query($sql);
257
	}
258
259
	/**
260
	 * Get all locations for specified advertisement