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