@@ -336,8 +336,7 @@ discard block |
||
336 | 336 | if ($this->settings['display_preview']) |
337 | 337 | { |
338 | 338 | $post_data = $this->forum->get_post_data($this->settings['display_preview']); |
339 | - } |
|
340 | - else |
|
339 | + } else |
|
341 | 340 | { |
342 | 341 | $post_data = array_fill_keys(array_keys($topic_data), array(array('post_text' => '', 'bbcode_uid' => '', 'bbcode_bitfield' => ''))); |
343 | 342 | } |
@@ -360,8 +359,7 @@ discard block |
||
360 | 359 | $this->fields['user_colour'] = 'topic_last_poster_colour'; |
361 | 360 | |
362 | 361 | $this->ptemplate->assign_var('L_POST_BY_AUTHOR', $this->user->lang('LAST_POST_BY_AUTHOR')); |
363 | - } |
|
364 | - else |
|
362 | + } else |
|
365 | 363 | { |
366 | 364 | $this->fields['time'] = 'topic_time'; |
367 | 365 | $this->fields['user_id'] = 'topic_poster'; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function save(\blitze\sitemaker\model\entity_interface $entity) |
87 | 87 | { |
88 | - $accessor = 'get_' . $this->entity_pkey; |
|
88 | + $accessor = 'get_'.$this->entity_pkey; |
|
89 | 89 | if (is_null($entity->$accessor())) |
90 | 90 | { |
91 | 91 | $entity = $this->insert($entity); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | if ($condition instanceof $this->entity_class) |
109 | 109 | { |
110 | - $accessor = 'get_' . $this->entity_pkey; |
|
110 | + $accessor = 'get_'.$this->entity_pkey; |
|
111 | 111 | $condition = array($this->entity_pkey, '=', $condition->$accessor()); |
112 | 112 | } |
113 | 113 | else |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $sql_where = $this->get_sql_condition($condition); |
120 | - $this->db->sql_query('DELETE FROM ' . $this->entity_table . (sizeof($sql_where) ? ' WHERE ' . join(' AND ', $sql_where) : '')); |
|
120 | + $this->db->sql_query('DELETE FROM '.$this->entity_table.(sizeof($sql_where) ? ' WHERE '.join(' AND ', $sql_where) : '')); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function insert(\blitze\sitemaker\model\entity_interface $entity) |
138 | 138 | { |
139 | - $this->db->sql_query('INSERT INTO ' . $this->entity_table . ' ' . $this->db->sql_build_array('INSERT', $entity->to_db())); |
|
139 | + $this->db->sql_query('INSERT INTO '.$this->entity_table.' '.$this->db->sql_build_array('INSERT', $entity->to_db())); |
|
140 | 140 | |
141 | - $mutator = 'set_' . $this->entity_pkey; |
|
141 | + $mutator = 'set_'.$this->entity_pkey; |
|
142 | 142 | $entity->$mutator((int) $this->db->sql_nextid()); |
143 | 143 | |
144 | 144 | return $entity; |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | */ |
153 | 153 | protected function update(\blitze\sitemaker\model\entity_interface $entity) |
154 | 154 | { |
155 | - $accessor = 'get_' . $this->entity_pkey; |
|
155 | + $accessor = 'get_'.$this->entity_pkey; |
|
156 | 156 | |
157 | - return $this->db->sql_query('UPDATE ' . $this->entity_table . ' |
|
158 | - SET ' . $this->db->sql_build_array('UPDATE', $entity->to_db()) . ' |
|
159 | - WHERE ' . $this->entity_pkey . ' = ' . (int) $entity->$accessor()); |
|
157 | + return $this->db->sql_query('UPDATE '.$this->entity_table.' |
|
158 | + SET ' . $this->db->sql_build_array('UPDATE', $entity->to_db()).' |
|
159 | + WHERE ' . $this->entity_pkey.' = '.(int) $entity->$accessor()); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | */ |
166 | 166 | protected function find_sql(array $sql_where) |
167 | 167 | { |
168 | - return 'SELECT * FROM ' . $this->entity_table . |
|
169 | - (sizeof($sql_where) ? ' WHERE ' . join(' AND ', $sql_where) : ''); |
|
168 | + return 'SELECT * FROM '.$this->entity_table. |
|
169 | + (sizeof($sql_where) ? ' WHERE '.join(' AND ', $sql_where) : ''); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | { |
183 | 183 | list($field, $operator, $value) = $info; |
184 | 184 | |
185 | - $callable = 'get_sql_where_' . gettype($value); |
|
185 | + $callable = 'get_sql_where_'.gettype($value); |
|
186 | 186 | if (is_callable(array($this, $callable))) |
187 | 187 | { |
188 | 188 | $sql_where[] = call_user_func_array(array($this, $callable), array($field, $value, $operator)); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | protected function get_sql_where_string($field, $value, $operator) |
222 | 222 | { |
223 | - return $field . " $operator '" . $this->db->sql_escape($value) . "'"; |
|
223 | + return $field." $operator '".$this->db->sql_escape($value)."'"; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | protected function get_sql_where_integer($field, $value, $operator) |
233 | 233 | { |
234 | - return $field . " $operator " . (int) $value; |
|
234 | + return $field." $operator ".(int) $value; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -101,8 +101,7 @@ |
||
101 | 101 | if (!isset($key)) |
102 | 102 | { |
103 | 103 | $this->_entities[] = $entity; |
104 | - } |
|
105 | - else |
|
104 | + } else |
|
106 | 105 | { |
107 | 106 | $this->_entities[$key] = $entity; |
108 | 107 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * {@inheritdoc} |
|
60 | - */ |
|
59 | + * {@inheritdoc} |
|
60 | + */ |
|
61 | 61 | public function to_array() |
62 | 62 | { |
63 | 63 | $attributes = $this->get_attributes(); |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * {@inheritdoc} |
|
78 | - */ |
|
77 | + * {@inheritdoc} |
|
78 | + */ |
|
79 | 79 | public function to_db() |
80 | 80 | { |
81 | 81 | $this->check_required(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | foreach ($data as $name => $value) |
27 | 27 | { |
28 | - $mutator = 'set_' . $name; |
|
28 | + $mutator = 'set_'.$name; |
|
29 | 29 | $this->$mutator($value); |
30 | 30 | } |
31 | 31 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $data = array(); |
66 | 66 | foreach ($attributes as $attribute) |
67 | 67 | { |
68 | - $accessor = 'get_' . $attribute; |
|
68 | + $accessor = 'get_'.$attribute; |
|
69 | 69 | $data[$attribute] = $this->$accessor(); |
70 | 70 | } |
71 | 71 | unset($data['db_fields'], $data['required_fields']); |
@@ -40,8 +40,7 @@ |
||
40 | 40 | if ($this->can_track_by_lastread()) |
41 | 41 | { |
42 | 42 | $info = $this->build_tracking_info('get_topic_tracking', $forums, $topics); |
43 | - } |
|
44 | - else if ($this->can_track_anonymous()) |
|
43 | + } else if ($this->can_track_anonymous()) |
|
45 | 44 | { |
46 | 45 | $info = $this->build_tracking_info('get_complete_topic_tracking', $forums, $topics); |
47 | 46 | } |
@@ -101,8 +101,7 @@ |
||
101 | 101 | if (!isset($key)) |
102 | 102 | { |
103 | 103 | $this->_entities[] = $entity; |
104 | - } |
|
105 | - else |
|
104 | + } else |
|
106 | 105 | { |
107 | 106 | $this->_entities[$key] = $entity; |
108 | 107 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | if (sizeof($query_ids)) |
77 | 77 | { |
78 | - $sql_where .= (($sql_where) ? ' AND ' : '') . $this->db->sql_in_set('user_id', $query_ids); |
|
78 | + $sql_where .= (($sql_where) ? ' AND ' : '').$this->db->sql_in_set('user_id', $query_ids); |
|
79 | 79 | $this->query($sql_where); |
80 | 80 | } |
81 | 81 | |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | public function get_profile_fields() |
151 | 151 | { |
152 | 152 | $sql = 'SELECT l.lang_name, f.field_ident |
153 | - FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f |
|
154 | - WHERE l.lang_id = ' . $this->user->get_iso_lang_id() . ' |
|
153 | + FROM ' . PROFILE_LANG_TABLE.' l, '.PROFILE_FIELDS_TABLE.' f |
|
154 | + WHERE l.lang_id = ' . $this->user->get_iso_lang_id().' |
|
155 | 155 | AND f.field_active = 1 |
156 | 156 | AND f.field_no_view = 0 |
157 | 157 | AND f.field_hide = 0 |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | protected function get_search_url($user_id) |
205 | 205 | { |
206 | - return ($this->auth->acl_get('u_search')) ? append_sid($this->phpbb_root_path . 'search.' . $this->php_ext, "author_id=$user_id&sr=posts") : ''; |
|
206 | + return ($this->auth->acl_get('u_search')) ? append_sid($this->phpbb_root_path.'search.'.$this->php_ext, "author_id=$user_id&sr=posts") : ''; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | if (!function_exists('phpbb_get_user_rank')) |
216 | 216 | { |
217 | - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
|
217 | + include($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']); |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | protected function get_sql_statement($sql_where = '', $order_by = '') |
289 | 289 | { |
290 | 290 | return 'SELECT user_id, username, user_type, user_colour, user_avatar, user_avatar_type, user_avatar_height, user_avatar_width, user_regdate, user_lastvisit, user_birthday, user_posts, user_rank, user_allow_viewemail, user_allow_pm, user_jabber, user_inactive_reason |
291 | - FROM ' . USERS_TABLE . |
|
292 | - (($sql_where) ? ' WHERE ' . $sql_where : '') . |
|
293 | - (($order_by) ? ' ORDER BY ' . $order_by : ''); |
|
291 | + FROM ' . USERS_TABLE. |
|
292 | + (($sql_where) ? ' WHERE '.$sql_where : ''). |
|
293 | + (($order_by) ? ' ORDER BY '.$order_by : ''); |
|
294 | 294 | } |
295 | 295 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function clean_styles() |
93 | 93 | { |
94 | - $routes_ary = $this->manager->get_routes_per_style(); |
|
95 | - $style_ids = $this->get_style_ids(); |
|
94 | + $routes_ary = $this->manager->get_routes_per_style(); |
|
95 | + $style_ids = $this->get_style_ids(); |
|
96 | 96 | |
97 | 97 | $routes = array(); |
98 | 98 | foreach ($routes_ary as $style_id => $style_routes) |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | foreach ($routes as $route => $row) |
124 | 124 | { |
125 | - $url = $board_url . '/' . (($row['ext_name']) ? 'app.php' : '') . $row['route']; |
|
125 | + $url = $board_url.'/'.(($row['ext_name']) ? 'app.php' : '').$row['route']; |
|
126 | 126 | |
127 | 127 | // Route no longer exists => remove all blocks for route |
128 | 128 | if ($this->url_checker->exists($url) !== true) |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | if (sizeof($block_ids)) |
187 | 187 | { |
188 | - $this->db->sql_query('DELETE FROM ' . $this->cblocks_table . ' WHERE ' . $this->db->sql_in_set('block_id', $block_ids)); |
|
188 | + $this->db->sql_query('DELETE FROM '.$this->cblocks_table.' WHERE '.$this->db->sql_in_set('block_id', $block_ids)); |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 |
@@ -70,8 +70,8 @@ |
||
70 | 70 | */ |
71 | 71 | protected function find_sql(array $sql_where) |
72 | 72 | { |
73 | - return 'SELECT * FROM ' . $this->entity_table . |
|
74 | - ((sizeof($sql_where)) ? ' WHERE ' . join(' AND ', $sql_where) : '') . ' |
|
73 | + return 'SELECT * FROM '.$this->entity_table. |
|
74 | + ((sizeof($sql_where)) ? ' WHERE '.join(' AND ', $sql_where) : '').' |
|
75 | 75 | ORDER BY route ASC'; |
76 | 76 | } |
77 | 77 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | - * @param array|\blitze\sitemaker\model\blocks\entity\route $condition |
|
49 | + * @param \blitze\sitemaker\model\blocks\entity\route $condition |
|
50 | 50 | */ |
51 | 51 | public function delete($condition) |
52 | 52 | { |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | */ |
26 | 26 | protected function find_sql(array $sql_where) |
27 | 27 | { |
28 | - return 'SELECT * FROM ' . $this->entity_table . |
|
29 | - ((sizeof($sql_where)) ? ' WHERE ' . join(' AND ', $sql_where) : '') . ' |
|
28 | + return 'SELECT * FROM '.$this->entity_table. |
|
29 | + ((sizeof($sql_where)) ? ' WHERE '.join(' AND ', $sql_where) : '').' |
|
30 | 30 | ORDER BY position, weight ASC'; |
31 | 31 | } |
32 | 32 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | // move blocks up for position |
41 | 41 | if ($condition instanceof $this->entity_class) |
42 | 42 | { |
43 | - $this->db->sql_query('UPDATE ' . $this->entity_table . ' |
|
43 | + $this->db->sql_query('UPDATE '.$this->entity_table.' |
|
44 | 44 | SET weight = weight - 1 |
45 | - WHERE weight > ' . (int) $condition->get_weight() . ' |
|
46 | - AND style = ' . (int) $condition->get_style() . ' |
|
47 | - AND route_id = ' . (int) $condition->get_route_id() . " |
|
48 | - AND position = '" . $this->db->sql_escape($condition->get_position()) . "'"); |
|
45 | + WHERE weight > ' . (int) $condition->get_weight().' |
|
46 | + AND style = ' . (int) $condition->get_style().' |
|
47 | + AND route_id = ' . (int) $condition->get_route_id()." |
|
48 | + AND position = '" . $this->db->sql_escape($condition->get_position())."'"); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | protected function move_blocks_down(\blitze\sitemaker\model\entity_interface $entity) |
66 | 66 | { |
67 | 67 | /** @type \blitze\sitemaker\model\blocks\entity\block $entity */ |
68 | - $sql = 'UPDATE ' . $this->entity_table . ' |
|
68 | + $sql = 'UPDATE '.$this->entity_table.' |
|
69 | 69 | SET weight = weight + 1 |
70 | - WHERE weight >= ' . (int) $entity->get_weight() . ' |
|
71 | - AND route_id = ' . (int) $entity->get_route_id() . ' |
|
70 | + WHERE weight >= ' . (int) $entity->get_weight().' |
|
71 | + AND route_id = ' . (int) $entity->get_route_id().' |
|
72 | 72 | AND style = ' . (int) $entity->get_style(); |
73 | 73 | $this->db->sql_query($sql); |
74 | 74 | } |
@@ -43,8 +43,8 @@ |
||
43 | 43 | */ |
44 | 44 | public function create($type, $mapper) |
45 | 45 | { |
46 | - $mapper_class = 'blitze\\sitemaker\\model\\' . $type . '\\mapper\\' . $mapper; |
|
47 | - $collection = 'blitze\\sitemaker\\model\\' . $type . '\\collections\\' . $mapper; |
|
46 | + $mapper_class = 'blitze\\sitemaker\\model\\'.$type.'\\mapper\\'.$mapper; |
|
47 | + $collection = 'blitze\\sitemaker\\model\\'.$type.'\\collections\\'.$mapper; |
|
48 | 48 | |
49 | 49 | return new $mapper_class($this->db, new $collection, $this, $this->mapper_tables[$mapper], $this->config); |
50 | 50 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | if (!function_exists('phpbb_get_user_avatar')) |
64 | 64 | { |
65 | - include($phpbb_root_path . 'includes/functions_display.' . $php_ext); |
|
65 | + include($phpbb_root_path.'includes/functions_display.'.$php_ext); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | */ |
100 | 100 | protected function member_posts(array $row) |
101 | 101 | { |
102 | - $u_posts = append_sid($this->phpbb_root_path . 'search.' . $this->php_ext, "author_id={$row['user_id']}&sr=posts" . $this->explain_range); |
|
103 | - $user_posts = '<a href="' . $u_posts . '">' . $row['user_posts'] . '</a>'; |
|
102 | + $u_posts = append_sid($this->phpbb_root_path.'search.'.$this->php_ext, "author_id={$row['user_id']}&sr=posts".$this->explain_range); |
|
103 | + $user_posts = '<a href="'.$u_posts.'">'.$row['user_posts'].'</a>'; |
|
104 | 104 | |
105 | 105 | return array( |
106 | 106 | 'USERNAME' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'WHERE' => $this->db->sql_in_set('u.user_type', array(USER_NORMAL, USER_FOUNDER)), |
169 | 169 | ); |
170 | 170 | |
171 | - $sql_method = 'set_' . $this->settings['query_type'] . '_sql'; |
|
171 | + $sql_method = 'set_'.$this->settings['query_type'].'_sql'; |
|
172 | 172 | call_user_func_array(array($this, $sql_method), array(&$sql_ary)); |
173 | 173 | |
174 | 174 | $this->set_range_sql($sql_ary); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $this->info_header = ''; |
199 | 199 | $this->view_mode = 'member_bots'; |
200 | 200 | |
201 | - $sql_ary['WHERE'] = 'u.user_type = ' . USER_IGNORE; |
|
201 | + $sql_ary['WHERE'] = 'u.user_type = '.USER_IGNORE; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | protected function set_tenured_sql(array &$sql_ary) |
208 | 208 | { |
209 | 209 | $sql_ary['SELECT'] .= ', u.user_regdate as member_date'; |
210 | - $sql_ary['ORDER_BY'] = 'u.user_regdate ' . (($this->settings['query_type'] == 'tenured') ? 'ASC' : 'DESC'); |
|
210 | + $sql_ary['ORDER_BY'] = 'u.user_regdate '.(($this->settings['query_type'] == 'tenured') ? 'ASC' : 'DESC'); |
|
211 | 211 | |
212 | 212 | $this->sql_date_field = 'u.user_regdate'; |
213 | 213 | $this->settings['date_range'] = ''; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $sql_ary['SELECT'] .= ', COUNT(p.post_id) as user_posts'; |
231 | 231 | $sql_ary['FROM'] += array(TOPICS_TABLE => 't'); |
232 | 232 | $sql_ary['FROM'] += array(POSTS_TABLE => 'p'); |
233 | - $sql_ary['WHERE'] .= ' AND ' . time() . ' > t.topic_time AND t.topic_id = p.topic_id AND p.post_visibility = ' . ITEM_APPROVED . ' AND p.poster_id = u.user_id'; |
|
233 | + $sql_ary['WHERE'] .= ' AND '.time().' > t.topic_time AND t.topic_id = p.topic_id AND p.post_visibility = '.ITEM_APPROVED.' AND p.poster_id = u.user_id'; |
|
234 | 234 | $sql_ary['GROUP_BY'] = 'u.user_id'; |
235 | 235 | $sql_ary['ORDER_BY'] = 'user_posts DESC, u.username ASC'; |
236 | 236 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if ($this->settings['date_range'] && $this->sql_date_field) |
248 | 248 | { |
249 | 249 | $range = $this->date_range->get($this->settings['date_range']); |
250 | - $this->explain_range = '&date=' . $range['date']; |
|
250 | + $this->explain_range = '&date='.$range['date']; |
|
251 | 251 | |
252 | 252 | $sql_ary['WHERE'] .= " AND {$this->sql_date_field} BETWEEN {$range['start']} AND {$range['stop']}"; |
253 | 253 | } |