@@ 143-152 (lines=10) @@ | ||
140 | * @param array $ad_ids IDs of ads to increment views |
|
141 | * @return void |
|
142 | */ |
|
143 | public function increment_ads_views($ad_ids) |
|
144 | { |
|
145 | if (!empty($ad_ids)) |
|
146 | { |
|
147 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
148 | SET ad_views = ad_views + 1 |
|
149 | WHERE ' . $this->db->sql_in_set('ad_id', $ad_ids); |
|
150 | $this->db->sql_query($sql); |
|
151 | } |
|
152 | } |
|
153 | ||
154 | /** |
|
155 | * Increment clicks for specified ad |
|
@@ 224-235 (lines=12) @@ | ||
221 | * @param array $user_ids User IDs |
|
222 | * @return void |
|
223 | */ |
|
224 | public function remove_ad_owner(array $user_ids) |
|
225 | { |
|
226 | if (empty($user_ids)) |
|
227 | { |
|
228 | return; |
|
229 | } |
|
230 | ||
231 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
232 | SET ad_owner = 0 |
|
233 | WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids); |
|
234 | $this->db->sql_query($sql); |
|
235 | } |
|
236 | ||
237 | /** |
|
238 | * Get all locations for specified advertisement |