Test Setup Failed
Branch master (345fb2)
by Tobias
02:00
created
event/listener.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			'core.display_forums_modify_forum_rows'					=> 'display_forums_modify_forum_rows',
74 74
 			'core.display_forums_modify_category_template_vars'		=> 'display_forums_modify_category_template_vars',
75 75
 			'core.generate_forum_nav'								=> 'generate_forum_nav',
76
-			'core.make_jumpbox_modify_tpl_ary'						=> 'make_jumpbox_modify_tpl_ary',				// Not in phpBB
76
+			'core.make_jumpbox_modify_tpl_ary'						=> 'make_jumpbox_modify_tpl_ary', // Not in phpBB
77 77
 			'core.memberlist_view_profile'							=> 'memberlist_view_profile',
78 78
 			'core.pagination_generate_page_link'					=> 'pagination_generate_page_link',
79 79
 			'core.search_modify_tpl_ary'							=> 'search_modify_tpl_ary',
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function append_sid($event)
100 100
 	{
101
-		if ($this->in_viewtopic && preg_match('#./../viewtopic.' . $this->php_ext  . '#', $event['url']))
101
+		if ($this->in_viewtopic && preg_match('#./../viewtopic.'.$this->php_ext.'#', $event['url']))
102 102
 		{
103
-			$url = '../viewtopic.' . $this->php_ext ;
103
+			$url = '../viewtopic.'.$this->php_ext;
104 104
 			$event['url'] = $url;
105 105
 		}
106 106
 		if (isset($event['params']['redirect']))
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$forum_rows = $event['forum_rows'];
142 142
 		if ($event['row']['forum_last_post_time'] == $forum_rows[$event['parent_id']]['forum_last_post_time'])
143 143
 		{
144
-			$forum_rows[$event['parent_id']]['forum_name_last_post'] =$event['row']['forum_name'];
145
-			$forum_rows[$event['parent_id']]['topic_id_last_post'] =$event['row']['topic_id'];
146
-			$forum_rows[$event['parent_id']]['topic_title_last_post'] =$event['row']['topic_title'];
144
+			$forum_rows[$event['parent_id']]['forum_name_last_post'] = $event['row']['forum_name'];
145
+			$forum_rows[$event['parent_id']]['topic_id_last_post'] = $event['row']['topic_id'];
146
+			$forum_rows[$event['parent_id']]['topic_title_last_post'] = $event['row']['topic_title'];
147 147
 			$event['forum_rows'] = $forum_rows;
148 148
 		}
149 149
 	}
@@ -172,14 +172,14 @@  discard block
 block discarded – undo
172 172
 
173 173
 		// Update the image source in forums
174 174
 		$img = $this->path_helper->update_web_root_path($forum_row['FORUM_IMAGE_SRC']);
175
-		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="' . $img . '" alt', $forum_row['FORUM_IMAGE']);
175
+		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="'.$img.'" alt', $forum_row['FORUM_IMAGE']);
176 176
 
177 177
 		// Rewrite links to topics, posts and forums
178 178
 		$replies = $this->base->get_count('topic_posts', $event['row'], $event['row']['forum_id']) - 1;
179 179
 		$url = $this->base->generate_topic_link($event['row']['forum_id_last_post'], $event['row']['forum_name_last_post'], $event['row']['topic_id_last_post'], $event['row']['topic_title_last_post']);
180
-		$forum_row['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($replies, $url) . '#p' . $event['row']['forum_last_post_id']);
180
+		$forum_row['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($replies, $url).'#p'.$event['row']['forum_last_post_id']);
181 181
 		$forum_row['U_VIEWFORUM'] = append_sid($this->base->generate_forum_link($forum_row['FORUM_ID'], $forum_row['FORUM_NAME']));
182
-		$forum_row['U_NEWEST_POST'] = $url . '?view=unread#unread';
182
+		$forum_row['U_NEWEST_POST'] = $url.'?view=unread#unread';
183 183
 
184 184
 		$event['subforums_row'] = $subforums_row;
185 185
 		$event['forum_row'] = $forum_row;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 		foreach ($navlinks_parents as $id => $data)
217 217
 		{
218
-			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->base->generate_forum_link($data['FORUM_ID'] , $data['FORUM_NAME']));
218
+			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->base->generate_forum_link($data['FORUM_ID'], $data['FORUM_NAME']));
219 219
 		}
220 220
 
221 221
 		$navlinks['U_VIEW_FORUM'] = append_sid($this->base->generate_forum_link($forum_data['forum_id'], $forum_data['forum_name']));
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		$row = $event['row'];
231 231
 		foreach ($tpl_ary as $id => $data)
232 232
 		{
233
-			$tpl_ary[$id]['LINK']	 = append_sid($this->base->generate_forum_link($row['forum_id'], $row['forum_name']));
233
+			$tpl_ary[$id]['LINK'] = append_sid($this->base->generate_forum_link($row['forum_id'], $row['forum_name']));
234 234
 		}
235 235
 
236 236
 		$event['tpl_ary'] = $tpl_ary;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function pagination_generate_page_link($event)
