Completed
Pull Request — master (#28)
by Tobias
02:41
created
event/listener.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			'core.display_forums_modify_forum_rows'		=> 'display_forums_modify_forum_rows',
84 84
 			'core.display_forums_modify_sql'			=> 'display_forums_modify_sql',
85 85
 			'core.generate_forum_nav'				=> 'generate_forum_nav',
86
-			'core.make_jumpbox_modify_tpl_ary'			=> 'make_jumpbox_modify_tpl_ary',				// Not in phpBB
86
+			'core.make_jumpbox_modify_tpl_ary'			=> 'make_jumpbox_modify_tpl_ary', // Not in phpBB
87 87
 			'core.pagination_generate_page_link'		=> 'pagination_generate_page_link',
88 88
 			'core.search_modify_tpl_ary'				=> 'search_modify_tpl_ary',
89 89
 			'core.viewforum_modify_topicrow'			=> 'viewforum_modify_topicrow',
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	public function append_sid($event)
112 112
 	{
113
-		if (preg_match('#./../viewtopic.' . $this->php_ext  . '#', $event['url']))
113
+		if (preg_match('#./../viewtopic.'.$this->php_ext.'#', $event['url']))
114 114
 		{
115
-			$url = $this->phpbb_root_path . 'viewtopic.' . $this->php_ext ;
115
+			$url = $this->phpbb_root_path.'viewtopic.'.$this->php_ext;
116 116
 			$event['url'] = $url;
117 117
 		}
118 118
 	}
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 		$forum_rows = $event['forum_rows'];
148 148
 		if ($event['row']['forum_last_post_time'] == $forum_rows[$event['parent_id']]['forum_last_post_time'])
149 149
 		{
150
-			$forum_rows[$event['parent_id']]['forum_name_last_post'] =$event['row']['forum_name'];
151
-			$forum_rows[$event['parent_id']]['topic_id_last_post'] =$event['row']['topic_id'];
152
-			$forum_rows[$event['parent_id']]['topic_title_last_post'] =$event['row']['topic_title'];
150
+			$forum_rows[$event['parent_id']]['forum_name_last_post'] = $event['row']['forum_name'];
151
+			$forum_rows[$event['parent_id']]['topic_id_last_post'] = $event['row']['topic_id'];
152
+			$forum_rows[$event['parent_id']]['topic_title_last_post'] = $event['row']['topic_title'];
153 153
 			$event['forum_rows'] = $forum_rows;
154 154
 		}
155 155
 	}
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
 
180 180
 		// Update the image source in forums
181 181
 		$img = $this->path_helper->update_web_root_path($forum_row['FORUM_IMAGE_SRC']);
182
-		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="' . $img . '" alt', $forum_row['FORUM_IMAGE']);
182
+		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="'.$img.'" alt', $forum_row['FORUM_IMAGE']);
183 183
 
184 184
 		// Rewrite links to topics, posts and forums
185 185
 		$replies = $this->get_count('topic_posts', $event['row'], $event['row']['forum_id']) - 1;
186 186
 		$url = $this->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']);
187
-		$forum_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url) . '#p' . $event['row']['forum_last_post_id']);
187
+		$forum_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url).'#p'.$event['row']['forum_last_post_id']);
188 188
 		$forum_row['U_VIEWFORUM'] = append_sid($this->generate_forum_link($forum_row['FORUM_ID'], $forum_row['FORUM_NAME']));
189 189
 		$event['forum_row'] = $forum_row;
190 190
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
 		foreach ($navlinks_parents as $id => $data)
206 206
 		{
207
-			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($data['FORUM_ID'] , $data['FORUM_NAME']));
207
+			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($data['FORUM_ID'], $data['FORUM_NAME']));
208 208
 		}
209 209
 
