@@ -18,31 +18,31 @@ discard block |
||
18 | 18 | class directory_website_in_queue extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_in_queue'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_IN_MODERATION_QUEUE', |
38 | 38 | 'group' => 'NOTIFICATION_DIR_UCP', |
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
42 | - * Permission to check for (in find_users_for_notification) |
|
43 | - * |
|
44 | - * @var string Permission name |
|
45 | - */ |
|
42 | + * Permission to check for (in find_users_for_notification) |
|
43 | + * |
|
44 | + * @var string Permission name |
|
45 | + */ |
|
46 | 46 | protected $permission = 'a_'; |
47 | 47 | |
48 | 48 | /** @var \phpbb\user_loader */ |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Is available |
|
58 | - * |
|
59 | - * @return bool True/False whether or not this is available to the user |
|
60 | - */ |
|
57 | + * Is available |
|
58 | + * |
|
59 | + * @return bool True/False whether or not this is available to the user |
|
60 | + */ |
|
61 | 61 | public function is_available() |
62 | 62 | { |
63 | 63 | $has_permission = $this->auth->acl_get($this->permission, true); |
@@ -66,21 +66,21 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | - * Get link id |
|
70 | - * |
|
71 | - * @param array $data The data from the link |
|
72 | - * @return int |
|
73 | - */ |
|
69 | + * Get link id |
|
70 | + * |
|
71 | + * @param array $data The data from the link |
|
72 | + * @return int |
|
73 | + */ |
|
74 | 74 | static public function get_item_id($data) |
75 | 75 | { |
76 | 76 | return (int) $data['link_id']; |
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | - * Get parent id - it's not used |
|
81 | - * |
|
82 | - * @param array $data The data from the link |
|
83 | - */ |
|
80 | + * Get parent id - it's not used |
|
81 | + * |
|
82 | + * @param array $data The data from the link |
|
83 | + */ |
|
84 | 84 | static public function get_item_parent_id($data) |
85 | 85 | { |
86 | 86 | // No parent |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Find the users who want to receive notifications |
|
92 | - * |
|
93 | - * @param array $data Data from submit link |
|
94 | - * @param array $options Options for finding users for notification |
|
95 | - * @return array |
|
96 | - */ |
|
91 | + * Find the users who want to receive notifications |
|
92 | + * |
|
93 | + * @param array $data Data from submit link |
|
94 | + * @param array $options Options for finding users for notification |
|
95 | + * @return array |
|
96 | + */ |
|
97 | 97 | public function find_users_for_notification($data, $options = array()) |
98 | 98 | { |
99 | 99 | $options = array_merge(array( |
@@ -113,18 +113,18 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
116 | - * Get the user's avatar |
|
117 | - */ |
|
116 | + * Get the user's avatar |
|
117 | + */ |
|
118 | 118 | public function get_avatar() |
119 | 119 | { |
120 | 120 | return $this->user_loader->get_avatar($this->get_data('user_from'), false, true); |
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | - * Get the HTML formatted title of this notification |
|
125 | - * |
|
126 | - * @return string |
|
127 | - */ |
|
124 | + * Get the HTML formatted title of this notification |
|
125 | + * |
|
126 | + * @return string |
|
127 | + */ |
|
128 | 128 | public function get_title() |
129 | 129 | { |
130 | 130 | $link_name = $this->get_data('link_name'); |
@@ -134,30 +134,30 @@ discard block |
||
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
137 | - * Get email template |
|
138 | - * |
|
139 | - * @return string |
|
140 | - */ |
|
137 | + * Get email template |
|
138 | + * |
|
139 | + * @return string |
|
140 | + */ |
|
141 | 141 | public function get_email_template() |
142 | 142 | { |
143 | 143 | return '@ernadoo_phpbbdirectory/directory_website_in_queue'; |
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Get email template variables |
|
148 | - * |
|
149 | - * @return array |
|
150 | - */ |
|
147 | + * Get email template variables |
|
148 | + * |
|
149 | + * @return array |
|
150 | + */ |
|
151 | 151 | public function get_email_template_variables() |
152 | 152 | { |
153 | 153 | return array(); |
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * Get the url to this item |
|
158 | - * |
|
159 | - * @return string URL |
|
160 | - */ |
|
157 | + * Get the url to this item |
|
158 | + * |
|
159 | + * @return string URL |
|
160 | + */ |
|
161 | 161 | public function get_url() |
162 | 162 | { |
163 | 163 | global $phpbb_admin_path; |
@@ -166,23 +166,23 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
169 | - * Users needed to query before this notification can be displayed |
|
170 | - * |
|
171 | - * @return array Array of user_ids |
|
172 | - */ |
|
169 | + * Users needed to query before this notification can be displayed |
|
170 | + * |
|
171 | + * @return array Array of user_ids |
|
172 | + */ |
|
173 | 173 | public function users_to_query() |
174 | 174 | { |
175 | 175 | return array($this->get_data('user_from')); |
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | - * Function for preparing the data for insertion in an SQL query |
|
180 | - * (The service handles insertion) |
|
181 | - * |
|
182 | - * @param array $data Data from submit link |
|
183 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
184 | - * @return array Array of data ready to be inserted into the database |
|
185 | - */ |
|
179 | + * Function for preparing the data for insertion in an SQL query |
|
180 | + * (The service handles insertion) |
|
181 | + * |
|
182 | + * @param array $data Data from submit link |
|
183 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
184 | + * @return array Array of data ready to be inserted into the database |
|
185 | + */ |
|
186 | 186 | public function create_insert_array($data, $pre_create_data = array()) |
187 | 187 | { |
188 | 188 | $this->set_data('user_from', $data['user_from']); |
@@ -16,32 +16,32 @@ |
||
16 | 16 | protected $db; |
17 | 17 | |
18 | 18 | /** |
19 | - * Constructor |
|
20 | - * |
|
21 | - * @param \phpbb\db\driver\driver_interface $db |
|
22 | - */ |
|
19 | + * Constructor |
|
20 | + * |
|
21 | + * @param \phpbb\db\driver\driver_interface $db |
|
22 | + */ |
|
23 | 23 | public function __construct(\phpbb\db\driver\driver_interface $db) |
24 | 24 | { |
25 | 25 | $this->db = $db; |
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first |
|
30 | - * |
|
31 | - * @param array $keywords_ary contains each words to search |
|
32 | - * @param string $fields contains either titleonly (link titles should be searched), desconly (only description bodies should be searched) |
|
33 | - * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) |
|
34 | - * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query |
|
35 | - * @param string $sort_key is the key of $sort_by_sql for the selected sorting |
|
36 | - * @param string $sort_dir is either a or d representing ASC and DESC |
|
37 | - * @param string $sort_days specifies the maximum amount of days a post may be old |
|
38 | - * @param array $ex_cid_ary specifies an array of category ids which should not be searched |
|
39 | - * @param int $cat_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched |
|
40 | - * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered |
|
41 | - * @param int $start indicates the first index of the page |
|
42 | - * @param int $per_page number of ids each page is supposed to contain |
|
43 | - * @return int total number of results |
|
44 | - */ |
|
29 | + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first |
|
30 | + * |
|
31 | + * @param array $keywords_ary contains each words to search |
|
32 | + * @param string $fields contains either titleonly (link titles should be searched), desconly (only description bodies should be searched) |
|
33 | + * @param string $terms is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) |
|
34 | + * @param array $sort_by_sql contains SQL code for the ORDER BY part of a query |
|
35 | + * @param string $sort_key is the key of $sort_by_sql for the selected sorting |
|
36 | + * @param string $sort_dir is either a or d representing ASC and DESC |
|
37 | + * @param string $sort_days specifies the maximum amount of days a post may be old |
|
38 | + * @param array $ex_cid_ary specifies an array of category ids which should not be searched |
|
39 | + * @param int $cat_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched |
|
40 | + * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered |
|
41 | + * @param int $start indicates the first index of the page |
|
42 | + * @param int $per_page number of ids each page is supposed to contain |
|
43 | + * @return int total number of results |
|
44 | + */ |
|
45 | 45 | public function keyword_search($keywords_ary, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_cid_ary, $cat_id, &$id_ary, $start, $per_page) |
46 | 46 | { |
47 | 47 | $matches = array(); |
@@ -67,20 +67,20 @@ discard block |
||
67 | 67 | $match_search_query = ''; |
68 | 68 | foreach ($matches as $match) |
69 | 69 | { |
70 | - $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') '; |
|
71 | - $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . strtolower($word) . $this->db->get_any_char())); |
|
70 | + $match_search_query .= (($match_search_query) ? ' OR ' : '').'LOWER('.$match.') '; |
|
71 | + $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char().strtolower($word).$this->db->get_any_char())); |
|
72 | 72 | } |
73 | - $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')'; |
|
73 | + $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')).'('.$match_search_query.')'; |
|
74 | 74 | } |
75 | 75 | $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
76 | 76 | |
77 | 77 | if (is_array($sort_by_sql[$sort_key])) |
78 | 78 | { |
79 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
79 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
80 | 80 | } |
81 | 81 | else |
82 | 82 | { |
83 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
83 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $sql_array = array( |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | 'FROM' => array( |
89 | 89 | DIR_LINK_TABLE => 'l'), |
90 | 90 | 'WHERE' => 'l.link_active = 1 |
91 | - ' . (($search_query) ? 'AND (' . $search_query . ')' : '') . ' |
|
92 | - ' . (sizeof($ex_cid_ary) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '') . ' |
|
93 | - ' . (($cat_id) ? ' AND ' . $this->db->sql_in_set('l.link_cat', $cat_id) : '') . ' |
|
94 | - ' . (($sort_days) ? ' AND l.link_time >= ' . (time() - ($sort_days * 86400)) : ''), |
|
91 | + ' . (($search_query) ? 'AND ('.$search_query.')' : '').' |
|
92 | + ' . (sizeof($ex_cid_ary) ? ' AND '.$this->db->sql_in_set('l.link_cat', $ex_cid_ary, true) : '').' |
|
93 | + ' . (($cat_id) ? ' AND '.$this->db->sql_in_set('l.link_cat', $cat_id) : '').' |
|
94 | + ' . (($sort_days) ? ' AND l.link_time >= '.(time() - ($sort_days * 86400)) : ''), |
|
95 | 95 | 'ORDER_BY' => $sql_sort_order |
96 | 96 | ); |
97 | 97 |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | class directory_website_disapproved extends \phpbb\notification\type\base |
19 | 19 | { |
20 | 20 | /** |
21 | - * Get notification type name |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
21 | + * Get notification type name |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | 25 | public function get_type() |
26 | 26 | { |
27 | 27 | return 'ernadoo.phpbbdirectory.notification.type.directory_website_disapproved'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Notification option data (for outputting to the user) |
|
32 | - * |
|
33 | - * @var bool|array False if the service should use it's default data |
|
34 | - * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | - */ |
|
31 | + * Notification option data (for outputting to the user) |
|
32 | + * |
|
33 | + * @var bool|array False if the service should use it's default data |
|
34 | + * Array of data (including keys 'id', 'lang', and 'group') |
|
35 | + */ |
|
36 | 36 | public static $notification_option = array( |
37 | 37 | 'id' => 'dir_moderation_queue', |
38 | 38 | 'lang' => 'NOTIFICATION_TYPE_DIR_UCP_MODERATION_QUEUE', |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | ); |
41 | 41 | |
42 | 42 | /** |
43 | - * Permission to check for (in find_users_for_notification) |
|
44 | - * |
|
45 | - * @var string Permission name |
|
46 | - */ |
|
43 | + * Permission to check for (in find_users_for_notification) |
|
44 | + * |
|
45 | + * @var string Permission name |
|
46 | + */ |
|
47 | 47 | protected $permission = array('a_', 'm_'); |
48 | 48 | |
49 | 49 | /** |
50 | - * Is available |
|
51 | - * |
|
52 | - * @return bool True/False whether or not this is available to the user |
|
53 | - */ |
|
50 | + * Is available |
|
51 | + * |
|
52 | + * @return bool True/False whether or not this is available to the user |
|
53 | + */ |
|
54 | 54 | public function is_available() |
55 | 55 | { |
56 | 56 | $has_permission = $this->auth->acl_gets($this->permission, true); |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Get link id |
|
63 | - * |
|
64 | - * @param array $data The data from the link |
|
65 | - * @return int |
|
66 | - */ |
|
62 | + * Get link id |
|
63 | + * |
|
64 | + * @param array $data The data from the link |
|
65 | + * @return int |
|
66 | + */ |
|
67 | 67 | static public function get_item_id($data) |
68 | 68 | { |
69 | 69 | return (int) $data['link_id']; |
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Get parent id - it's not used |
|
74 | - * |
|
75 | - * @param array $data The data from the link |
|
76 | - */ |
|
73 | + * Get parent id - it's not used |
|
74 | + * |
|
75 | + * @param array $data The data from the link |
|
76 | + */ |
|
77 | 77 | static public function get_item_parent_id($data) |
78 | 78 | { |
79 | 79 | // No parent |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Find the users who want to receive notifications |
|
85 | - * |
|
86 | - * @param array $data Data from submit link |
|
87 | - * @param array $options Options for finding users for notification |
|
88 | - * @return array |
|
89 | - */ |
|
84 | + * Find the users who want to receive notifications |
|
85 | + * |
|
86 | + * @param array $data Data from submit link |
|
87 | + * @param array $options Options for finding users for notification |
|
88 | + * @return array |
|
89 | + */ |
|
90 | 90 | public function find_users_for_notification($data, $options = array()) |
91 | 91 | { |
92 | 92 | $options = array_merge(array( |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Get the HTML formatted title of this notification |
|
107 | - * |
|
108 | - * @return string |
|
109 | - */ |
|
106 | + * Get the HTML formatted title of this notification |
|
107 | + * |
|
108 | + * @return string |
|
109 | + */ |
|
110 | 110 | public function get_title() |
111 | 111 | { |
112 | 112 | $link_name = $this->get_data('link_name'); |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Get email template |
|
120 | - * |
|
121 | - * @return string |
|
122 | - */ |
|
119 | + * Get email template |
|
120 | + * |
|
121 | + * @return string |
|
122 | + */ |
|
123 | 123 | public function get_email_template() |
124 | 124 | { |
125 | 125 | return '@ernadoo_phpbbdirectory/directory_website_disapproved'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
129 | - * Get email template variables |
|
130 | - * |
|
131 | - * @return array |
|
132 | - */ |
|
129 | + * Get email template variables |
|
130 | + * |
|
131 | + * @return array |
|
132 | + */ |
|
133 | 133 | public function get_email_template_variables() |
134 | 134 | { |
135 | 135 | return array( |
@@ -138,33 +138,33 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Get the url to this item |
|
142 | - * |
|
143 | - * @return string URL |
|
144 | - */ |
|
141 | + * Get the url to this item |
|
142 | + * |
|
143 | + * @return string URL |
|
144 | + */ |
|
145 | 145 | public function get_url() |
146 | 146 | { |
147 | 147 | return ''; |
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | - * Users needed to query before this notification can be displayed |
|
152 | - * |
|
153 | - * @return array Array of user_ids |
|
154 | - */ |
|
151 | + * Users needed to query before this notification can be displayed |
|
152 | + * |
|
153 | + * @return array Array of user_ids |
|
154 | + */ |
|
155 | 155 | public function users_to_query() |
156 | 156 | { |
157 | 157 | return array(); |
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
161 | - * Function for preparing the data for insertion in an SQL query |
|
162 | - * (The service handles insertion) |
|
163 | - * |
|
164 | - * @param array $data Data from submit link |
|
165 | - * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | - * @return array Array of data ready to be inserted into the database |
|
167 | - */ |
|
161 | + * Function for preparing the data for insertion in an SQL query |
|
162 | + * (The service handles insertion) |
|
163 | + * |
|
164 | + * @param array $data Data from submit link |
|
165 | + * @param array $pre_create_data Data from pre_create_insert_array() |
|
166 | + * @return array Array of data ready to be inserted into the database |
|
167 | + */ |
|
168 | 168 | public function create_insert_array($data, $pre_create_data = array()) |
169 | 169 | { |
170 | 170 | $this->set_data('link_name', $data['link_name']); |
@@ -142,7 +142,7 @@ |
||
142 | 142 | */ |
143 | 143 | public function get_url() |
144 | 144 | { |
145 | - return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
145 | + return append_sid($this->phpbb_root_path.'directory/categorie/'.(int) $this->get_data('cat_id')); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | private $update; |
68 | 68 | |
69 | 69 | /** |
70 | - * Constructor |
|
71 | - * |
|
72 | - * @param \phpbb\cache\service $cache Cache object |
|
73 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | - * @param \phpbb\controller\helper $helper Helper object |
|
75 | - * @param \phpbb\log\log $log Log object |
|
76 | - * @param \phpbb\request\request $request Request object |
|
77 | - * @param \phpbb\template\template $template Template object |
|
78 | - * @param \phpbb\user $user User object |
|
79 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
80 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
81 | - * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
82 | - */ |
|
70 | + * Constructor |
|
71 | + * |
|
72 | + * @param \phpbb\cache\service $cache Cache object |
|
73 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | + * @param \phpbb\controller\helper $helper Helper object |
|
75 | + * @param \phpbb\log\log $log Log object |
|
76 | + * @param \phpbb\request\request $request Request object |
|
77 | + * @param \phpbb\template\template $template Template object |
|
78 | + * @param \phpbb\user $user User object |
|
79 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
80 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
81 | + * @param \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category PhpBB Directory extension nestedset object |
|
82 | + */ |
|
83 | 83 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
84 | 84 | { |
85 | 85 | $this->cache = $cache; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Initialize defaults data for add page |
|
107 | - * |
|
108 | - * @return null |
|
109 | - */ |
|
106 | + * Initialize defaults data for add page |
|
107 | + * |
|
108 | + * @return null |
|
109 | + */ |
|
110 | 110 | public function action_add() |
111 | 111 | { |
112 | 112 | $this->cat_id = $this->parent_id; |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * Display deleting page |
|
144 | - * |
|
145 | - * @return null |
|
146 | - */ |
|
143 | + * Display deleting page |
|
144 | + * |
|
145 | + * @return null |
|
146 | + */ |
|
147 | 147 | public function action_delete() |
148 | 148 | { |
149 | 149 | if (!$this->cat_id) |
@@ -194,10 +194,10 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
197 | - * Initialize data for edit page |
|
198 | - * |
|
199 | - * @return null |
|
200 | - */ |
|
197 | + * Initialize data for edit page |
|
198 | + * |
|
199 | + * @return null |
|
200 | + */ |
|
201 | 201 | public function action_edit() |
202 | 202 | { |
203 | 203 | $row = $this->_get_cat_info($this->cat_id); |
@@ -224,10 +224,10 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
227 | - * Move order categories |
|
228 | - * |
|
229 | - * @return null |
|
230 | - */ |
|
227 | + * Move order categories |
|
228 | + * |
|
229 | + * @return null |
|
230 | + */ |
|
231 | 231 | public function action_move() |
232 | 232 | { |
233 | 233 | if (!$this->cat_id) |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
273 | - * Display progress bar for syncinc categories |
|
274 | - * |
|
275 | - * @return null |
|
276 | - */ |
|
273 | + * Display progress bar for syncinc categories |
|
274 | + * |
|
275 | + * @return null |
|
276 | + */ |
|
277 | 277 | public function action_progress_bar() |
278 | 278 | { |
279 | 279 | $start = $this->request->variable('start', 0); |
@@ -294,10 +294,10 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
297 | - * Get link's ID interval for _sync_dir_links() |
|
298 | - * |
|
299 | - * @return null |
|
300 | - */ |
|
297 | + * Get link's ID interval for _sync_dir_links() |
|
298 | + * |
|
299 | + * @return null |
|
300 | + */ |
|
301 | 301 | public function action_sync() |
302 | 302 | { |
303 | 303 | if (!$this->cat_id) |
@@ -381,10 +381,10 @@ discard block |
||
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
384 | - * Sync category data |
|
385 | - * |
|
386 | - * @return null |
|
387 | - */ |
|
384 | + * Sync category data |
|
385 | + * |
|
386 | + * @return null |
|
387 | + */ |
|
388 | 388 | public function action_sync_cat() |
389 | 389 | { |
390 | 390 | $sql = 'SELECT cat_name |
@@ -408,10 +408,10 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | /** |
411 | - * Display categories page |
|
412 | - * |
|
413 | - * @return null |
|
414 | - */ |
|
411 | + * Display categories page |
|
412 | + * |
|
413 | + * @return null |
|
414 | + */ |
|
415 | 415 | public function display_cats() |
416 | 416 | { |
417 | 417 | // Default management page |
@@ -506,22 +506,22 @@ discard block |
||
506 | 506 | } |
507 | 507 | |
508 | 508 | /** |
509 | - * Set page url |
|
510 | - * |
|
511 | - * @param string $u_action Custom form action |
|
512 | - * @return null |
|
513 | - * @access public |
|
514 | - */ |
|
509 | + * Set page url |
|
510 | + * |
|
511 | + * @param string $u_action Custom form action |
|
512 | + * @return null |
|
513 | + * @access public |
|
514 | + */ |
|
515 | 515 | public function set_page_url($u_action) |
516 | 516 | { |
517 | 517 | $this->u_action = $u_action; |
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
521 | - * Update cat table |
|
522 | - * |
|
523 | - * @return null |
|
524 | - */ |
|
521 | + * Update cat table |
|
522 | + * |
|
523 | + * @return null |
|
524 | + */ |
|
525 | 525 | public function update() |
526 | 526 | { |
527 | 527 | if (!check_form_key($this->form_key)) |
@@ -615,11 +615,11 @@ discard block |
||
615 | 615 | } |
616 | 616 | |
617 | 617 | /** |
618 | - * Display form |
|
619 | - * |
|
620 | - * @param string $parents_list Drop-down list |
|
621 | - * @return null |
|
622 | - */ |
|
618 | + * Display form |
|
619 | + * |
|
620 | + * @param string $parents_list Drop-down list |
|
621 | + * @return null |
|
622 | + */ |
|
623 | 623 | private function _display_cat_form($parents_list) |
624 | 624 | { |
625 | 625 | $dir_cat_desc_data = array( |
@@ -689,11 +689,11 @@ discard block |
||
689 | 689 | } |
690 | 690 | |
691 | 691 | /** |
692 | - * Get category details |
|
693 | - * |
|
694 | - * @param int $cat_id The category ID |
|
695 | - * @return array |
|
696 | - */ |
|
692 | + * Get category details |
|
693 | + * |
|
694 | + * @param int $cat_id The category ID |
|
695 | + * @return array |
|
696 | + */ |
|
697 | 697 | private function _get_cat_info($cat_id) |
698 | 698 | { |
699 | 699 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
@@ -712,10 +712,10 @@ discard block |
||
712 | 712 | } |
713 | 713 | |
714 | 714 | /** |
715 | - * Update category data |
|
716 | - * |
|
717 | - * @return array |
|
718 | - */ |
|
715 | + * Update category data |
|
716 | + * |
|
717 | + * @return array |
|
718 | + */ |
|
719 | 719 | private function _update_cat_data() |
720 | 720 | { |
721 | 721 | if (!$this->cat_data['cat_name']) |
@@ -809,14 +809,14 @@ discard block |
||
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
812 | - * Remove complete category |
|
813 | - * |
|
814 | - * @param string $action_links Action for categories links |
|
815 | - * @param string $action_subcats Action for sub-categories |
|
816 | - * @param int $links_to_id New category ID for links |
|
817 | - * @param int $subcats_to_id New category ID for sub-categories |
|
818 | - * @return array |
|
819 | - */ |
|
812 | + * Remove complete category |
|
813 | + * |
|
814 | + * @param string $action_links Action for categories links |
|
815 | + * @param string $action_subcats Action for sub-categories |
|
816 | + * @param int $links_to_id New category ID for links |
|
817 | + * @param int $subcats_to_id New category ID for sub-categories |
|
818 | + * @return array |
|
819 | + */ |
|
820 | 820 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0) |
821 | 821 | { |
822 | 822 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -933,12 +933,12 @@ discard block |
||
933 | 933 | } |
934 | 934 | |
935 | 935 | /** |
936 | - * Move category content from one to another forum |
|
937 | - * |
|
938 | - * @param int $from_id |
|
939 | - * @param int $to_id |
|
940 | - * @return null |
|
941 | - */ |
|
936 | + * Move category content from one to another forum |
|
937 | + * |
|
938 | + * @param int $from_id |
|
939 | + * @param int $to_id |
|
940 | + * @return null |
|
941 | + */ |
|
942 | 942 | private function _move_cat_content($from_id, $to_id) |
943 | 943 | { |
944 | 944 | $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
@@ -954,10 +954,10 @@ discard block |
||
954 | 954 | } |
955 | 955 | |
956 | 956 | /** |
957 | - * Delete category content |
|
958 | - * |
|
959 | - * @return array |
|
960 | - */ |
|
957 | + * Delete category content |
|
958 | + * |
|
959 | + * @return array |
|
960 | + */ |
|
961 | 961 | private function _delete_cat_content() |
962 | 962 | { |
963 | 963 | $this->db->sql_transaction('begin'); |
@@ -1016,11 +1016,11 @@ discard block |
||
1016 | 1016 | } |
1017 | 1017 | |
1018 | 1018 | /** |
1019 | - * Update links counter |
|
1020 | - * |
|
1021 | - * @param int $cat_id The category ID |
|
1022 | - * @return null |
|
1023 | - */ |
|
1019 | + * Update links counter |
|
1020 | + * |
|
1021 | + * @param int $cat_id The category ID |
|
1022 | + * @return null |
|
1023 | + */ |
|
1024 | 1024 | private function _sync_dir_cat($cat_id) |
1025 | 1025 | { |
1026 | 1026 | $sql = 'SELECT COUNT(link_id) AS num_links |
@@ -1038,12 +1038,12 @@ discard block |
||
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | /** |
1041 | - * Update link data (note, vote, comment) |
|
1042 | - * |
|
1043 | - * @param int $start |
|
1044 | - * @param int $stop |
|
1045 | - * @return null |
|
1046 | - */ |
|
1041 | + * Update link data (note, vote, comment) |
|
1042 | + * |
|
1043 | + * @param int $start |
|
1044 | + * @param int $stop |
|
1045 | + * @return null |
|
1046 | + */ |
|
1047 | 1047 | private function _sync_dir_links($start, $stop) |
1048 | 1048 | { |
1049 | 1049 | $sql_ary = array( |
@@ -1086,12 +1086,12 @@ discard block |
||
1086 | 1086 | } |
1087 | 1087 | |
1088 | 1088 | /** |
1089 | - * Display icons drop-down list |
|
1090 | - * |
|
1091 | - * @param string $icons_path |
|
1092 | - * @param string $img_selected |
|
1093 | - * @return string |
|
1094 | - */ |
|
1089 | + * Display icons drop-down list |
|
1090 | + * |
|
1091 | + * @param string $icons_path |
|
1092 | + * @param string $img_selected |
|
1093 | + * @return string |
|
1094 | + */ |
|
1095 | 1095 | private function _get_dir_icon_list($icons_path, $img_selected) |
1096 | 1096 | { |
1097 | 1097 | $imglist = filelist($icons_path, ''); |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
84 | 84 | { |
85 | - $this->cache = $cache; |
|
86 | - $this->db = $db; |
|
87 | - $this->helper = $helper; |
|
85 | + $this->cache = $cache; |
|
86 | + $this->db = $db; |
|
87 | + $this->helper = $helper; |
|
88 | 88 | $this->phpbb_log = $log; |
89 | - $this->request = $request; |
|
89 | + $this->request = $request; |
|
90 | 90 | $this->template = $template; |
91 | - $this->user = $user; |
|
91 | + $this->user = $user; |
|
92 | 92 | $this->categorie = $categorie; |
93 | - $this->dir_helper = $dir_helper; |
|
94 | - $this->nestedset_category = $nestedset_category; |
|
93 | + $this->dir_helper = $dir_helper; |
|
94 | + $this->nestedset_category = $nestedset_category; |
|
95 | 95 | |
96 | 96 | $this->form_key = 'acp_dir_cat'; |
97 | 97 | add_form_key($this->form_key); |
98 | 98 | |
99 | 99 | $this->action = $this->request->variable('action', ''); |
100 | 100 | $this->cat_id = $request->variable('c', 0); |
101 | - $this->parent_id = $request->variable('parent_id', 0); |
|
101 | + $this->parent_id = $request->variable('parent_id', 0); |
|
102 | 102 | $this->update = ($this->request->is_set_post('update')) ? true : false; |
103 | 103 | } |
104 | 104 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | if (!$this->cat_id) |
150 | 150 | { |
151 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
151 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id); |
165 | 165 | |
166 | 166 | $sql = 'SELECT cat_id |
167 | - FROM ' . DIR_CAT_TABLE . ' |
|
167 | + FROM ' . DIR_CAT_TABLE.' |
|
168 | 168 | WHERE cat_id <> ' . (int) $this->cat_id; |
169 | 169 | $result = $this->db->sql_query_limit($sql, 1); |
170 | 170 | |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | |
181 | 181 | $this->template->assign_vars(array( |
182 | 182 | 'S_DELETE_DIR_CAT' => true, |
183 | - 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
184 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
183 | + 'U_ACTION' => $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
184 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
185 | 185 | |
186 | 186 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'], |
187 | 187 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false, |
@@ -232,11 +232,11 @@ discard block |
||
232 | 232 | { |
233 | 233 | if (!$this->cat_id) |
234 | 234 | { |
235 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
235 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
239 | - FROM ' . DIR_CAT_TABLE . ' |
|
239 | + FROM ' . DIR_CAT_TABLE.' |
|
240 | 240 | WHERE cat_id = ' . (int) $this->cat_id; |
241 | 241 | $result = $this->db->sql_query($sql); |
242 | 242 | $row = $this->db->sql_fetchrow($result); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | if (!$row) |
246 | 246 | { |
247 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
247 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | try |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | if ($move_cat_name !== false) |
260 | 260 | { |
261 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
261 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name)); |
|
262 | 262 | $this->cache->destroy('sql', DIR_CAT_TABLE); |
263 | 263 | } |
264 | 264 | |
@@ -302,13 +302,13 @@ discard block |
||
302 | 302 | { |
303 | 303 | if (!$this->cat_id) |
304 | 304 | { |
305 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
305 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | @set_time_limit(0); |
309 | 309 | |
310 | 310 | $sql = 'SELECT cat_name, cat_links |
311 | - FROM ' . DIR_CAT_TABLE . ' |
|
311 | + FROM ' . DIR_CAT_TABLE.' |
|
312 | 312 | WHERE cat_id = ' . (int) $this->cat_id; |
313 | 313 | $result = $this->db->sql_query($sql); |
314 | 314 | $row = $this->db->sql_fetchrow($result); |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | |
317 | 317 | if (!$row) |
318 | 318 | { |
319 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
319 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id |
323 | - FROM ' . DIR_LINK_TABLE . ' |
|
324 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
323 | + FROM ' . DIR_LINK_TABLE.' |
|
324 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
325 | 325 | AND link_active = 1'; |
326 | 326 | $result = $this->db->sql_query($sql); |
327 | 327 | $row2 = $this->db->sql_fetchrow($result); |
@@ -343,23 +343,23 @@ discard block |
||
343 | 343 | { |
344 | 344 | // We really need to find a way of showing statistics... no progress here |
345 | 345 | $sql = 'SELECT COUNT(link_id) as num_links |
346 | - FROM ' . DIR_LINK_TABLE . ' |
|
347 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
346 | + FROM ' . DIR_LINK_TABLE.' |
|
347 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
348 | 348 | AND link_active = 1 |
349 | - AND link_id BETWEEN ' . $start . ' AND ' . $end; |
|
349 | + AND link_id BETWEEN ' . $start.' AND '.$end; |
|
350 | 350 | $result = $this->db->sql_query($sql); |
351 | 351 | $links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); |
352 | 352 | $this->db->sql_freeresult($result); |
353 | 353 | |
354 | 354 | $start += $batch_size; |
355 | 355 | |
356 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
356 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
357 | 357 | |
358 | 358 | meta_refresh(0, $url); |
359 | 359 | |
360 | 360 | $this->template->assign_vars(array( |
361 | - 'U_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
362 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}"), |
|
361 | + 'U_PROGRESS_BAR' => $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
362 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}"), |
|
363 | 363 | 'S_CONTINUE_SYNC' => true, |
364 | 364 | 'L_PROGRESS_EXPLAIN' => $this->user->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links'])) |
365 | 365 | ); |
@@ -367,12 +367,12 @@ discard block |
||
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
370 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
370 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
371 | 371 | meta_refresh(0, $url); |
372 | 372 | |
373 | 373 | $this->template->assign_vars(array( |
374 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
375 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
374 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
375 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
376 | 376 | 'S_CONTINUE_SYNC' => true, |
377 | 377 | 'L_PROGRESS_EXPLAIN' => $this->user->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) |
378 | 378 | ); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | public function action_sync_cat() |
389 | 389 | { |
390 | 390 | $sql = 'SELECT cat_name |
391 | - FROM ' . DIR_CAT_TABLE . ' |
|
391 | + FROM ' . DIR_CAT_TABLE.' |
|
392 | 392 | WHERE cat_id = ' . (int) $this->cat_id; |
393 | 393 | $result = $this->db->sql_query($sql); |
394 | 394 | $row = $this->db->sql_fetchrow($result); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | if (!$row) |
398 | 398 | { |
399 | - trigger_error($this->user->lang['DIR_NO_CAT'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
399 | + trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | $this->_sync_dir_cat($this->cat_id); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | } |
422 | 422 | else |
423 | 423 | { |
424 | - $navigation = '<a href="' . $this->u_action . '">' . $this->user->lang['DIR_INDEX'] . '</a>'; |
|
424 | + $navigation = '<a href="'.$this->u_action.'">'.$this->user->lang['DIR_INDEX'].'</a>'; |
|
425 | 425 | |
426 | 426 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id); |
427 | 427 | |
@@ -429,11 +429,11 @@ discard block |
||
429 | 429 | { |
430 | 430 | if ($row['cat_id'] == $this->parent_id) |
431 | 431 | { |
432 | - $navigation .= ' -> ' . $row['cat_name']; |
|
432 | + $navigation .= ' -> '.$row['cat_name']; |
|
433 | 433 | } |
434 | 434 | else |
435 | 435 | { |
436 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>'; |
|
436 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>'; |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | } |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links |
450 | - FROM ' . DIR_CAT_TABLE . ' |
|
451 | - WHERE parent_id = ' . (int) $this->parent_id . ' |
|
450 | + FROM ' . DIR_CAT_TABLE.' |
|
451 | + WHERE parent_id = ' . (int) $this->parent_id.' |
|
452 | 452 | ORDER BY left_id'; |
453 | 453 | $result = $this->db->sql_query($sql); |
454 | 454 | |
@@ -456,23 +456,23 @@ discard block |
||
456 | 456 | { |
457 | 457 | do |
458 | 458 | { |
459 | - $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->user->lang['DIR_SUBCAT'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->user->lang['FOLDER'] . '" />'; |
|
459 | + $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->user->lang['DIR_SUBCAT'].'" />' : '<img src="images/icon_folder.gif" alt="'.$this->user->lang['FOLDER'].'" />'; |
|
460 | 460 | |
461 | - $url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
461 | + $url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
462 | 462 | |
463 | 463 | $this->template->assign_block_vars('cats', array( |
464 | 464 | 'FOLDER_IMAGE' => $folder_image, |
465 | - 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="' . $this->dir_helper->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', |
|
465 | + 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="'.$this->dir_helper->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', |
|
466 | 466 | 'CAT_NAME' => $row['cat_name'], |
467 | 467 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']), |
468 | 468 | 'CAT_LINKS' => $row['cat_links'], |
469 | 469 | |
470 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'], |
|
471 | - 'U_MOVE_UP' => $url . '&action=move_up', |
|
472 | - 'U_MOVE_DOWN' => $url . '&action=move_down', |
|
473 | - 'U_EDIT' => $url . '&action=edit', |
|
474 | - 'U_DELETE' => $url . '&action=delete', |
|
475 | - 'U_SYNC' => $url . '&action=sync') |
|
470 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'], |
|
471 | + 'U_MOVE_UP' => $url.'&action=move_up', |
|
472 | + 'U_MOVE_DOWN' => $url.'&action=move_down', |
|
473 | + 'U_EDIT' => $url.'&action=edit', |
|
474 | + 'U_DELETE' => $url.'&action=delete', |
|
475 | + 'U_SYNC' => $url.'&action=sync') |
|
476 | 476 | ); |
477 | 477 | } |
478 | 478 | while ($row = $this->db->sql_fetchrow($result)); |
@@ -481,14 +481,14 @@ discard block |
||
481 | 481 | { |
482 | 482 | $row = $this->_get_cat_info($this->parent_id); |
483 | 483 | |
484 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id']; |
|
484 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id']; |
|
485 | 485 | |
486 | 486 | $this->template->assign_vars(array( |
487 | 487 | 'S_NO_CATS' => true, |
488 | 488 | |
489 | - 'U_EDIT' => $url . '&action=edit', |
|
490 | - 'U_DELETE' => $url . '&action=delete', |
|
491 | - 'U_SYNC' => $url . '&action=sync') |
|
489 | + 'U_EDIT' => $url.'&action=edit', |
|
490 | + 'U_DELETE' => $url.'&action=delete', |
|
491 | + 'U_SYNC' => $url.'&action=sync') |
|
492 | 492 | ); |
493 | 493 | } |
494 | 494 | $this->db->sql_freeresult($result); |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | 'NAVIGATION' => $navigation, |
499 | 499 | 'CAT_BOX' => $cat_box, |
500 | 500 | 'U_SEL_ACTION' => $this->u_action, |
501 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
501 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id, |
|
502 | 502 | |
503 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
504 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
503 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
504 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
505 | 505 | )); |
506 | 506 | } |
507 | 507 | |
@@ -533,10 +533,10 @@ discard block |
||
533 | 533 | switch ($this->action) |
534 | 534 | { |
535 | 535 | case 'delete': |
536 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
537 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
538 | - $action_links = $this->request->variable('action_links', ''); |
|
539 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
536 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
537 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
538 | + $action_links = $this->request->variable('action_links', ''); |
|
539 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
540 | 540 | |
541 | 541 | try |
542 | 542 | { |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | $this->cache->destroy('sql', DIR_CAT_TABLE); |
556 | 556 | |
557 | - trigger_error($this->user->lang['DIR_CAT_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
557 | + trigger_error($this->user->lang['DIR_CAT_DELETED'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
558 | 558 | |
559 | 559 | break; |
560 | 560 | |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | |
608 | 608 | $message = ($this->action == 'add') ? $this->user->lang['DIR_CAT_CREATED'] : $this->user->lang['DIR_CAT_UPDATED']; |
609 | 609 | |
610 | - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
610 | + trigger_error($message.adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | break; |
@@ -652,10 +652,10 @@ discard block |
||
652 | 652 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'], |
653 | 653 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false, |
654 | 654 | |
655 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
656 | - 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
655 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
656 | + 'U_EDIT_ACTION' => $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
657 | 657 | |
658 | - 'L_TITLE' => $this->user->lang['DIR_' . strtoupper($this->action) . '_CAT'], |
|
658 | + 'L_TITLE' => $this->user->lang['DIR_'.strtoupper($this->action).'_CAT'], |
|
659 | 659 | 'ERROR_MSG' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', |
660 | 660 | 'ICON_IMAGE' => ($this->cat_data['cat_icon']) ? $this->dir_helper->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', |
661 | 661 | |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | private function _get_cat_info($cat_id) |
698 | 698 | { |
699 | 699 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next |
700 | - FROM ' . DIR_CAT_TABLE . ' |
|
700 | + FROM ' . DIR_CAT_TABLE.' |
|
701 | 701 | WHERE cat_id = ' . (int) $cat_id; |
702 | 702 | $result = $this->db->sql_query($sql); |
703 | 703 | $row = $this->db->sql_fetchrow($result); |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | { |
761 | 761 | if ($cat_data_sql['cat_cron_enable']) |
762 | 762 | { |
763 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
763 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
764 | 764 | } |
765 | 765 | |
766 | 766 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | |
784 | 784 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
785 | 785 | { |
786 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
786 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
787 | 787 | } |
788 | 788 | |
789 | 789 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
790 | 790 | { |
791 | 791 | // the cat name has changed, clear the parents list of all categories (for safety) |
792 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . " |
|
792 | + $sql = 'UPDATE '.DIR_CAT_TABLE." |
|
793 | 793 | SET cat_parents = ''"; |
794 | 794 | $this->db->sql_query($sql); |
795 | 795 | } |
@@ -797,8 +797,8 @@ discard block |
||
797 | 797 | // Setting the cat id to the categorie id is not really received well by some dbs. ;) |
798 | 798 | unset($cat_data_sql['cat_id']); |
799 | 799 | |
800 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
801 | - SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' |
|
800 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
801 | + SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' |
|
802 | 802 | WHERE cat_id = ' . (int) $this->cat_id; |
803 | 803 | $this->db->sql_query($sql); |
804 | 804 | |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | $log_action_links = 'MOVE_LINKS'; |
840 | 840 | |
841 | 841 | $sql = 'SELECT cat_name |
842 | - FROM ' . DIR_CAT_TABLE . ' |
|
842 | + FROM ' . DIR_CAT_TABLE.' |
|
843 | 843 | WHERE cat_id = ' . (int) $links_to_id; |
844 | 844 | $result = $this->db->sql_query($sql); |
845 | 845 | $row = $this->db->sql_fetchrow($result); |
@@ -941,12 +941,12 @@ discard block |
||
941 | 941 | */ |
942 | 942 | private function _move_cat_content($from_id, $to_id) |
943 | 943 | { |
944 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
945 | - SET link_cat = ' . (int) $to_id . ' |
|
944 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
945 | + SET link_cat = ' . (int) $to_id.' |
|
946 | 946 | WHERE link_cat = ' . (int) $from_id; |
947 | 947 | $this->db->sql_query($sql); |
948 | 948 | |
949 | - $sql = 'DELETE FROM ' . DIR_WATCH_TABLE . ' |
|
949 | + $sql = 'DELETE FROM '.DIR_WATCH_TABLE.' |
|
950 | 950 | WHERE cat_id = ' . (int) $from_id; |
951 | 951 | $this->db->sql_query($sql); |
952 | 952 | |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | |
965 | 965 | // Before we remove anything we make sure we are able to adjust the post counts later. ;) |
966 | 966 | $sql = 'SELECT link_id, link_banner |
967 | - FROM ' . DIR_LINK_TABLE . ' |
|
967 | + FROM ' . DIR_LINK_TABLE.' |
|
968 | 968 | WHERE link_cat = ' . (int) $this->cat_id; |
969 | 969 | $result = $this->db->sql_query($sql); |
970 | 970 | |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | |
996 | 996 | foreach ($link_datas_ary as $table => $field) |
997 | 997 | { |
998 | - $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); |
|
998 | + $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); |
|
999 | 999 | } |
1000 | 1000 | } |
1001 | 1001 | |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | |
1008 | 1008 | foreach ($cat_datas_ary as $table => $field) |
1009 | 1009 | { |
1010 | - $this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); |
|
1010 | + $this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); |
|
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | $this->db->sql_transaction('commit'); |
@@ -1024,15 +1024,15 @@ discard block |
||
1024 | 1024 | private function _sync_dir_cat($cat_id) |
1025 | 1025 | { |
1026 | 1026 | $sql = 'SELECT COUNT(link_id) AS num_links |
1027 | - FROM ' . DIR_LINK_TABLE . ' |
|
1028 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
1027 | + FROM ' . DIR_LINK_TABLE.' |
|
1028 | + WHERE link_cat = ' . (int) $cat_id.' |
|
1029 | 1029 | AND link_active = 1'; |
1030 | 1030 | $result = $this->db->sql_query($sql); |
1031 | 1031 | $total_links = (int) $this->db->sql_fetchfield('num_links'); |
1032 | 1032 | $this->db->sql_freeresult($result); |
1033 | 1033 | |
1034 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
1035 | - SET cat_links = ' . $total_links . ' |
|
1034 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
1035 | + SET cat_links = ' . $total_links.' |
|
1036 | 1036 | WHERE cat_id = ' . (int) $cat_id; |
1037 | 1037 | $this->db->sql_query($sql); |
1038 | 1038 | } |
@@ -1052,33 +1052,33 @@ discard block |
||
1052 | 1052 | 'link_vote' => 0, |
1053 | 1053 | ); |
1054 | 1054 | |
1055 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1056 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
1057 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop; |
|
1055 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1056 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
1057 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop; |
|
1058 | 1058 | $this->db->sql_query($sql); |
1059 | 1059 | |
1060 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . DIR_VOTE_TABLE . ' |
|
1061 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1060 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.DIR_VOTE_TABLE.' |
|
1061 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1062 | 1062 | GROUP BY vote_link_id'; |
1063 | 1063 | $result = $this->db->sql_query($sql); |
1064 | 1064 | while ($tmp = $this->db->sql_fetchrow($result)) |
1065 | 1065 | { |
1066 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1067 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . ' |
|
1066 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1067 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].' |
|
1068 | 1068 | WHERE link_id = ' . (int) $tmp['vote_link_id']; |
1069 | 1069 | $this->db->sql_query($sql); |
1070 | 1070 | } |
1071 | 1071 | $this->db->sql_freeresult($result); |
1072 | 1072 | |
1073 | 1073 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment |
1074 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
1075 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1074 | + FROM ' . DIR_COMMENT_TABLE.' |
|
1075 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1076 | 1076 | GROUP BY comment_link_id'; |
1077 | 1077 | $result = $this->db->sql_query($sql); |
1078 | 1078 | while ($tmp = $this->db->sql_fetchrow($result)) |
1079 | 1079 | { |
1080 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
1081 | - SET link_comment = ' . (int) $tmp['nb_comment'] . ' |
|
1080 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
1081 | + SET link_comment = ' . (int) $tmp['nb_comment'].' |
|
1082 | 1082 | WHERE link_id = ' . (int) $tmp['comment_link_id']; |
1083 | 1083 | $this->db->sql_query($sql); |
1084 | 1084 | } |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | |
1104 | 1104 | foreach ($img_ary as $img) |
1105 | 1105 | { |
1106 | - $img = $path . $img; |
|
1106 | + $img = $path.$img; |
|
1107 | 1107 | $selected = ''; |
1108 | 1108 | |
1109 | 1109 | if (strlen($img) > 255) |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | $selected = ' selected="selected"'; |
1117 | 1117 | } |
1118 | 1118 | |
1119 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; |
|
1119 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>'; |
|
1120 | 1120 | } |
1121 | 1121 | } |
1122 | 1122 |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | protected $u_action; |
32 | 32 | |
33 | 33 | /** |
34 | - * Constructor |
|
35 | - * |
|
36 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
37 | - * @param \phpbb\request\request $request Request object |
|
38 | - * @param \phpbb\template\template $template Template object |
|
39 | - * @param \phpbb\user $user User object |
|
40 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
41 | - */ |
|
34 | + * Constructor |
|
35 | + * |
|
36 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
37 | + * @param \phpbb\request\request $request Request object |
|
38 | + * @param \phpbb\template\template $template Template object |
|
39 | + * @param \phpbb\user $user User object |
|
40 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
41 | + */ |
|
42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
43 | 43 | { |
44 | 44 | $this->db = $db; |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Display confirm box |
|
53 | - * |
|
54 | - * @param string $action Requested action |
|
55 | - * @return null |
|
56 | - */ |
|
52 | + * Display confirm box |
|
53 | + * |
|
54 | + * @param string $action Requested action |
|
55 | + * @return null |
|
56 | + */ |
|
57 | 57 | public function display_confirm($action) |
58 | 58 | { |
59 | 59 | switch ($action) |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * Display phpBB Directory statistics |
|
95 | - * |
|
96 | - * @return null |
|
97 | - */ |
|
94 | + * Display phpBB Directory statistics |
|
95 | + * |
|
96 | + * @return null |
|
97 | + */ |
|
98 | 98 | public function display_stats() |
99 | 99 | { |
100 | 100 | // Count number of categories |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | - * Execute action requested |
|
185 | - * |
|
186 | - * @param string $action Requested action |
|
187 | - * @return null |
|
188 | - */ |
|
184 | + * Execute action requested |
|
185 | + * |
|
186 | + * @param string $action Requested action |
|
187 | + * @return null |
|
188 | + */ |
|
189 | 189 | public function exec_action($action) |
190 | 190 | { |
191 | 191 | switch ($action) |
@@ -260,23 +260,23 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
263 | - * Set page url |
|
264 | - * |
|
265 | - * @param string $u_action Custom form action |
|
266 | - * @return null |
|
267 | - * @access public |
|
268 | - */ |
|
263 | + * Set page url |
|
264 | + * |
|
265 | + * @param string $u_action Custom form action |
|
266 | + * @return null |
|
267 | + * @access public |
|
268 | + */ |
|
269 | 269 | public function set_page_url($u_action) |
270 | 270 | { |
271 | 271 | $this->u_action = $u_action; |
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
275 | - * Get orphan banners |
|
276 | - * |
|
277 | - * @param bool $delete True if we want to delete banners, else false |
|
278 | - * @return null|int Number of orphan files, else null |
|
279 | - */ |
|
275 | + * Get orphan banners |
|
276 | + * |
|
277 | + * @param bool $delete True if we want to delete banners, else false |
|
278 | + * @return null|int Number of orphan files, else null |
|
279 | + */ |
|
280 | 280 | private function _orphan_files($delete = false) |
281 | 281 | { |
282 | 282 | $banner_path = $this->dir_helper->get_banner_path(); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
43 | 43 | { |
44 | - $this->db = $db; |
|
45 | - $this->template = $template; |
|
46 | - $this->user = $user; |
|
47 | - $this->request = $request; |
|
48 | - $this->dir_helper = $dir_helper; |
|
44 | + $this->db = $db; |
|
45 | + $this->template = $template; |
|
46 | + $this->user = $user; |
|
47 | + $this->request = $request; |
|
48 | + $this->dir_helper = $dir_helper; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false) |
153 | 153 | { |
154 | - $banners_dir_size += filesize($banners_path . $file); |
|
154 | + $banners_dir_size += filesize($banners_path.$file); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | closedir($banners_dir); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | 'U_ACTION' => $this->u_action, |
171 | 171 | |
172 | 172 | 'TOTAL_CATS' => $total_cats, |
173 | - 'TOTAL_LINKS' => $total_links-$waiting_links, |
|
173 | + 'TOTAL_LINKS' => $total_links - $waiting_links, |
|
174 | 174 | 'WAITING_LINKS' => $waiting_links, |
175 | 175 | 'TOTAL_COMMENTS' => $total_comments, |
176 | 176 | 'TOTAL_VOTES' => $total_votes, |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | { |
196 | 196 | case 'sqlite': |
197 | 197 | case 'firebird': |
198 | - $this->db->sql_query('DELETE FROM ' . DIR_VOTE_TABLE); |
|
198 | + $this->db->sql_query('DELETE FROM '.DIR_VOTE_TABLE); |
|
199 | 199 | break; |
200 | 200 | |
201 | 201 | default: |
202 | - $this->db->sql_query('TRUNCATE TABLE ' . DIR_VOTE_TABLE); |
|
202 | + $this->db->sql_query('TRUNCATE TABLE '.DIR_VOTE_TABLE); |
|
203 | 203 | break; |
204 | 204 | } |
205 | 205 | |
206 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
206 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
207 | 207 | SET link_vote = 0, link_note = 0'; |
208 | 208 | $this->db->sql_query($sql); |
209 | 209 | |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | { |
219 | 219 | case 'sqlite': |
220 | 220 | case 'firebird': |
221 | - $this->db->sql_query('DELETE FROM ' . DIR_COMMENT_TABLE); |
|
221 | + $this->db->sql_query('DELETE FROM '.DIR_COMMENT_TABLE); |
|
222 | 222 | break; |
223 | 223 | |
224 | 224 | default: |
225 | - $this->db->sql_query('TRUNCATE TABLE ' . DIR_COMMENT_TABLE); |
|
225 | + $this->db->sql_query('TRUNCATE TABLE '.DIR_COMMENT_TABLE); |
|
226 | 226 | break; |
227 | 227 | } |
228 | 228 | |
229 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
229 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
230 | 230 | SET link_comment = 0'; |
231 | 231 | $this->db->sql_query($sql); |
232 | 232 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | break; |
239 | 239 | |
240 | 240 | case 'clicks': |
241 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
241 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
242 | 242 | SET link_view = 0'; |
243 | 243 | $this->db->sql_query($sql); |
244 | 244 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | $physical_files[] = $img; |
294 | 294 | } |
295 | - $sql = 'SELECT link_banner FROM ' . DIR_LINK_TABLE . ' |
|
295 | + $sql = 'SELECT link_banner FROM '.DIR_LINK_TABLE.' |
|
296 | 296 | WHERE link_banner <> \'\''; |
297 | 297 | $result = $this->db->sql_query($sql); |
298 | 298 |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | private $display_vars; |
38 | 38 | |
39 | 39 | /** |
40 | - * Constructor |
|
41 | - * |
|
42 | - * @param \phpbb\config\config $config Config object |
|
43 | - * @param \phpbb\log\log $log Log object |
|
44 | - * @param \phpbb\request\request $request Request object |
|
45 | - * @param \phpbb\template\template $template Template object |
|
46 | - * @param \phpbb\user $user User object |
|
47 | - */ |
|
40 | + * Constructor |
|
41 | + * |
|
42 | + * @param \phpbb\config\config $config Config object |
|
43 | + * @param \phpbb\log\log $log Log object |
|
44 | + * @param \phpbb\request\request $request Request object |
|
45 | + * @param \phpbb\template\template $template Template object |
|
46 | + * @param \phpbb\user $user User object |
|
47 | + */ |
|
48 | 48 | public function __construct(\phpbb\config\config $config, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
49 | 49 | { |
50 | 50 | $this->config = $config; |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Display config page |
|
61 | - * |
|
62 | - * @return null |
|
63 | - */ |
|
60 | + * Display config page |
|
61 | + * |
|
62 | + * @return null |
|
63 | + */ |
|
64 | 64 | public function display_config() |
65 | 65 | { |
66 | 66 | // Output relevant page |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Validate config vars and update config table if needed |
|
110 | - * |
|
111 | - * @return null |
|
112 | - */ |
|
109 | + * Validate config vars and update config table if needed |
|
110 | + * |
|
111 | + * @return null |
|
112 | + */ |
|
113 | 113 | public function process() |
114 | 114 | { |
115 | 115 | $submit = ($this->request->is_set_post('submit')) ? true : false; |
@@ -162,22 +162,22 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * Set page url |
|
166 | - * |
|
167 | - * @param string $u_action Custom form action |
|
168 | - * @return null |
|
169 | - * @access public |
|
170 | - */ |
|
165 | + * Set page url |
|
166 | + * |
|
167 | + * @param string $u_action Custom form action |
|
168 | + * @return null |
|
169 | + * @access public |
|
170 | + */ |
|
171 | 171 | public function set_page_url($u_action) |
172 | 172 | { |
173 | 173 | $this->u_action = $u_action; |
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
177 | - * Build config matrice |
|
178 | - * |
|
179 | - * @return null |
|
180 | - */ |
|
177 | + * Build config matrice |
|
178 | + * |
|
179 | + * @return null |
|
180 | + */ |
|
181 | 181 | private function _generate_config() |
182 | 182 | { |
183 | 183 | $this->display_vars = array( |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function __construct(\phpbb\config\config $config, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
49 | 49 | { |
50 | - $this->config = $config; |
|
51 | - $this->log = $log; |
|
52 | - $this->template = $template; |
|
53 | - $this->user = $user; |
|
54 | - $this->request = $request; |
|
50 | + $this->config = $config; |
|
51 | + $this->log = $log; |
|
52 | + $this->template = $template; |
|
53 | + $this->user = $user; |
|
54 | + $this->request = $request; |
|
55 | 55 | |
56 | 56 | $this->_generate_config(); |
57 | 57 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | else if ($vars['explain']) |
92 | 92 | { |
93 | - $l_explain = (isset($this->user->lang[$vars['lang'] . '_EXPLAIN'])) ? $this->user->lang[$vars['lang'] . '_EXPLAIN'] : ''; |
|
93 | + $l_explain = (isset($this->user->lang[$vars['lang'].'_EXPLAIN'])) ? $this->user->lang[$vars['lang'].'_EXPLAIN'] : ''; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $this->template->assign_block_vars('options', array( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function process() |
114 | 114 | { |
115 | - $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
115 | + $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
116 | 116 | |
117 | 117 | $this->new_config = $this->config; |
118 | 118 | $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | { |
154 | 154 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS'); |
155 | 155 | |
156 | - trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); |
|
156 | + trigger_error($this->user->lang['CONFIG_UPDATED'].adm_back_link($this->u_action)); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $this->template->assign_vars(array( |
160 | 160 | 'L_TITLE' => $this->user->lang[$this->display_vars['title']], |
161 | - 'L_TITLE_EXPLAIN' => $this->user->lang[$this->display_vars['title'] . '_EXPLAIN'], |
|
161 | + 'L_TITLE_EXPLAIN' => $this->user->lang[$this->display_vars['title'].'_EXPLAIN'], |
|
162 | 162 | |
163 | 163 | 'S_ERROR' => (sizeof($error)) ? true : false, |
164 | 164 | 'ERROR_MSG' => implode('<br />', $error), |
@@ -194,45 +194,45 @@ discard block |
||
194 | 194 | 'dir_banner_width' => '', |
195 | 195 | 'dir_banner_height' => '', |
196 | 196 | |
197 | - 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
198 | - 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
199 | - 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
200 | - 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
201 | - 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
202 | - 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
203 | - 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
204 | - 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
205 | - 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
197 | + 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
198 | + 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
199 | + 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
200 | + 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
201 | + 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
202 | + 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
203 | + 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
204 | + 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
205 | + 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
206 | 206 | |
207 | 207 | 'legend2' => 'DIR_RECENT_GUEST', |
208 | - 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
209 | - 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
210 | - 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
211 | - 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
208 | + 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
209 | + 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
210 | + 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
211 | + 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
212 | 212 | |
213 | 213 | 'legend3' => 'DIR_ADD_GUEST', |
214 | - 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
215 | - 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
214 | + 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
215 | + 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
216 | 216 | |
217 | 217 | 'legend4' => 'DIR_THUMB_PARAM', |
218 | - 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
219 | - 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | - 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
221 | - 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
218 | + 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
219 | + 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | + 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
221 | + 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
222 | 222 | |
223 | 223 | 'legend5' => 'DIR_COMM_PARAM', |
224 | - 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
225 | - 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
226 | - 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
227 | - 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
228 | - 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
229 | - 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
224 | + 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
225 | + 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
226 | + 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
227 | + 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
228 | + 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
229 | + 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
230 | 230 | |
231 | 231 | 'legend6' => 'DIR_BANN_PARAM', |
232 | - 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | - 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']), |
|
234 | - 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
235 | - 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
232 | + 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | + 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']), |
|
234 | + 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
235 | + 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
236 | 236 | ) |
237 | 237 | ); |
238 | 238 | } |
@@ -67,22 +67,22 @@ discard block |
||
67 | 67 | private $links_data; |
68 | 68 | |
69 | 69 | /** |
70 | - * Constructor |
|
71 | - * |
|
72 | - * @param \phpbb\config\config $config Config object |
|
73 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | - * @param \phpbb\pagination $pagination Pagination object |
|
75 | - * @param \phpbb\log\log $log Log object |
|
76 | - * @param \phpbb\notification\manager $notification Notification object |
|
77 | - * @param \phpbb\request\request $request Request object |
|
78 | - * @param \phpbb\template\template $template Template object |
|
79 | - * @param \phpbb\user $user User object |
|
80 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
81 | - * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
82 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
83 | - * @param string $root_path phpBB root path |
|
84 | - * @param string $php_ext phpEx |
|
85 | - */ |
|
70 | + * Constructor |
|
71 | + * |
|
72 | + * @param \phpbb\config\config $config Config object |
|
73 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
74 | + * @param \phpbb\pagination $pagination Pagination object |
|
75 | + * @param \phpbb\log\log $log Log object |
|
76 | + * @param \phpbb\notification\manager $notification Notification object |
|
77 | + * @param \phpbb\request\request $request Request object |
|
78 | + * @param \phpbb\template\template $template Template object |
|
79 | + * @param \phpbb\user $user User object |
|
80 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
81 | + * @param \ernadoo\phpbbdirectory\core\helper $dir_helper PhpBB Directory extension helper object |
|
82 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
83 | + * @param string $root_path phpBB root path |
|
84 | + * @param string $php_ext phpEx |
|
85 | + */ |
|
86 | 86 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
87 | 87 | { |
88 | 88 | $this->config = $config; |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Display confirm box |
|
107 | - * |
|
108 | - * @param array $mark Website selected for (dis)approval |
|
109 | - * @return null |
|
110 | - */ |
|
106 | + * Display confirm box |
|
107 | + * |
|
108 | + * @param array $mark Website selected for (dis)approval |
|
109 | + * @return null |
|
110 | + */ |
|
111 | 111 | public function display_confirm($mark) |
112 | 112 | { |
113 | 113 | $s_hidden_fields = array( |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * Display website list for (dis)approval |
|
123 | - * |
|
124 | - * @return null |
|
125 | - */ |
|
122 | + * Display website list for (dis)approval |
|
123 | + * |
|
124 | + * @return null |
|
125 | + */ |
|
126 | 126 | public function display_websites() |
127 | 127 | { |
128 | 128 | global $phpbb_admin_path; |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
229 | - * Get link's information and call appropriate action |
|
230 | - * |
|
231 | - * @param array $mark Website selected for (dis)approval |
|
232 | - * @return null |
|
233 | - */ |
|
229 | + * Get link's information and call appropriate action |
|
230 | + * |
|
231 | + * @param array $mark Website selected for (dis)approval |
|
232 | + * @return null |
|
233 | + */ |
|
234 | 234 | public function exec_action($mark) |
235 | 235 | { |
236 | 236 | $this->_get_infos_links($mark); |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
256 | - * Notify users which had submitted their websites |
|
257 | - * |
|
258 | - * @return null |
|
259 | - */ |
|
256 | + * Notify users which had submitted their websites |
|
257 | + * |
|
258 | + * @return null |
|
259 | + */ |
|
260 | 260 | public function notifiy_submiters() |
261 | 261 | { |
262 | 262 | if (!class_exists('messenger')) |
@@ -300,22 +300,22 @@ discard block |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
303 | - * Set page url |
|
304 | - * |
|
305 | - * @param string $u_action Custom form action |
|
306 | - * @return null |
|
307 | - * @access public |
|
308 | - */ |
|
303 | + * Set page url |
|
304 | + * |
|
305 | + * @param string $u_action Custom form action |
|
306 | + * @return null |
|
307 | + * @access public |
|
308 | + */ |
|
309 | 309 | public function set_page_url($u_action) |
310 | 310 | { |
311 | 311 | $this->u_action = $u_action; |
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
315 | - * Approve action |
|
316 | - * |
|
317 | - * @return null |
|
318 | - */ |
|
315 | + * Approve action |
|
316 | + * |
|
317 | + * @return null |
|
318 | + */ |
|
319 | 319 | private function _action_approved() |
320 | 320 | { |
321 | 321 | foreach ($this->links_data as $row) |
@@ -344,10 +344,10 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
347 | - * Disapprove action |
|
348 | - * |
|
349 | - * @return null |
|
350 | - */ |
|
347 | + * Disapprove action |
|
348 | + * |
|
349 | + * @return null |
|
350 | + */ |
|
351 | 351 | private function _action_disapproved() |
352 | 352 | { |
353 | 353 | foreach ($this->links_data as $row) |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
371 | - * Get informations about links selected |
|
372 | - * |
|
373 | - * @param $mark Website selected for (dis)approval |
|
374 | - * @return null |
|
375 | - */ |
|
371 | + * Get informations about links selected |
|
372 | + * |
|
373 | + * @param $mark Website selected for (dis)approval |
|
374 | + * @return null |
|
375 | + */ |
|
376 | 376 | private function _get_infos_links($mark) |
377 | 377 | { |
378 | 378 | $sql_array = array( |
@@ -407,11 +407,11 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | /** |
410 | - * Notify users which watch categories |
|
411 | - * |
|
412 | - * @param $row Informations about website |
|
413 | - * @return null |
|
414 | - */ |
|
410 | + * Notify users which watch categories |
|
411 | + * |
|
412 | + * @param $row Informations about website |
|
413 | + * @return null |
|
414 | + */ |
|
415 | 415 | private function _notify_suscribers($row) |
416 | 416 | { |
417 | 417 | $notification_data = array( |
@@ -85,21 +85,21 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\helper $dir_helper, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
87 | 87 | { |
88 | - $this->config = $config; |
|
89 | - $this->db = $db; |
|
90 | - $this->pagination = $pagination; |
|
88 | + $this->config = $config; |
|
89 | + $this->db = $db; |
|
90 | + $this->pagination = $pagination; |
|
91 | 91 | $this->phpbb_log = $log; |
92 | - $this->notification = $notification; |
|
93 | - $this->request = $request; |
|
92 | + $this->notification = $notification; |
|
93 | + $this->request = $request; |
|
94 | 94 | $this->template = $template; |
95 | 95 | $this->user = $user; |
96 | 96 | $this->categorie = $categorie; |
97 | - $this->dir_helper = $dir_helper; |
|
97 | + $this->dir_helper = $dir_helper; |
|
98 | 98 | $this->link = $link; |
99 | 99 | $this->root_path = $root_path; |
100 | - $this->php_ext = $php_ext; |
|
100 | + $this->php_ext = $php_ext; |
|
101 | 101 | |
102 | - $this->action = $this->request->variable('action', ''); |
|
102 | + $this->action = $this->request->variable('action', ''); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | global $phpbb_admin_path; |
129 | 129 | |
130 | 130 | // Sort keys |
131 | - $sort_days = $this->request->variable('st', 0); |
|
131 | + $sort_days = $this->request->variable('st', 0); |
|
132 | 132 | $sort_key = $this->request->variable('sk', 't'); |
133 | 133 | $sort_dir = $this->request->variable('sd', 'd'); |
134 | 134 | |
135 | 135 | // Number of entries to display |
136 | 136 | $per_page = $this->request->variable('links_per_page', (int) $this->config['dir_show']); |
137 | 137 | |
138 | - $start = $this->request->variable('start', 0); |
|
138 | + $start = $this->request->variable('start', 0); |
|
139 | 139 | |
140 | 140 | // Categorie ordering options |
141 | 141 | $limit_days = array(0 => $this->user->lang['SEE_ALL'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']); |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | |
152 | 152 | if (is_array($sort_by_sql[$sort_key])) |
153 | 153 | { |
154 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
154 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
155 | 155 | } |
156 | 156 | else |
157 | 157 | { |
158 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
158 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $sql = 'SELECT COUNT(1) AS total_links |
162 | - FROM ' . DIR_LINK_TABLE . ' |
|
162 | + FROM ' . DIR_LINK_TABLE.' |
|
163 | 163 | WHERE link_active = 0' . |
164 | 164 | (($sql_where) ? " AND link_time >= $sql_where" : ''); |
165 | 165 | $result = $this->db->sql_query($sql); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | 'ON' => 'u.user_id = l.link_user_id' |
184 | 184 | ) |
185 | 185 | ), |
186 | - 'WHERE' => 'l.link_active = 0' . (($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
186 | + 'WHERE' => 'l.link_active = 0'.(($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
187 | 187 | 'ORDER_BY' => $sql_sort_order); |
188 | 188 | |
189 | 189 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | $option_ary = array('approved' => 'DIR_LINK_ACTIVATE', 'disapproved' => 'DIR_LINK_DELETE'); |
212 | 212 | |
213 | - $base_url = $this->u_action . "&$u_sort_param&links_per_page=$per_page"; |
|
213 | + $base_url = $this->u_action."&$u_sort_param&links_per_page=$per_page"; |
|
214 | 214 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_links, $per_page, $start); |
215 | 215 | |
216 | 216 | $this->template->assign_vars(array( |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | 'S_SORT_DIR' => $s_sort_dir, |
222 | 222 | 'LINKS_PER_PAGE' => $per_page, |
223 | 223 | |
224 | - 'U_ACTION' => $this->u_action . "&$u_sort_param&links_per_page=$per_page&start=$start", |
|
224 | + 'U_ACTION' => $this->u_action."&$u_sort_param&links_per_page=$per_page&start=$start", |
|
225 | 225 | )); |
226 | 226 | } |
227 | 227 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | return; |
250 | 250 | } |
251 | 251 | |
252 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_' . strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
252 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_'.strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | { |
262 | 262 | if (!class_exists('messenger')) |
263 | 263 | { |
264 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
264 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
265 | 265 | } |
266 | 266 | $messenger = new \messenger(false); |
267 | 267 | |
@@ -328,15 +328,15 @@ discard block |
||
328 | 328 | 'link_cat' => (int) $row['link_cat'], |
329 | 329 | ); |
330 | 330 | |
331 | - $sql = 'UPDATE ' . DIR_LINK_TABLE . ' |
|
332 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
331 | + $sql = 'UPDATE '.DIR_LINK_TABLE.' |
|
332 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
333 | 333 | WHERE link_id = ' . (int) $row['link_id']; |
334 | 334 | $this->db->sql_query($sql); |
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ($this->cat_data as $cat_id => $count) |
338 | 338 | { |
339 | - $sql = 'UPDATE ' . DIR_CAT_TABLE . ' |
|
339 | + $sql = 'UPDATE '.DIR_CAT_TABLE.' |
|
340 | 340 | SET cat_links = cat_links + '.$count.' |
341 | 341 | WHERE cat_id = ' . (int) $cat_id; |
342 | 342 | $this->db->sql_query($sql); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
365 | - $sql = 'DELETE FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $row['link_id']; |
|
365 | + $sql = 'DELETE FROM '.DIR_LINK_TABLE.' WHERE link_id = '.(int) $row['link_id']; |
|
366 | 366 | $this->db->sql_query($sql); |
367 | 367 | } |
368 | 368 | } |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | protected $link; |
44 | 44 | |
45 | 45 | /** |
46 | - * Constructor |
|
47 | - * |
|
48 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
49 | - * @param \phpbb\config\config $config Config object |
|
50 | - * @param \phpbb\template\template $template Template object |
|
51 | - * @param \phpbb\user $user User object |
|
52 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
53 | - * @param \phpbb\request\request $request Request object |
|
54 | - * @param \phpbb\auth\auth $auth Auth object |
|
55 | - * @param \phpbb\pagination $pagination Pagination object |
|
56 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
57 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
58 | - */ |
|
46 | + * Constructor |
|
47 | + * |
|
48 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
49 | + * @param \phpbb\config\config $config Config object |
|
50 | + * @param \phpbb\template\template $template Template object |
|
51 | + * @param \phpbb\user $user User object |
|
52 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
53 | + * @param \phpbb\request\request $request Request object |
|
54 | + * @param \phpbb\auth\auth $auth Auth object |
|
55 | + * @param \phpbb\pagination $pagination Pagination object |
|
56 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
57 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
58 | + */ |
|
59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
60 | 60 | { |
61 | 61 | $this->db = $db; |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | - * Base controller to be accessed with the URL /directory |
|
82 | - * |
|
83 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
84 | - */ |
|
81 | + * Base controller to be accessed with the URL /directory |
|
82 | + * |
|
83 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
84 | + */ |
|
85 | 85 | public function base() |
86 | 86 | { |
87 | 87 | $this->categorie->display(); |
@@ -91,17 +91,17 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * View controller for display a category |
|
95 | - * |
|
96 | - * @param int $cat_id The category ID |
|
97 | - * @param int $page Page number taken from the URL |
|
98 | - * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
99 | - * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
100 | - * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
101 | - * @param string $mode watch|unwatch |
|
102 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
103 | - * @throws \phpbb\exception\http_exception |
|
104 | - */ |
|
94 | + * View controller for display a category |
|
95 | + * |
|
96 | + * @param int $cat_id The category ID |
|
97 | + * @param int $page Page number taken from the URL |
|
98 | + * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
99 | + * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
100 | + * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
101 | + * @param string $mode watch|unwatch |
|
102 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
103 | + * @throws \phpbb\exception\http_exception |
|
104 | + */ |
|
105 | 105 | public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '') |
106 | 106 | { |
107 | 107 | if (false === $this->categorie->get($cat_id)) |
@@ -361,11 +361,11 @@ discard block |
||
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
364 | - * date controller for return a date |
|
365 | - * |
|
366 | - * @return \phpbb\json_response A Json Response |
|
367 | - * @throws \phpbb\exception\http_exception |
|
368 | - */ |
|
364 | + * date controller for return a date |
|
365 | + * |
|
366 | + * @return \phpbb\json_response A Json Response |
|
367 | + * @throws \phpbb\exception\http_exception |
|
368 | + */ |
|
369 | 369 | public function return_date() |
370 | 370 | { |
371 | 371 | if (!$this->request->is_ajax()) |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
60 | 60 | { |
61 | - $this->db = $db; |
|
61 | + $this->db = $db; |
|
62 | 62 | $this->config = $config; |
63 | - $this->template = $template; |
|
63 | + $this->template = $template; |
|
64 | 64 | $this->user = $user; |
65 | 65 | $this->helper = $helper; |
66 | - $this->request = $request; |
|
66 | + $this->request = $request; |
|
67 | 67 | $this->auth = $auth; |
68 | - $this->pagination = $pagination; |
|
69 | - $this->categorie = $categorie; |
|
68 | + $this->pagination = $pagination; |
|
69 | + $this->categorie = $categorie; |
|
70 | 70 | $this->link = $link; |
71 | 71 | |
72 | 72 | $this->user->add_lang_ext('ernadoo/phpbbdirectory', 'directory'); |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | |
112 | 112 | $start = ($page - 1) * $this->config['dir_show']; |
113 | 113 | |
114 | - $default_sort_days = 0; |
|
114 | + $default_sort_days = 0; |
|
115 | 115 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
116 | 116 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
117 | 117 | |
118 | 118 | $sort_days = (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; |
119 | 119 | $sort_key = (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; |
120 | - $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
120 | + $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
121 | 121 | $link_list = $rowset = array(); |
122 | 122 | |
123 | 123 | // Categorie ordering options |
124 | 124 | $limit_days = array(0 => $this->user->lang['SEE_ALL'], 1 => $this->user->lang['1_DAY'], 7 => $this->user->lang['7_DAYS'], 14 => $this->user->lang['2_WEEKS'], 30 => $this->user->lang['1_MONTH'], 90 => $this->user->lang['3_MONTHS'], 180 => $this->user->lang['6_MONTHS'], 365 => $this->user->lang['1_YEAR']); |
125 | - $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
125 | + $sort_by_text = array('a' => $this->user->lang['AUTHOR'], 't' => $this->user->lang['POST_TIME'], 'r' => $this->user->lang['DIR_COMMENTS_ORDER'], 's' => $this->user->lang['DIR_NAME_ORDER'], 'v' => $this->user->lang['DIR_NB_CLICKS_ORDER']); |
|
126 | 126 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
127 | 127 | |
128 | 128 | if ($this->config['dir_activ_pagerank']) |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $min_post_time = time() - ($sort_days * 86400); |
162 | 162 | |
163 | 163 | $sql = 'SELECT COUNT(link_id) AS nb_links |
164 | - FROM ' . DIR_LINK_TABLE . ' |
|
165 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
164 | + FROM ' . DIR_LINK_TABLE.' |
|
165 | + WHERE link_cat = ' . (int) $cat_id.' |
|
166 | 166 | AND link_time >= ' . $min_post_time; |
167 | 167 | $result = $this->db->sql_query($sql); |
168 | 168 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | else |
178 | 178 | { |
179 | 179 | $sql_limit_time = ''; |
180 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
180 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | |
238 | 238 | if (is_array($sort_by_sql[$sort_key])) |
239 | 239 | { |
240 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
240 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
241 | 241 | } |
242 | 242 | else |
243 | 243 | { |
244 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
244 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | // Grab just the sorted link ids |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | ), |
285 | 285 | array( |
286 | 286 | 'FROM' => array(DIR_VOTE_TABLE => 'v'), |
287 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
287 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
288 | 288 | ) |
289 | 289 | ), |
290 | 290 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | |
302 | 302 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
303 | 303 | |
304 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
305 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
304 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
305 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
306 | 306 | |
307 | 307 | foreach ($link_list as $link_id) |
308 | 308 | { |
@@ -312,11 +312,11 @@ discard block |
||
312 | 312 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
313 | 313 | $s_thumb = $this->link->display_thumb($site); |
314 | 314 | $s_vote = $this->link->display_vote($site); |
315 | - $s_banner = $this->link->display_bann($site); |
|
316 | - $s_pr = $this->link->display_pagerank($site); |
|
317 | - $s_rss = $this->link->display_rss($site); |
|
315 | + $s_banner = $this->link->display_bann($site); |
|
316 | + $s_pr = $this->link->display_pagerank($site); |
|
317 | + $s_rss = $this->link->display_rss($site); |
|
318 | 318 | |
319 | - $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
319 | + $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
320 | 320 | $delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir')))); |
321 | 321 | |
322 | 322 | $this->template->assign_block_vars('site', array( |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $this->template->assign_block_vars('no_draw_link', array()); |
354 | 354 | } |
355 | 355 | |
356 | - $page_title = $this->user->lang['DIRECTORY'] . ' - ' . $this->categorie->data['cat_name']; |
|
356 | + $page_title = $this->user->lang['DIRECTORY'].' - '.$this->categorie->data['cat_name']; |
|
357 | 357 | |
358 | 358 | $this->categorie->display(); |
359 | 359 |
@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | protected $php_ext; |
57 | 57 | |
58 | 58 | /** |
59 | - * Constructor |
|
60 | - * |
|
61 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
62 | - * @param \phpbb\config\config $config Config object |
|
63 | - * @param \phpbb\template\template $template Template object |
|
64 | - * @param \phpbb\user $user User object |
|
65 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
66 | - * @param \phpbb\request\request $request Request object |
|
67 | - * @param \phpbb\auth\auth $auth Auth object |
|
68 | - * @param \phpbb\pagination $pagination Pagination object |
|
69 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
70 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
71 | - * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
72 | - * @param string $root_path phpBB root path |
|
73 | - * @param string $php_ext phpEx |
|
74 | - */ |
|
59 | + * Constructor |
|
60 | + * |
|
61 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
62 | + * @param \phpbb\config\config $config Config object |
|
63 | + * @param \phpbb\template\template $template Template object |
|
64 | + * @param \phpbb\user $user User object |
|
65 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
66 | + * @param \phpbb\request\request $request Request object |
|
67 | + * @param \phpbb\auth\auth $auth Auth object |
|
68 | + * @param \phpbb\pagination $pagination Pagination object |
|
69 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
70 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
71 | + * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
72 | + * @param string $root_path phpBB root path |
|
73 | + * @param string $php_ext phpEx |
|
74 | + */ |
|
75 | 75 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
76 | 76 | { |
77 | 77 | $this->db = $db; |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Populate form when an error occurred |
|
110 | - * |
|
111 | - * @param int $link_id The link ID |
|
112 | - * @param int $comment_id The comment ID |
|
113 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
114 | - * @throws \phpbb\exception\http_exception |
|
115 | - */ |
|
109 | + * Populate form when an error occurred |
|
110 | + * |
|
111 | + * @param int $link_id The link ID |
|
112 | + * @param int $comment_id The comment ID |
|
113 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
114 | + * @throws \phpbb\exception\http_exception |
|
115 | + */ |
|
116 | 116 | public function delete_comment($link_id, $comment_id) |
117 | 117 | { |
118 | 118 | $this->_check_comments_enable($link_id); |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
154 | - * Edit a comment |
|
155 | - * |
|
156 | - * @param int $link_id The category ID |
|
157 | - * @param int $comment_id The comment ID |
|
158 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
159 | - * @throws \phpbb\exception\http_exception |
|
160 | - */ |
|
154 | + * Edit a comment |
|
155 | + * |
|
156 | + * @param int $link_id The category ID |
|
157 | + * @param int $comment_id The comment ID |
|
158 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
159 | + * @throws \phpbb\exception\http_exception |
|
160 | + */ |
|
161 | 161 | public function edit_comment($link_id, $comment_id) |
162 | 162 | { |
163 | 163 | $this->_check_comments_enable($link_id); |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
191 | - * Post a new comment |
|
192 | - * |
|
193 | - * @param int $link_id The category ID |
|
194 | - * @return null |
|
195 | - * @throws \phpbb\exception\http_exception |
|
196 | - */ |
|
191 | + * Post a new comment |
|
192 | + * |
|
193 | + * @param int $link_id The category ID |
|
194 | + * @return null |
|
195 | + * @throws \phpbb\exception\http_exception |
|
196 | + */ |
|
197 | 197 | public function new_comment($link_id) |
198 | 198 | { |
199 | 199 | $this->_check_comments_enable($link_id); |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | - * Display popup comment |
|
223 | - * |
|
224 | - * @param int $link_id The category ID |
|
225 | - * @param int $page Page number taken from the URL |
|
226 | - * @param string $mode add|edit |
|
227 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
228 | - * @throws \phpbb\exception\http_exception |
|
229 | - */ |
|
222 | + * Display popup comment |
|
223 | + * |
|
224 | + * @param int $link_id The category ID |
|
225 | + * @param int $page Page number taken from the URL |
|
226 | + * @param string $mode add|edit |
|
227 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
228 | + * @throws \phpbb\exception\http_exception |
|
229 | + */ |
|
230 | 230 | public function view($link_id, $page, $mode = 'new') |
231 | 231 | { |
232 | 232 | $this->_check_comments_enable($link_id); |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
322 | - * Routine |
|
323 | - * |
|
324 | - * @param int $link_id The link ID |
|
325 | - * @param int $comment_id The comment ID |
|
326 | - * @param string $mode new|edit |
|
327 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
328 | - */ |
|
322 | + * Routine |
|
323 | + * |
|
324 | + * @param int $link_id The link ID |
|
325 | + * @param int $comment_id The comment ID |
|
326 | + * @param string $mode new|edit |
|
327 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
328 | + */ |
|
329 | 329 | private function _data_processing($link_id, $comment_id = 0, $mode = 'new') |
330 | 330 | { |
331 | 331 | if (!check_form_key('dir_form_comment')) |
@@ -413,12 +413,12 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
416 | - * Check if comments are enable in a category |
|
417 | - * |
|
418 | - * @param int $link_id The link ID |
|
419 | - * @return null Retun null if comments are allowed, http_exception if not |
|
420 | - * @throws \phpbb\exception\http_exception |
|
421 | - */ |
|
416 | + * Check if comments are enable in a category |
|
417 | + * |
|
418 | + * @param int $link_id The link ID |
|
419 | + * @return null Retun null if comments are allowed, http_exception if not |
|
420 | + * @throws \phpbb\exception\http_exception |
|
421 | + */ |
|
422 | 422 | private function _check_comments_enable($link_id) |
423 | 423 | { |
424 | 424 | $sql = 'SELECT link_cat |
@@ -444,12 +444,12 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
447 | - * Populate form when an error occurred |
|
448 | - * |
|
449 | - * @param int $link_id The link ID |
|
450 | - * @param string $mode add|edit |
|
451 | - * @return null |
|
452 | - */ |
|
447 | + * Populate form when an error occurred |
|
448 | + * |
|
449 | + * @param int $link_id The link ID |
|
450 | + * @param string $mode add|edit |
|
451 | + * @return null |
|
452 | + */ |
|
453 | 453 | private function _populate_form($link_id, $mode) |
454 | 454 | { |
455 | 455 | if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit') |
@@ -191,7 +191,7 @@ |
||
191 | 191 | * Post a new comment |
192 | 192 | * |
193 | 193 | * @param int $link_id The category ID |
194 | - * @return null |
|
194 | + * @return \Symfony\Component\HttpFoundation\Response|null |
|
195 | 195 | * @throws \phpbb\exception\http_exception |
196 | 196 | */ |
197 | 197 | public function new_comment($link_id) |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
76 | 76 | { |
77 | - $this->db = $db; |
|
77 | + $this->db = $db; |
|
78 | 78 | $this->config = $config; |
79 | - $this->template = $template; |
|
79 | + $this->template = $template; |
|
80 | 80 | $this->user = $user; |
81 | 81 | $this->helper = $helper; |
82 | - $this->request = $request; |
|
82 | + $this->request = $request; |
|
83 | 83 | $this->auth = $auth; |
84 | - $this->pagination = $pagination; |
|
85 | - $this->captcha_factory = $captcha_factory; |
|
84 | + $this->pagination = $pagination; |
|
85 | + $this->captcha_factory = $captcha_factory; |
|
86 | 86 | $this->categorie = $categorie; |
87 | 87 | $this->comment = $comment; |
88 | 88 | $this->root_path = $root_path; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | $sql = 'SELECT * |
127 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
127 | + FROM ' . DIR_COMMENT_TABLE.' |
|
128 | 128 | WHERE comment_id = ' . (int) $comment_id; |
129 | 129 | $result = $this->db->sql_query($sql); |
130 | 130 | $value = $this->db->sql_fetchrow($result); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
142 | 142 | meta_refresh(3, $meta_info); |
143 | 143 | $message = $this->user->lang['DIR_COMMENT_DELETE_OK']; |
144 | - $message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
144 | + $message = $message.'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
145 | 145 | return $this->helper->message($message); |
146 | 146 | } |
147 | 147 | else |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $this->_check_comments_enable($link_id); |
164 | 164 | |
165 | 165 | $sql = 'SELECT * |
166 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
166 | + FROM ' . DIR_COMMENT_TABLE.' |
|
167 | 167 | WHERE comment_id = ' . (int) $comment_id; |
168 | 168 | $result = $this->db->sql_query($sql); |
169 | 169 | $value = $this->db->sql_fetchrow($result); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']); |
177 | 177 | $this->s_comment = $comment_text['text']; |
178 | 178 | |
179 | - $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
179 | + $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
180 | 180 | |
181 | 181 | // If form is done |
182 | 182 | if ($submit) |
@@ -232,15 +232,15 @@ discard block |
||
232 | 232 | $this->_check_comments_enable($link_id); |
233 | 233 | |
234 | 234 | $comment_id = $this->request->variable('c', 0); |
235 | - $view = $this->request->variable('view', ''); |
|
236 | - $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
235 | + $view = $this->request->variable('view', ''); |
|
236 | + $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
237 | 237 | |
238 | 238 | $this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page)); |
239 | 239 | |
240 | 240 | $this->_populate_form($link_id, $mode); |
241 | 241 | |
242 | 242 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
243 | - FROM ' . DIR_COMMENT_TABLE . ' |
|
243 | + FROM ' . DIR_COMMENT_TABLE.' |
|
244 | 244 | WHERE comment_link_id = ' . (int) $link_id; |
245 | 245 | $result = $this->db->sql_query($sql); |
246 | 246 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | ), |
261 | 261 | array( |
262 | 262 | 'FROM' => array(ZEBRA_TABLE => 'z'), |
263 | - 'ON' => 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id' |
|
263 | + 'ON' => 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id' |
|
264 | 264 | ) |
265 | 265 | ), |
266 | - 'WHERE' => 'a.comment_link_id = ' . (int) $link_id, |
|
266 | + 'WHERE' => 'a.comment_link_id = '.(int) $link_id, |
|
267 | 267 | 'ORDER_BY' => 'a.comment_date DESC'); |
268 | 268 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
269 | 269 | $result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start); |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | 'S_COMMENT' => generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']), |
293 | 293 | 'S_ID' => $comments['comment_id'], |
294 | 294 | |
295 | - 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
296 | - 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
295 | + 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
296 | + 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
297 | 297 | |
298 | 298 | 'S_IGNORE_POST' => ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false, |
299 | 299 | 'L_IGNORE_POST' => ($comments['foe']) ? $this->user->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
300 | - 'L_POST_DISPLAY' => ($comments['foe']) ? $this->user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
300 | + 'L_POST_DISPLAY' => ($comments['foe']) ? $this->user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
301 | 301 | |
302 | 302 | 'S_INFO' => $this->auth->acl_get('m_info'), |
303 | 303 | )); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | if (!function_exists('validate_data')) |
339 | 339 | { |
340 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
340 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | $error = validate_data( |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
400 | 400 | meta_refresh(3, $meta_info); |
401 | 401 | $message = $this->user->lang['DIR_'.strtoupper($mode).'_COMMENT_OK']; |
402 | - $message = $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
402 | + $message = $message.'<br /><br />'.$this->user->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
403 | 403 | return $this->helper->message($message); |
404 | 404 | } |
405 | 405 | else |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | private function _check_comments_enable($link_id) |
423 | 423 | { |
424 | 424 | $sql = 'SELECT link_cat |
425 | - FROM ' . DIR_LINK_TABLE . ' |
|
425 | + FROM ' . DIR_LINK_TABLE.' |
|
426 | 426 | WHERE link_id = ' . (int) $link_id; |
427 | 427 | $result = $this->db->sql_query($sql); |
428 | 428 | $cat_id = (int) $this->db->sql_fetchfield('link_cat'); |
@@ -464,11 +464,11 @@ discard block |
||
464 | 464 | |
465 | 465 | if (!function_exists('generate_smilies')) |
466 | 466 | { |
467 | - include($this->root_path . 'includes/functions_posting.' . $this->php_ext); |
|
467 | + include($this->root_path.'includes/functions_posting.'.$this->php_ext); |
|
468 | 468 | } |
469 | 469 | if (!function_exists('display_custom_bbcodes')) |
470 | 470 | { |
471 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
|
471 | + include($this->root_path.'includes/functions_display.'.$this->php_ext); |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | generate_smilies('inline', 0); |
@@ -478,11 +478,11 @@ discard block |
||
478 | 478 | $this->template->assign_vars(array( |
479 | 479 | 'S_AUTH_COMM' => $this->auth->acl_get('u_comment_dir'), |
480 | 480 | |
481 | - 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
482 | - 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
483 | - 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], |
|
484 | - 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], |
|
485 | - 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
481 | + 'BBCODE_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), |
|
482 | + 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'], |
|
483 | + 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'], |
|
484 | + 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'], |
|
485 | + 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'], |
|
486 | 486 | |
487 | 487 | 'L_DIR_REPLY_EXP' => $this->user->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']), |
488 | 488 |