@@ -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 | } |
@@ -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 | |
@@ -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 | * @param array $topic_data |
| 69 | 69 | * @param \phpbb\template\twig\twig $template |
| 70 | 70 | */ |
| 71 | - public function build(array $topic_data, \phpbb\template\twig\twig &$template) |
|
| 71 | + public function build(array $topic_data, \phpbb\template\twig\twig & $template) |
|
| 72 | 72 | { |
| 73 | 73 | $this->translator->add_lang('viewtopic'); |
| 74 | 74 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'S_POLL_ACTION' => $viewtopic_url, |
| 101 | 101 | 'S_FORM_TOKEN' => $this->sitemaker->get_form_key('posting'), |
| 102 | 102 | |
| 103 | - 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll', |
|
| 103 | + 'U_VIEW_RESULTS' => $viewtopic_url.'&view=viewpoll', |
|
| 104 | 104 | )); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $post_id = (int) $topic_data['topic_first_post_id']; |
| 172 | 172 | |
| 173 | 173 | $sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid |
| 174 | - FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p |
|
| 174 | + FROM ' . POLL_OPTIONS_TABLE.' o, '.POSTS_TABLE." p |
|
| 175 | 175 | WHERE o.topic_id = $topic_id |
| 176 | 176 | AND p.post_id = $post_id |
| 177 | 177 | AND p.topic_id = o.topic_id |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * @param int $poll_most |
| 217 | 217 | * @param \phpbb\template\twig\twig $template |
| 218 | 218 | */ |
| 219 | - private function build_poll_options(array $cur_voted_id, array $poll_info, $poll_total, $poll_most, \phpbb\template\twig\twig &$template) |
|
| 219 | + private function build_poll_options(array $cur_voted_id, array $poll_info, $poll_total, $poll_most, \phpbb\template\twig\twig & $template) |
|
| 220 | 220 | { |
| 221 | 221 | foreach ($poll_info as $poll_option) |
| 222 | 222 | { |
@@ -247,8 +247,8 @@ discard block |
||
| 247 | 247 | if ($this->user->data['is_registered']) |
| 248 | 248 | { |
| 249 | 249 | $sql = 'SELECT poll_option_id |
| 250 | - FROM ' . POLL_VOTES_TABLE . ' |
|
| 251 | - WHERE topic_id = ' . (int) $topic_id . ' |
|
| 250 | + FROM ' . POLL_VOTES_TABLE.' |
|
| 251 | + WHERE topic_id = ' . (int) $topic_id.' |
|
| 252 | 252 | AND vote_user_id = ' . $this->user->data['user_id']; |
| 253 | 253 | $result = $this->db->sql_query($sql); |
| 254 | 254 | |
@@ -263,9 +263,9 @@ discard block |
||
| 263 | 263 | // Cookie based guest tracking ... I don't like this but hum ho |
| 264 | 264 | // it's oft requested. This relies on "nice" users who don't feel |
| 265 | 265 | // the need to delete cookies to mess with results. |
| 266 | - if ($this->request->is_set($this->config['cookie_name'] . '_poll_' . $topic_id, \phpbb\request\request_interface::COOKIE)) |
|
| 266 | + if ($this->request->is_set($this->config['cookie_name'].'_poll_'.$topic_id, \phpbb\request\request_interface::COOKIE)) |
|
| 267 | 267 | { |
| 268 | - $cur_voted_id = explode(',', $this->request->variable($this->config['cookie_name'] . '_poll_' . $topic_id, '', true, \phpbb\request\request_interface::COOKIE)); |
|
| 268 | + $cur_voted_id = explode(',', $this->request->variable($this->config['cookie_name'].'_poll_'.$topic_id, '', true, \phpbb\request\request_interface::COOKIE)); |
|
| 269 | 269 | $cur_voted_id = array_map('intval', $cur_voted_id); |
| 270 | 270 | } |
| 271 | 271 | } |
@@ -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 | /** |