| @@ 18-29 (lines=12) @@ | ||
| 15 | /** |
|
| 16 | * {@inheritDoc} |
|
| 17 | */ |
|
| 18 | public function effectively_installed() |
|
| 19 | { |
|
| 20 | $sql = 'SELECT module_id |
|
| 21 | FROM ' . $this->table_prefix . "modules |
|
| 22 | WHERE module_class = 'acp' |
|
| 23 | AND module_langname = 'ACP_PHPBB_ADS_TITLE'"; |
|
| 24 | $result = $this->db->sql_query($sql); |
|
| 25 | $module_id = (int) $this->db->sql_fetchfield('module_id'); |
|
| 26 | $this->db->sql_freeresult($result); |
|
| 27 | ||
| 28 | return $module_id; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * {@inheritDoc} |
|
| @@ 93-102 (lines=10) @@ | ||
| 90 | * |
|
| 91 | * @return array List of all ads |
|
| 92 | */ |
|
| 93 | public function get_all_ads() |
|
| 94 | { |
|
| 95 | $sql = 'SELECT ad_id, ad_name, ad_enabled, ad_end_date, ad_views, ad_clicks, ad_views_limit, ad_clicks_limit |
|
| 96 | FROM ' . $this->ads_table; |
|
| 97 | $result = $this->db->sql_query($sql); |
|
| 98 | $data = $this->db->sql_fetchrowset($result); |
|
| 99 | $this->db->sql_freeresult($result); |
|
| 100 | ||
| 101 | return $data; |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * Increment views for specified ads |
|
| @@ 271-281 (lines=11) @@ | ||
| 268 | * |
|
| 269 | * @return array List of groups |
|
| 270 | */ |
|
| 271 | public function load_groups() |
|
| 272 | { |
|
| 273 | $sql = 'SELECT group_id, group_name, group_type |
|
| 274 | FROM ' . GROUPS_TABLE . ' |
|
| 275 | ORDER BY group_name ASC'; |
|
| 276 | $result = $this->db->sql_query($sql); |
|
| 277 | $groups = $this->db->sql_fetchrowset($result); |
|
| 278 | $this->db->sql_freeresult($result); |
|
| 279 | ||
| 280 | return $groups; |
|
| 281 | } |
|
| 282 | ||
| 283 | /** |
|
| 284 | * Make sure only necessary data make their way to SQL query |
|