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