263 263
 	{
264
-		if(!is_string($event['base_url']))
264
+		if (!is_string($event['base_url']))
265 265
 		{
266 266
 			return;
267 267
 		}
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
 		$u_view_topic = $this->base->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']);
298 298
 
299 299
 		$tpl_ary = $event['tpl_ary'];
300
-		$tpl_ary['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($replies, $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
300
+		$tpl_ary['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($replies, $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
301 301
 		$tpl_ary['U_VIEW_TOPIC'] = append_sid($u_view_topic);
302 302
 		$tpl_ary['U_VIEW_FORUM'] = append_sid($this->base->generate_forum_link($event['row']['forum_id'], $event['row']['forum_name']));
303
-		$tpl_ary['U_NEWEST_POST'] = $u_view_topic . '?view=unread#unread';
303
+		$tpl_ary['U_NEWEST_POST'] = $u_view_topic.'?view=unread#unread';
304 304
 
305 305
 		$event['tpl_ary'] = $tpl_ary;
306 306
 	}
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 		$u_view_topic = $this->base->generate_topic_link($row['forum_id'], $topic_row['FORUM_NAME'], $row['topic_id'], $row['topic_title']);
329 329
 		$topic_row['U_VIEW_TOPIC'] = append_sid($u_view_topic);
330 330
 		$topic_row['U_VIEW_FORUM'] = append_sid($this->base->generate_forum_link($row['forum_id'], $topic_row['FORUM_NAME']));
331
-		$topic_row['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($event['topic_row']['REPLIES'], $u_view_topic) . '#p' . $row['topic_last_post_id']);
332
-		$topic_row['U_NEWEST_POST'] = $u_view_topic . '?view=unread#unread';
331
+		$topic_row['U_LAST_POST'] = append_sid($this->base->generate_lastpost_link($event['topic_row']['REPLIES'], $u_view_topic).'#p'.$row['topic_last_post_id']);
332
+		$topic_row['U_NEWEST_POST'] = $u_view_topic.'?view=unread#unread';
333 333
 
334 334
 		$event['topic_row'] = $topic_row;
335 335
 	}
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 	{
383 383
 		$data = $event['topic_data'];
384 384
 		$this->template->assign_vars(array(
385
-			'U_VIEW_TOPIC'		=> append_sid($this->base->generate_topic_link($event['forum_id'] , $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
386
-			'U_VIEW_FORUM'		=> append_sid($this->base->generate_forum_link($event['forum_id'] , $data['forum_name'])),
387
-			'S_POLL_ACTION'		=> append_sid($this->base->generate_topic_link($event['forum_id'] , $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
385
+			'U_VIEW_TOPIC'		=> append_sid($this->base->generate_topic_link($event['forum_id'], $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
386
+			'U_VIEW_FORUM'		=> append_sid($this->base->generate_forum_link($event['forum_id'], $data['forum_name'])),
387
+			'S_POLL_ACTION'		=> append_sid($this->base->generate_topic_link($event['forum_id'], $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
388 388
 		));
389 389
 	}
390 390
 
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 		$row = $event['post_row'];
440 440
 		$start = $this->request->variable('start', 0);
441 441
 		$data = $event['topic_data'];
442
-		$viewtopic_url = $this->base->generate_topic_link($data['forum_id'], $data['forum_name'], $data['topic_id'], $data['topic_title'], $start) . '#p' . $event['row']['post_id'];
442
+		$viewtopic_url = $this->base->generate_topic_link($data['forum_id'], $data['forum_name'], $data['topic_id'], $data['topic_title'], $start).'#p'.$event['row']['post_id'];
443 443
 		$row['U_MINI_POST'] = append_sid($viewtopic_url);
444
-		$row['U_APPROVE_ACTION'] = append_sid(generate_board_url() . '/' . "mcp.{$this->php_ext}", "i=queue&p={$data['post_id']}&f={$data['forum_id']}&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)));
444
+		$row['U_APPROVE_ACTION'] = append_sid(generate_board_url().'/'."mcp.{$this->php_ext}", "i=queue&p={$data['post_id']}&f={$data['forum_id']}&redirect=".urlencode(str_replace('&', '&', $viewtopic_url)));
445 445
 		$event['post_row'] = $row;
446 446
 	}
447 447
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 			if ($event['extensions'][$event['attachment']['extension']]['upload_icon'])
460 460
 			{
461 461
 				$block_array = $event['block_array'];
462
-				$upload_icon = '<img src="' . generate_board_url() . '/' . $this->base->config['upload_icons_path'] . '/' . trim($event['extensions'][$event['attachment']['extension']]['upload_icon']) . '" alt="" />';
462
+				$upload_icon = '<img src="'.generate_board_url().'/'.$this->base->config['upload_icons_path'].'/'.trim($event['extensions'][$event['attachment']['extension']]['upload_icon']).'" alt="" />';
463 463
 				$block_array['UPLOAD_ICON'] = $upload_icon;
464 464
 				$event['block_array'] = $block_array;
465 465
 			}
Please login to merge, or discard this patch.