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
@@ 242-253 (lines=12) @@
239
	 * @param    array $user_ids User IDs
240
	 * @return    void
241
	 */
242
	public function remove_ad_owner(array $user_ids)
243
	{
244
		if (empty($user_ids))
245
		{
246
			return;
247
		}
248
249
		$sql = 'UPDATE ' . $this->ads_table . '
250
			SET ad_owner = 0
251
			WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids);
252
		$this->db->sql_query($sql);
253
	}
254
255
	/**
256
	 * Get all locations for specified advertisement