@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -80,10 +80,10 @@ |
||
80 | 80 | foreach ($message_portions as &$message) |
81 | 81 | { |
82 | 82 | // Attempt to translate each portion |
83 | - $translated_message = $translator->lang('EXCEPTION_' . $message); |
|
83 | + $translated_message = $translator->lang('EXCEPTION_'.$message); |
|
84 | 84 | |
85 | 85 | // Check if translating did anything |
86 | - if ($translated_message !== 'EXCEPTION_' . $message) |
|
86 | + if ($translated_message !== 'EXCEPTION_'.$message) |
|
87 | 87 | { |
88 | 88 | // It did, so replace message with the translated version |
89 | 89 | $message = $translated_message; |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $content = $this->request->variable('content', '', true); |
70 | 70 | $cblocks = $this->get_custom_blocks(); |
71 | 71 | |
72 | - $sql_data = $this->get_default_fields($block_id); |
|
72 | + $sql_data = $this->get_default_fields($block_id); |
|
73 | 73 | $sql_data['block_content'] = $content; |
74 | 74 | |
75 | 75 | generate_text_for_storage($sql_data['block_content'], $sql_data['bbcode_uid'], $sql_data['bbcode_bitfield'], $sql_data['bbcode_options'], true, true, true); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | { |
131 | 131 | if (!$block_exists) |
132 | 132 | { |
133 | - $sql = 'INSERT INTO ' . $this->cblocks_table . ' ' . $this->db->sql_build_array('INSERT', $sql_data); |
|
133 | + $sql = 'INSERT INTO '.$this->cblocks_table.' '.$this->db->sql_build_array('INSERT', $sql_data); |
|
134 | 134 | } |
135 | 135 | else |
136 | 136 | { |
137 | - $sql = 'UPDATE ' . $this->cblocks_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_data) . ' WHERE block_id = ' . (int) $sql_data['block_id']; |
|
137 | + $sql = 'UPDATE '.$this->cblocks_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_data).' WHERE block_id = '.(int) $sql_data['block_id']; |
|
138 | 138 | } |
139 | 139 | $this->db->sql_query($sql); |
140 | 140 | $this->cache->destroy('pt_cblocks'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if ($edit_mode !== false) |
152 | 152 | { |
153 | 153 | decode_message($cblock['block_content'], $cblock['bbcode_uid']); |
154 | - $content = '<div id="block-editor-' . $cblock['block_id'] . '" class="editable editable-block" data-service="blitze.sitemaker.block.custom" data-method="edit" data-raw="' . $cblock['block_content'] . '">' . $content . '</div>'; |
|
154 | + $content = '<div id="block-editor-'.$cblock['block_id'].'" class="editable editable-block" data-service="blitze.sitemaker.block.custom" data-method="edit" data-raw="'.$cblock['block_content'].'">'.$content.'</div>'; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | if (!empty($collection)) |
51 | 51 | { |
52 | 52 | return $collection->get_entities(); |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | return array(); |
57 | 56 | } |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | if (!$has_blocks && !$hiding_blocks && !sizeof($ex_positions)) |
89 | 88 | { |
90 | 89 | $this->route_mapper->delete($route); |
91 | - } |
|
92 | - else |
|
90 | + } else |
|
93 | 91 | { |
94 | 92 | $route->set_has_blocks($has_blocks); |
95 | 93 | $this->route_mapper->save($route); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $this->ptemplate->assign_block_vars('topicrow', array( |
101 | 101 | 'TOPIC_TITLE' => censor_text($row['topic_title']), |
102 | - 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&t=$topic_id"), |
|
102 | + 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&t=$topic_id"), |
|
103 | 103 | )); |
104 | 104 | unset($topic_data[$i]); |
105 | 105 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | return array( |
142 | 142 | 'WHERE' => array( |
143 | - 't.topic_last_post_time > ' . $this->user->data['user_lastvisit'], |
|
143 | + 't.topic_last_post_time > '.$this->user->data['user_lastvisit'], |
|
144 | 144 | 't.topic_moved_id = 0', |
145 | 145 | ), |
146 | 146 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | POSTS_TABLE => 'p', |
157 | 157 | ), |
158 | 158 | 'WHERE' => array( |
159 | - 't.topic_id = p.topic_id AND p.post_time > ' . $this->user->data['user_lastvisit'], |
|
159 | + 't.topic_id = p.topic_id AND p.post_time > '.$this->user->data['user_lastvisit'], |
|
160 | 160 | ), |
161 | 161 | ); |
162 | 162 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | if (!empty($data['.'][0]['TOTAL_USERS_ONLINE'])) |
70 | 70 | { |
71 | - $l_online_users = $data['.'][0]['TOTAL_USERS_ONLINE']; |
|
71 | + $l_online_users = $data['.'][0]['TOTAL_USERS_ONLINE']; |
|
72 | 72 | $online_userlist = $data['.'][0]['LOGGED_IN_USER_LIST']; |
73 | 73 | $l_online_record = $data['.'][0]['RECORD_USERS']; |
74 | 74 | } |
@@ -105,6 +105,6 @@ discard block |
||
105 | 105 | */ |
106 | 106 | private function get_viewonline_url() |
107 | 107 | { |
108 | - return ($this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$this->phpbb_root_path}viewonline." . $this->php_ext) : ''; |
|
108 | + return ($this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$this->phpbb_root_path}viewonline.".$this->php_ext) : ''; |
|
109 | 109 | } |
110 | 110 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -172,6 +172,6 @@ |
||
172 | 172 | */ |
173 | 173 | protected function get_sql_where($menu_id) |
174 | 174 | { |
175 | - return '%smenu_id = ' . (int) $menu_id; |
|
175 | + return '%smenu_id = '.(int) $menu_id; |
|
176 | 176 | } |
177 | 177 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function get_item_info($item_id = 0) |
57 | 57 | { |
58 | - $sql = 'SELECT * FROM ' . $this->table_name . ' ' . $this->get_sql_where('WHERE') . |
|
59 | - (($item_id) ? " AND {$this->column_item_id} = " . (int) $item_id : ''); |
|
58 | + $sql = 'SELECT * FROM '.$this->table_name.' '.$this->get_sql_where('WHERE'). |
|
59 | + (($item_id) ? " AND {$this->column_item_id} = ".(int) $item_id : ''); |
|
60 | 60 | |
61 | 61 | $result = $this->db->sql_query($sql); |
62 | 62 | $row = $this->db->sql_fetchrow($result); |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | public function update_item($item_id, array $sql_data) |
76 | 76 | { |
77 | 77 | $sql = "UPDATE {$this->table_name} |
78 | - SET " . $this->db->sql_build_array('UPDATE', $sql_data) . " |
|
79 | - WHERE $this->column_item_id = " . (int) $item_id; |
|
78 | + SET ".$this->db->sql_build_array('UPDATE', $sql_data)." |
|
79 | + WHERE $this->column_item_id = ".(int) $item_id; |
|
80 | 80 | $this->db->sql_query($sql); |
81 | 81 | |
82 | 82 | return $sql_data; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | // Rather than updating each item individually, we will just delete all items |
111 | 111 | // then add them all over again with new parent_id|left_id|right_id |
112 | - $this->db->sql_query("DELETE FROM {$this->table_name} " . $this->get_sql_where('WHERE')); |
|
112 | + $this->db->sql_query("DELETE FROM {$this->table_name} ".$this->get_sql_where('WHERE')); |
|
113 | 113 | |
114 | 114 | // Now we add it back |
115 | 115 | $sql_data = $this->add_sub_tree($tree, 0); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | if ($depth && !$parent_id) |
160 | 160 | { |
161 | - throw new \RuntimeException($this->message_prefix . 'MALFORMED_TREE'); |
|
161 | + throw new \RuntimeException($this->message_prefix.'MALFORMED_TREE'); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $key = $i + $max_id + 1; |
@@ -230,23 +230,23 @@ discard block |
||
230 | 230 | foreach ($branch as $i => $row) |
231 | 231 | { |
232 | 232 | $left_id = $right_id + 1; |
233 | - $right_id = $right_id + 2; |
|
233 | + $right_id = $right_id + 2; |
|
234 | 234 | |
235 | 235 | $sql_data[$i] = $row; |
236 | - $sql_data[$i]['parent_id'] = $parent_id; |
|
237 | - $sql_data[$i]['left_id'] = $left_id; |
|
238 | - $sql_data[$i]['right_id'] = $right_id; |
|
239 | - $sql_data[$i]['depth'] = $depth; |
|
236 | + $sql_data[$i]['parent_id'] = $parent_id; |
|
237 | + $sql_data[$i]['left_id'] = $left_id; |
|
238 | + $sql_data[$i]['right_id'] = $right_id; |
|
239 | + $sql_data[$i]['depth'] = $depth; |
|
240 | 240 | |
241 | 241 | if ($row['parent_id']) |
242 | 242 | { |
243 | - $left_id = $sql_data[$row['parent_id']]['right_id']; |
|
244 | - $right_id = $left_id + 1; |
|
243 | + $left_id = $sql_data[$row['parent_id']]['right_id']; |
|
244 | + $right_id = $left_id + 1; |
|
245 | 245 | |
246 | - $sql_data[$i]['parent_id'] = $row['parent_id']; |
|
247 | - $sql_data[$i]['depth'] = $sql_data[$row['parent_id']]['depth'] + 1; |
|
248 | - $sql_data[$i]['left_id'] = $left_id; |
|
249 | - $sql_data[$i]['right_id'] = $right_id; |
|
246 | + $sql_data[$i]['parent_id'] = $row['parent_id']; |
|
247 | + $sql_data[$i]['depth'] = $sql_data[$row['parent_id']]['depth'] + 1; |
|
248 | + $sql_data[$i]['left_id'] = $left_id; |
|
249 | + $sql_data[$i]['right_id'] = $right_id; |
|
250 | 250 | |
251 | 251 | $this->update_right_side($sql_data, $right_id, $row['parent_id'], $branch); |
252 | 252 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->db->sql_transaction('rollback'); |
273 | 273 | $this->lock->release(); |
274 | 274 | |
275 | - throw new \RuntimeException($this->message_prefix . 'INVALID_PARENT'); |
|
275 | + throw new \RuntimeException($this->message_prefix.'INVALID_PARENT'); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | // adjust items in affected branch |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | protected function get_max_id($column, $use_sql_where = true) |
301 | 301 | { |
302 | 302 | $sql = "SELECT MAX($column) AS $column |
303 | - FROM {$this->table_name} " . |
|
303 | + FROM {$this->table_name} ". |
|
304 | 304 | (($use_sql_where) ? $this->get_sql_where('WHERE') : ''); |
305 | 305 | $result = $this->db->sql_query($sql); |
306 | 306 | $max_id = $this->db->sql_fetchfield($column); |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | if (!empty($collection)) |
51 | 51 | { |
52 | 52 | return $collection->get_entities(); |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | return array(); |
57 | 56 | } |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | if (!$has_blocks && !$hiding_blocks && !sizeof($ex_positions)) |
89 | 88 | { |
90 | 89 | $this->route_mapper->delete($route); |
91 | - } |
|
92 | - else |
|
90 | + } else |
|
93 | 91 | { |
94 | 92 | $route->set_has_blocks($has_blocks); |
95 | 93 | $this->route_mapper->save($route); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $this->set_display_fields(); |
143 | 143 | |
144 | - $view = 'S_' . strtoupper($this->settings['template']); |
|
144 | + $view = 'S_'.strtoupper($this->settings['template']); |
|
145 | 145 | $post_data = $this->get_post_data($topic_data); |
146 | 146 | $topic_data = array_values($topic_data); |
147 | 147 | |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | 'VIEWS' => $row['topic_views'], |
190 | 190 | 'S_UNREAD_TOPIC' => $this->is_unread_topic($forum_id, $topic_id, $row['topic_last_post_time']), |
191 | 191 | |
192 | - 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&t=$topic_id"), |
|
193 | - 'U_VIEWFORUM' => append_sid($this->phpbb_root_path . 'viewforum.' . $this->php_ext, "f=$forum_id"), |
|
194 | - 'U_NEW_POST' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&t=$topic_id&view=unread") . '#unread', |
|
195 | - 'U_LAST_POST' => append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "f=$forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], |
|
192 | + 'U_VIEWTOPIC' => append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&t=$topic_id"), |
|
193 | + 'U_VIEWFORUM' => append_sid($this->phpbb_root_path.'viewforum.'.$this->php_ext, "f=$forum_id"), |
|
194 | + 'U_NEW_POST' => append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&t=$topic_id&view=unread").'#unread', |
|
195 | + 'U_LAST_POST' => append_sid($this->phpbb_root_path.'viewtopic.'.$this->php_ext, "f=$forum_id&t=$topic_id&p=".$row['topic_last_post_id']).'#p'.$row['topic_last_post_id'], |
|
196 | 196 | )); |
197 | 197 | unset($topic_data[$i], $post_data[$topic_id]); |
198 | 198 | } |
@@ -178,8 +178,7 @@ |
||
178 | 178 | if (!empty($block['content'])) |
179 | 179 | { |
180 | 180 | $content = $block['content']; |
181 | - } |
|
182 | - else if ($edit_mode) |
|
181 | + } else if ($edit_mode) |
|
183 | 182 | { |
184 | 183 | $content = $this->user->lang('BLOCK_NO_DATA'); |
185 | 184 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (is_array($message)) |
42 | 42 | { |
43 | 43 | $this->message = (string) $message[0]; |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | $this->message = $message; |
48 | 47 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | private function change_user() |
148 | 148 | { |
149 | 149 | $change = false; |
150 | - if ($this->settings['rotation'] == 'pageload' || $this->settings['last_changed'] < strtotime('-1 ' . self::$rotations[$this->settings['rotation']])) |
|
150 | + if ($this->settings['rotation'] == 'pageload' || $this->settings['last_changed'] < strtotime('-1 '.self::$rotations[$this->settings['rotation']])) |
|
151 | 151 | { |
152 | 152 | $this->settings['last_changed'] = time(); |
153 | 153 | $change = true; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | private function get_settings(array $bdata) |
164 | 164 | { |
165 | - $cached_settings = $this->cache->get('pt_block_data_' . $bdata['bid']); |
|
165 | + $cached_settings = $this->cache->get('pt_block_data_'.$bdata['bid']); |
|
166 | 166 | $settings = ($cached_settings && $cached_settings['hash'] === $bdata['hash']) ? $cached_settings : $bdata['settings']; |
167 | 167 | $settings['hash'] = $bdata['hash']; |
168 | 168 | |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | $sql_data = array( |
183 | 183 | 'settings' => json_encode($settings) |
184 | 184 | ); |
185 | - $this->db->sql_query('UPDATE ' . $this->blocks_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_data) . ' WHERE bid = ' . (int) $bid); |
|
186 | - $this->cache->put('pt_block_data_' . $bid, $this->settings); |
|
185 | + $this->db->sql_query('UPDATE '.$this->blocks_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_data).' WHERE bid = '.(int) $bid); |
|
186 | + $this->cache->put('pt_block_data_'.$bid, $this->settings); |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | $rotation = $this->settings['rotation']; |
236 | 236 | |
237 | 237 | $this->ptemplate->assign_vars(array( |
238 | - 'QTYPE_EXPLAIN' => ($query_type == 'posts' || $query_type == 'recent') ? $this->translator->lang('QTYPE_' . strtoupper($query_type)) : '', |
|
239 | - 'TITLE_EXPLAIN' => ($rotation != 'pageload') ? $this->translator->lang(strtoupper($rotation) . '_MEMBER') : '', |
|
238 | + 'QTYPE_EXPLAIN' => ($query_type == 'posts' || $query_type == 'recent') ? $this->translator->lang('QTYPE_'.strtoupper($query_type)) : '', |
|
239 | + 'TITLE_EXPLAIN' => ($rotation != 'pageload') ? $this->translator->lang(strtoupper($rotation).'_MEMBER') : '', |
|
240 | 240 | )); |
241 | 241 | } |
242 | 242 |