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