| @@ 158-167 (lines=10) @@ | ||
| 155 | * @param array $ad_ids IDs of ads to increment views |
|
| 156 | * @return void |
|
| 157 | */ |
|
| 158 | public function increment_ads_views($ad_ids) |
|
| 159 | { |
|
| 160 | if (!empty($ad_ids)) |
|
| 161 | { |
|
| 162 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
| 163 | SET ad_views = ad_views + 1 |
|
| 164 | WHERE ' . $this->db->sql_in_set('ad_id', $ad_ids); |
|
| 165 | $this->db->sql_query($sql); |
|
| 166 | } |
|
| 167 | } |
|
| 168 | ||
| 169 | /** |
|
| 170 | * Increment clicks for specified ad |
|
| @@ 251-262 (lines=12) @@ | ||
| 248 | * @param array $user_ids User IDs |
|
| 249 | * @return void |
|
| 250 | */ |
|
| 251 | public function remove_ad_owner(array $user_ids) |
|
| 252 | { |
|
| 253 | if (empty($user_ids)) |
|
| 254 | { |
|
| 255 | return; |
|
| 256 | } |
|
| 257 | ||
| 258 | $sql = 'UPDATE ' . $this->ads_table . ' |
|
| 259 | SET ad_owner = 0 |
|
| 260 | WHERE ' . $this->db->sql_in_set('ad_owner', $user_ids); |
|
| 261 | $this->db->sql_query($sql); |
|
| 262 | } |
|
| 263 | ||
| 264 | /** |
|
| 265 | * Get all locations for specified advertisement |
|