@@ -13,16 +13,16 @@ |
||
| 13 | 13 | class after_not_first_post extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'after_not_first_post'; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | public function will_display() |
| 27 | 27 | { |
| 28 | 28 | return strpos($this->user->page['page_name'], 'viewtopic') !== false; |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | class below_footer extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'below_footer'; |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | protected $ad_locations_table; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Constructor |
|
| 26 | - * |
|
| 27 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 28 | - * @param string $ads_table Ads table |
|
| 29 | - * @param string $ad_locations_table Ad locations table |
|
| 30 | - */ |
|
| 25 | + * Constructor |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
| 28 | + * @param string $ads_table Ads table |
|
| 29 | + * @param string $ad_locations_table Ad locations table |
|
| 30 | + */ |
|
| 31 | 31 | public function __construct(\phpbb\db\driver\driver_interface $db, $ads_table, $ad_locations_table) |
| 32 | 32 | { |
| 33 | 33 | $this->db = $db; |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * Get specific ad |
|
| 40 | - * |
|
| 41 | - * @param int $ad_id Advertisement ID |
|
| 42 | - * @return mixed Array with advertisement data, false if ad doesn't exist |
|
| 43 | - */ |
|
| 39 | + * Get specific ad |
|
| 40 | + * |
|
| 41 | + * @param int $ad_id Advertisement ID |
|
| 42 | + * @return mixed Array with advertisement data, false if ad doesn't exist |
|
| 43 | + */ |
|
| 44 | 44 | public function get_ad($ad_id) |
| 45 | 45 | { |
| 46 | 46 | $sql = 'SELECT * |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Get one ad per every location |
|
| 58 | - * |
|
| 59 | - * @param array $ad_locations List of ad locations to fetch ads for |
|
| 60 | - * @return array List of ad codes for each location |
|
| 61 | - */ |
|
| 57 | + * Get one ad per every location |
|
| 58 | + * |
|
| 59 | + * @param array $ad_locations List of ad locations to fetch ads for |
|
| 60 | + * @return array List of ad codes for each location |
|
| 61 | + */ |
|
| 62 | 62 | public function get_ads($ad_locations) |
| 63 | 63 | { |
| 64 | 64 | $sql = 'SELECT location_id, ad_code |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * Get all advertisements |
|
| 86 | - * |
|
| 87 | - * @return array List of all ads |
|
| 88 | - */ |
|
| 85 | + * Get all advertisements |
|
| 86 | + * |
|
| 87 | + * @return array List of all ads |
|
| 88 | + */ |
|
| 89 | 89 | public function get_all_ads() |
| 90 | 90 | { |
| 91 | 91 | $sql = 'SELECT ad_id, ad_name, ad_enabled, ad_end_date |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Insert new advertisement to the database |
|
| 102 | - * |
|
| 103 | - * @param array $data New ad data |
|
| 104 | - * @return int New advertisement ID |
|
| 105 | - */ |
|
| 101 | + * Insert new advertisement to the database |
|
| 102 | + * |
|
| 103 | + * @param array $data New ad data |
|
| 104 | + * @return int New advertisement ID |
|
| 105 | + */ |
|
| 106 | 106 | public function insert_ad($data) |
| 107 | 107 | { |
| 108 | 108 | $data = $this->intersect_ad_data($data); |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | - * Update advertisement |
|
| 118 | - * |
|
| 119 | - * @param int $ad_id Advertisement ID |
|
| 120 | - * @param array $data List of data to update in the database |
|
| 121 | - * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
| 122 | - */ |
|
| 117 | + * Update advertisement |
|
| 118 | + * |
|
| 119 | + * @param int $ad_id Advertisement ID |
|
| 120 | + * @param array $data List of data to update in the database |
|
| 121 | + * @return int Number of affected rows. Can be used to determine if any ad has been updated. |
|
| 122 | + */ |
|
| 123 | 123 | public function update_ad($ad_id, $data) |
| 124 | 124 | { |
| 125 | 125 | $data = $this->intersect_ad_data($data); |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * Delete advertisement |
|
| 137 | - * |
|
| 138 | - * @param int $ad_id Advertisement ID |
|
| 139 | - * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
| 140 | - */ |
|
| 136 | + * Delete advertisement |
|
| 137 | + * |
|
| 138 | + * @param int $ad_id Advertisement ID |
|
| 139 | + * @return int Number of affected rows. Can be used to determine if any ad has been deleted. |
|
| 140 | + */ |
|
| 141 | 141 | public function delete_ad($ad_id) |
| 142 | 142 | { |
| 143 | 143 | $sql = 'DELETE FROM ' . $this->ads_table . ' |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * Get all locations for specified advertisement |
|
| 152 | - * |
|
| 153 | - * @param int $ad_id Advertisement ID |
|
| 154 | - * @return array List of template locations for specified ad |
|
| 155 | - */ |
|
| 151 | + * Get all locations for specified advertisement |
|
| 152 | + * |
|
| 153 | + * @param int $ad_id Advertisement ID |
|
| 154 | + * @return array List of template locations for specified ad |
|
| 155 | + */ |
|
| 156 | 156 | public function get_ad_locations($ad_id) |
| 157 | 157 | { |
| 158 | 158 | $ad_locations = array(); |
@@ -171,12 +171,12 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * Insert advertisement locations |
|
| 175 | - * |
|
| 176 | - * @param int $ad_id Advertisement ID |
|
| 177 | - * @param array $ad_locations List of template locations for this ad |
|
| 178 | - * @return void |
|
| 179 | - */ |
|
| 174 | + * Insert advertisement locations |
|
| 175 | + * |
|
| 176 | + * @param int $ad_id Advertisement ID |
|
| 177 | + * @param array $ad_locations List of template locations for this ad |
|
| 178 | + * @return void |
|
| 179 | + */ |
|
| 180 | 180 | public function insert_ad_locations($ad_id, $ad_locations) |
| 181 | 181 | { |
| 182 | 182 | $sql_ary = array(); |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * Delete advertisement locations |
|
| 195 | - * |
|
| 196 | - * @param int $ad_id Advertisement ID |
|
| 197 | - * @return void |
|
| 198 | - */ |
|
| 194 | + * Delete advertisement locations |
|
| 195 | + * |
|
| 196 | + * @param int $ad_id Advertisement ID |
|
| 197 | + * @return void |
|
| 198 | + */ |
|
| 199 | 199 | public function delete_ad_locations($ad_id) |
| 200 | 200 | { |
| 201 | 201 | $sql = 'DELETE FROM ' . $this->ad_locations_table . ' |
@@ -204,11 +204,11 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | - * Load memberships of the user |
|
| 208 | - * |
|
| 209 | - * @param int $user_id User ID to load memberships |
|
| 210 | - * @return array List of group IDs user is member of |
|
| 211 | - */ |
|
| 207 | + * Load memberships of the user |
|
| 208 | + * |
|
| 209 | + * @param int $user_id User ID to load memberships |
|
| 210 | + * @return array List of group IDs user is member of |
|
| 211 | + */ |
|
| 212 | 212 | public function load_memberships($user_id) |
| 213 | 213 | { |
| 214 | 214 | $memberships = array(); |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | - * Load all board groups |
|
| 230 | - * |
|
| 231 | - * @return array List of groups |
|
| 232 | - */ |
|
| 229 | + * Load all board groups |
|
| 230 | + * |
|
| 231 | + * @return array List of groups |
|
| 232 | + */ |
|
| 233 | 233 | public function load_groups() |
| 234 | 234 | { |
| 235 | 235 | $sql = 'SELECT group_id, group_name, group_type |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | - * Make sure only necessary data make their way to SQL query |
|
| 247 | - * |
|
| 248 | - * @param array $data List of data to query the database |
|
| 249 | - * @return array Cleaned data that contain only valid keys |
|
| 250 | - */ |
|
| 246 | + * Make sure only necessary data make their way to SQL query |
|
| 247 | + * |
|
| 248 | + * @param array $data List of data to query the database |
|
| 249 | + * @return array Cleaned data that contain only valid keys |
|
| 250 | + */ |
|
| 251 | 251 | protected function intersect_ad_data($data) |
| 252 | 252 | { |
| 253 | 253 | return array_intersect_key($data, array( |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | - * Get the random statement for this database layer |
|
| 264 | - * |
|
| 265 | - * @return string Random statement for current database layer |
|
| 266 | - */ |
|
| 263 | + * Get the random statement for this database layer |
|
| 264 | + * |
|
| 265 | + * @return string Random statement for current database layer |
|
| 266 | + */ |
|
| 267 | 267 | protected function sql_random() |
| 268 | 268 | { |
| 269 | 269 | switch ($this->db->get_sql_layer()) |
@@ -16,33 +16,33 @@ discard block |
||
| 16 | 16 | class m1_initial_schema extends \phpbb\db\migration\migration |
| 17 | 17 | { |
| 18 | 18 | /** |
| 19 | - * {@inheritDoc} |
|
| 20 | - */ |
|
| 19 | + * {@inheritDoc} |
|
| 20 | + */ |
|
| 21 | 21 | public function effectively_installed() |
| 22 | 22 | { |
| 23 | 23 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ads'); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * {@inheritDoc} |
|
| 28 | - */ |
|
| 27 | + * {@inheritDoc} |
|
| 28 | + */ |
|
| 29 | 29 | static public function depends_on() |
| 30 | 30 | { |
| 31 | 31 | return array('\phpbb\db\migration\data\v31x\v316'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Add the ads table schema to the database: |
|
| 36 | - * ads: |
|
| 37 | - * ad_id |
|
| 38 | - * ad_name |
|
| 39 | - * ad_note |
|
| 40 | - * ad_code |
|
| 41 | - * ad_enabled |
|
| 42 | - * |
|
| 43 | - * @return array Array of table schema |
|
| 44 | - * @access public |
|
| 45 | - */ |
|
| 35 | + * Add the ads table schema to the database: |
|
| 36 | + * ads: |
|
| 37 | + * ad_id |
|
| 38 | + * ad_name |
|
| 39 | + * ad_note |
|
| 40 | + * ad_code |
|
| 41 | + * ad_enabled |
|
| 42 | + * |
|
| 43 | + * @return array Array of table schema |
|
| 44 | + * @access public |
|
| 45 | + */ |
|
| 46 | 46 | public function update_schema() |
| 47 | 47 | { |
| 48 | 48 | return array( |
@@ -62,11 +62,11 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Drop the ads table schema from the database |
|
| 66 | - * |
|
| 67 | - * @return array Array of table schema |
|
| 68 | - * @access public |
|
| 69 | - */ |
|
| 65 | + * Drop the ads table schema from the database |
|
| 66 | + * |
|
| 67 | + * @return array Array of table schema |
|
| 68 | + * @access public |
|
| 69 | + */ |
|
| 70 | 70 | public function revert_schema() |
| 71 | 71 | { |
| 72 | 72 | return array( |
@@ -13,16 +13,16 @@ discard block |
||
| 13 | 13 | class m4_indexes extends \phpbb\db\migration\migration |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function effectively_installed() |
| 19 | 19 | { |
| 20 | 20 | return $this->db_tools->sql_index_exists($this->table_prefix . 'ads', 'ad_enabled'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | static public function depends_on() |
| 27 | 27 | { |
| 28 | 28 | return array( |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Add the indexes |
|
| 36 | - * |
|
| 37 | - * @return array Array of altered table schema |
|
| 38 | - * @access public |
|
| 39 | - */ |
|
| 35 | + * Add the indexes |
|
| 36 | + * |
|
| 37 | + * @return array Array of altered table schema |
|
| 38 | + * @access public |
|
| 39 | + */ |
|
| 40 | 40 | public function update_schema() |
| 41 | 41 | { |
| 42 | 42 | return array( |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Drop the indexes |
|
| 56 | - * |
|
| 57 | - * @return array Array of altered table schema |
|
| 58 | - * @access public |
|
| 59 | - */ |
|
| 55 | + * Drop the indexes |
|
| 56 | + * |
|
| 57 | + * @return array Array of altered table schema |
|
| 58 | + * @access public |
|
| 59 | + */ |
|
| 60 | 60 | public function revert_schema() |
| 61 | 61 | { |
| 62 | 62 | return array( |
@@ -16,40 +16,40 @@ |
||
| 16 | 16 | abstract class base implements \phpbb\ads\location\type\type_interface |
| 17 | 17 | { |
| 18 | 18 | /** |
| 19 | - * User object |
|
| 20 | - * @var \phpbb\user |
|
| 21 | - */ |
|
| 19 | + * User object |
|
| 20 | + * @var \phpbb\user |
|
| 21 | + */ |
|
| 22 | 22 | protected $user; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Construct an after_profile template location object |
|
| 26 | - * |
|
| 27 | - * @param \phpbb\user $user User object |
|
| 28 | - */ |
|
| 25 | + * Construct an after_profile template location object |
|
| 26 | + * |
|
| 27 | + * @param \phpbb\user $user User object |
|
| 28 | + */ |
|
| 29 | 29 | public function __construct(\phpbb\user $user) |
| 30 | 30 | { |
| 31 | 31 | $this->user = $user; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * {@inheritDoc} |
|
| 36 | - */ |
|
| 35 | + * {@inheritDoc} |
|
| 36 | + */ |
|
| 37 | 37 | public function get_name() |
| 38 | 38 | { |
| 39 | 39 | return $this->user->lang('AD_' . strtoupper($this->get_id())); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * {@inheritDoc} |
|
| 44 | - */ |
|
| 43 | + * {@inheritDoc} |
|
| 44 | + */ |
|
| 45 | 45 | public function get_desc() |
| 46 | 46 | { |
| 47 | 47 | return $this->user->lang('AD_' . strtoupper($this->get_id()) . '_DESC'); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * {@inheritDoc} |
|
| 52 | - */ |
|
| 51 | + * {@inheritDoc} |
|
| 52 | + */ |
|
| 53 | 53 | public function will_display() |
| 54 | 54 | { |
| 55 | 55 | return true; |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | class m2_acp_module extends \phpbb\db\migration\migration |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function effectively_installed() |
| 19 | 19 | { |
| 20 | 20 | $sql = 'SELECT module_id |
@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | static public function depends_on() |
| 35 | 35 | { |
| 36 | 36 | return array('\phpbb\ads\migrations\v10x\m1_initial_schema'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Add the ACP module |
|
| 41 | - * |
|
| 42 | - * @return array Array of data update instructions |
|
| 43 | - */ |
|
| 40 | + * Add the ACP module |
|
| 41 | + * |
|
| 42 | + * @return array Array of data update instructions |
|
| 43 | + */ |
|
| 44 | 44 | public function update_data() |
| 45 | 45 | { |
| 46 | 46 | return array( |
@@ -13,30 +13,30 @@ discard block |
||
| 13 | 13 | class m3_template_locations_schema extends \phpbb\db\migration\migration |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function effectively_installed() |
| 19 | 19 | { |
| 20 | 20 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ad_locations'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | static public function depends_on() |
| 27 | 27 | { |
| 28 | 28 | return array('\phpbb\ads\migrations\v10x\m1_initial_schema'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * Add the ad_locations table schema to the database: |
|
| 33 | - * ad_locations: |
|
| 34 | - * ad_id |
|
| 35 | - * location_id |
|
| 36 | - * |
|
| 37 | - * @return array Array of table schema |
|
| 38 | - * @access public |
|
| 39 | - */ |
|
| 32 | + * Add the ad_locations table schema to the database: |
|
| 33 | + * ad_locations: |
|
| 34 | + * ad_id |
|
| 35 | + * location_id |
|
| 36 | + * |
|
| 37 | + * @return array Array of table schema |
|
| 38 | + * @access public |
|
| 39 | + */ |
|
| 40 | 40 | public function update_schema() |
| 41 | 41 | { |
| 42 | 42 | return array( |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * Drop the ad_locations table schema from the database |
|
| 57 | - * |
|
| 58 | - * @return array Array of table schema |
|
| 59 | - * @access public |
|
| 60 | - */ |
|
| 56 | + * Drop the ad_locations table schema from the database |
|
| 57 | + * |
|
| 58 | + * @return array Array of table schema |
|
| 59 | + * @access public |
|
| 60 | + */ |
|
| 61 | 61 | public function revert_schema() |
| 62 | 62 | { |
| 63 | 63 | return array( |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | class m6_hide_for_group extends \phpbb\db\migration\container_aware_migration |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function effectively_installed() |
| 19 | 19 | { |
| 20 | 20 | $config_text = $this->container->get('config_text'); |
@@ -23,18 +23,18 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * {@inheritDoc} |
|
| 27 | - */ |
|
| 26 | + * {@inheritDoc} |
|
| 27 | + */ |
|
| 28 | 28 | static public function depends_on() |
| 29 | 29 | { |
| 30 | 30 | return array('\phpbb\ads\migrations\v10x\m2_acp_module'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * Add the ACP settings module |
|
| 35 | - * |
|
| 36 | - * @return array Array of data update instructions |
|
| 37 | - */ |
|
| 34 | + * Add the ACP settings module |
|
| 35 | + * |
|
| 36 | + * @return array Array of data update instructions |
|
| 37 | + */ |
|
| 38 | 38 | public function update_data() |
| 39 | 39 | { |
| 40 | 40 | return array( |