@@ 149-158 (lines=10) @@ | ||
146 | * @param array $ad_ids IDs of ads to increment views |
|
147 | * @return void |
|
148 | */ |
|
149 | public function increment_ads_views($ad_ids) |
|
150 | { |
|
151 | if (!empty($ad_ids)) |
|
152 | { |
|
153 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
154 | SET ad_views = ad_views + 1 |
|
155 | WHERE ' . $this->db->sql_in_set('ad_id', $ad_ids); |
|
156 | $this->db->sql_query($sql); |
|
157 | } |
|
158 | } |
|
159 | ||
160 | /** |
|
161 | * Increment clicks for specified ad |
|
@@ 230-241 (lines=12) @@ | ||
227 | * @param array $user_ids User IDs |
|
228 | * @return void |
|
229 | */ |
|
230 | public function remove_ad_owner(array $user_ids) |
|
231 | { |
|
232 | if (empty($user_ids)) |
|
233 | { |
|
234 | return; |
|
235 | } |
|
236 | ||
237 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
238 | SET ad_owner = 0 |
|
239 | WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids); |
|
240 | $this->db->sql_query($sql); |
|
241 | } |
|
242 | ||
243 | /** |
|
244 | * Get all locations for specified advertisement |