210 210
 		$navlinks['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($forum_data['forum_id'], $forum_data['forum_name']));
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		foreach ($tpl_ary as $id => $data)
221 221
 		{
222 222
 
223
-			$tpl_ary[$id]['LINK']	 = append_sid($this->generate_forum_link($row['forum_id'], $row['forum_name']));
223
+			$tpl_ary[$id]['LINK'] = append_sid($this->generate_forum_link($row['forum_id'], $row['forum_name']));
224 224
 		}
225 225
 
226 226
 		$event['tpl_ary'] = $tpl_ary;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		$u_view_topic = $this->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']);
268 268
 
269 269
 		$tpl_ary = $event['tpl_ary'];
270
-		$tpl_ary['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
270
+		$tpl_ary['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
271 271
 		$tpl_ary['U_VIEW_TOPIC'] = append_sid($u_view_topic);
272 272
 		$tpl_ary['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($event['row']['forum_id'], $event['row']['forum_name']));
273 273
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		$u_view_topic = $this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title);
293 293
 		$topic_row['U_VIEW_TOPIC'] = append_sid($u_view_topic);
294 294
 		$topic_row['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($this->forum_id, $this->forum_title));
295
-		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($event['topic_row']['REPLIES'], $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
295
+		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($event['topic_row']['REPLIES'], $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
296 296
 
297 297
 		$event['topic_row'] = $topic_row;
298 298
 	}
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 	{
327 327
 		$data = $event['topic_data'];
328 328
 		$this->template->assign_vars(array(
329
-			'U_VIEW_TOPIC'		=> append_sid($this->generate_topic_link($event['forum_id'] , $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
330
-			'U_VIEW_FORUM'	=> append_sid($this->generate_forum_link($event['forum_id'] , $data['forum_name'])),
329
+			'U_VIEW_TOPIC'		=> append_sid($this->generate_topic_link($event['forum_id'], $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
330
+			'U_VIEW_FORUM'	=> append_sid($this->generate_forum_link($event['forum_id'], $data['forum_name'])),
331 331
 		));
332 332
 	}
333 333
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 		$row = $event['post_row'];
375 375
 		$start = $this->request->variable('start', 0);
376 376
 		$data = $event['topic_data'];
377
-		$row['U_MINI_POST'] = append_sid($this->generate_topic_link($data['forum_id'], $data['forum_name'], $data['topic_id'], $data['topic_title'], $start) . '#p' . $event['row']['post_id']);
377
+		$row['U_MINI_POST'] = append_sid($this->generate_topic_link($data['forum_id'], $data['forum_name'], $data['topic_id'], $data['topic_title'], $start).'#p'.$event['row']['post_id']);
378 378
 		$event['post_row'] = $row;
379 379
 	}
380 380
 
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
 			return;
394 394
 		}
395 395
 
396
-		$url_data =$event['url_data'] ;
396
+		$url_data = $event['url_data'];
397 397
 
398 398
 		foreach ($url_data as $id => $data)
399 399
 		{
400 400
 			$row = $data['row'];
401 401
 			if (isset($row['topic_id']))
402 402
 			{
403
-				$url_data[$id]['url'] = $this->generate_topic_link($row['forum_id'], $row['forum_name'], $row['topic_id'], $row['topic_title'],  $data['start'], true);
403
+				$url_data[$id]['url'] = $this->generate_topic_link($row['forum_id'], $row['forum_name'], $row['topic_id'], $row['topic_title'], $data['start'], true);
404 404
 			}
405 405
 			else if (isset($row['forum_id']))
406 406
 			{
@@ -426,10 +426,10 @@  discard block
 block discarded – undo
426 426
 		$this->topic_id = $event['row']['topic_id'];
427 427
 
428 428
 		$topic_row = $event['topic_row'];
429
-		$u_view_topic= $this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title);
429
+		$u_view_topic = $this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title);
430 430
 		$topic_row['U_VIEW_TOPIC'] = append_sid($u_view_topic);
431 431
 		$topic_row['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($this->forum_id, $this->forum_title));
432
-		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($topic_row['TOPIC_REPLIES'], $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
432
+		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($topic_row['TOPIC_REPLIES'], $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
433 433
 		$event['topic_row'] = $topic_row;
434 434
 	}
435 435
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 		$tpl_ary = $event['tpl_ary'];
461 461
 		$replies = $this->get_count('topic_posts', $event['row'], $event['row']['forum_id']) - 1;
462 462
 		$u_view_topic = $this->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']);
463
-		$tpl_ary['U_TOPIC'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
463
+		$tpl_ary['U_TOPIC'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
464 464
 		$event['tpl_ary'] = $tpl_ary;
465 465
 	}
466 466
 
@@ -480,9 +480,9 @@  discard block
 block discarded – undo
480 480
 	{
481 481
 		if ($full)
482 482
 		{
483
-			return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html';
483
+			return generate_board_url().'/'.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.$this->title_to_url($topic_title).'-t'.$topic_id.($start ? '-s'.$start : '').'.html';
484 484
 		}
485
-		return $this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html';
485
+		return $this->phpbb_root_path.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.$this->title_to_url($topic_title).'-t'.$topic_id.($start ? '-s'.$start : '').'.html';
486 486
 	}
487 487
 
488 488
 	/**
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	{
500 500
 		if ($full)
501 501
 		{
502
-			return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
502
+			return generate_board_url().'/'.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.($start ? 'index-s'.$start.'.html' : '');
503 503
 		}
504
-		return $this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
504
+		return $this->phpbb_root_path.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.($start ? 'index-s'.$start.'.html' : '');
505 505
 	}
506 506
 
507 507
 	/**
@@ -519,12 +519,12 @@  discard block
 block discarded – undo
519 519
 		{
520 520
 			for ($j = 0; $j < $replies + 1; $j += $per_page)
521 521
 			{
522
-				$last_post_link = $url . '-s' . $j . '.html';
522
+				$last_post_link = $url.'-s'.$j.'.html';
523 523
 			}
524 524
 		}
525 525
 		else
526 526
 		{
527
-			$last_post_link = $url . '.html';
527
+			$last_post_link = $url.'.html';
528 528
 		}
529 529
 		return $last_post_link;
530 530
 	}
@@ -563,10 +563,10 @@  discard block
 block discarded – undo
563 563
 	{
564 564
 		if (!$this->auth->acl_get('m_approve', $forum_id))
565 565
 		{
566
-			return (int) $data[$mode . '_approved'];
566
+			return (int) $data[$mode.'_approved'];
567 567
 		}
568 568
 
569
-		return (int) $data[$mode . '_approved'] + (int) $data[$mode . '_unapproved'] + (int) $data[$mode . '_softdeleted'];
569
+		return (int) $data[$mode.'_approved'] + (int) $data[$mode.'_unapproved'] + (int) $data[$mode.'_softdeleted'];
570 570
 	}
571 571
 
572 572
 }
Please login to merge, or discard this patch.