Passed
Branch master (72c87d)
by Tobias
03:18
created
event/listener.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -531,7 +531,7 @@
 block discarded – undo
531 531
 	/**
532 532
 	 * Get the topics post count or the forums post/topic count based on permissions
533 533
 	 *
534
-	 * @param $mode            string    One of topic_posts, forum_posts or forum_topics
534
+	 * @param string $mode            string    One of topic_posts, forum_posts or forum_topics
535 535
 	 * @param $data            array    Array with the topic/forum data to calculate from
536 536
 	 * @param $forum_id        int        The forum id is used for permission checks
537 537
 	 * @return int    Number of posts/topics the user can see in the topic/forum
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			'core.display_forums_modify_forum_rows'		=> 'display_forums_modify_forum_rows',
78 78
 			'core.display_forums_modify_sql'			=> 'display_forums_modify_sql',
79 79
 			'core.generate_forum_nav'				=> 'generate_forum_nav',
80
-			'core.make_jumpbox_modify_tpl_ary'			=> 'make_jumpbox_modify_tpl_ary',				// Not in phpBB
80
+			'core.make_jumpbox_modify_tpl_ary'			=> 'make_jumpbox_modify_tpl_ary', // Not in phpBB
81 81
 			'core.pagination_generate_page_link'		=> 'pagination_generate_page_link',
82 82
 			'core.search_modify_tpl_ary'				=> 'search_modify_tpl_ary',
83 83
 			'core.viewforum_modify_topicrow'			=> 'viewforum_modify_topicrow',
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 		$forum_rows = $event['forum_rows'];
126 126
 		if ($event['row']['forum_last_post_time'] == $forum_rows[$event['parent_id']]['forum_last_post_time'])
127 127
 		{
128
-			$forum_rows[$event['parent_id']]['forum_name_last_post'] =$event['row']['forum_name'];
129
-			$forum_rows[$event['parent_id']]['topic_id_last_post'] =$event['row']['topic_id'];
130
-			$forum_rows[$event['parent_id']]['topic_title_last_post'] =$event['row']['topic_title'];
128
+			$forum_rows[$event['parent_id']]['forum_name_last_post'] = $event['row']['forum_name'];
129
+			$forum_rows[$event['parent_id']]['topic_id_last_post'] = $event['row']['topic_id'];
130
+			$forum_rows[$event['parent_id']]['topic_title_last_post'] = $event['row']['topic_title'];
131 131
 			$event['forum_rows'] = $forum_rows;
132 132
 		}
133 133
 	}
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 
158 158
 		// Update the image source in forums
159 159
 		$img = $this->path_helper->update_web_root_path($forum_row['FORUM_IMAGE_SRC']);
160
-		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="' . $img . '" alt', $forum_row['FORUM_IMAGE']);
160
+		$forum_row['FORUM_IMAGE'] = preg_replace('#img src=\"(.*)\" alt#', 'img src="'.$img.'" alt', $forum_row['FORUM_IMAGE']);
161 161
 
162 162
 		// Rewrite links to topics, posts and forums
163 163
 		$replies = $this->get_count('topic_posts', $event['row'], $event['row']['forum_id']) - 1;
164 164
 		$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']);
165
-		$forum_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url) . '#p' . $event['row']['forum_last_post_id']);
165
+		$forum_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url).'#p'.$event['row']['forum_last_post_id']);
166 166
 		$forum_row['U_VIEWFORUM'] = append_sid($this->generate_forum_link($forum_row['FORUM_ID'], $forum_row['FORUM_NAME']));
167 167
 		$event['forum_row'] = $forum_row;
168 168
 	}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 		foreach ($navlinks_parents as $id => $data)
184 184
 		{
185
-			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($data['FORUM_ID'] , $data['FORUM_NAME']));
185
+			$navlinks_parents[$id]['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($data['FORUM_ID'], $data['FORUM_NAME']));
186 186
 		}
187 187
 
188 188
 		$navlinks['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($forum_data['forum_id'], $forum_data['forum_name']));
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		foreach ($tpl_ary as $id => $data)
199 199
 		{
200 200
 
201
-			$tpl_ary[$id]['LINK']	 = append_sid($this->generate_forum_link($row['forum_id'], $row['forum_name']));
201
+			$tpl_ary[$id]['LINK'] = append_sid($this->generate_forum_link($row['forum_id'], $row['forum_name']));
202 202
 		}
203 203
 
204 204
 		$event['tpl_ary'] = $tpl_ary;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		$url = $this->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']);
246 246
 
247 247
 		$tpl_ary = $event['tpl_ary'];
248
-		$tpl_ary['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url) . '#p' . $event['row']['topic_last_post_id']);
248
+		$tpl_ary['U_LAST_POST'] = append_sid($this->generate_lastpost_link($replies, $url).'#p'.$event['row']['topic_last_post_id']);
249 249
 		$tpl_ary['U_VIEW_TOPIC'] = append_sid($this->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']));
250 250
 		$tpl_ary['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($event['row']['forum_id'], $event['row']['forum_name']));
251 251
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
 		$topic_row['U_VIEW_TOPIC'] = append_sid($this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title));
271 271
 		$topic_row['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($this->forum_id, $this->forum_title));
272
-		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($event['topic_row']['REPLIES'], $topic_row['U_VIEW_TOPIC']) . '#p' . $event['row']['topic_last_post_id']);
272
+		$topic_row['U_LAST_POST'] = append_sid($this->generate_lastpost_link($event['topic_row']['REPLIES'], $topic_row['U_VIEW_TOPIC']).'#p'.$event['row']['topic_last_post_id']);
273 273
 
274 274
 		$event['topic_row'] = $topic_row;
275 275
 	}
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
 	{
304 304
 		$data = $event['topic_data'];
305 305
 		$this->template->assign_vars(array(
306
-			'U_VIEW_TOPIC'		=> append_sid($this->generate_topic_link($event['forum_id'] , $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
307
-			'U_VIEW_FORUM'	=> append_sid($this->generate_forum_link($event['forum_id'] , $data['forum_name'])),
306
+			'U_VIEW_TOPIC'		=> append_sid($this->generate_topic_link($event['forum_id'], $data['forum_name'], $event['topic_id'], $data['topic_title'], $event['start'])),
307
+			'U_VIEW_FORUM'	=> append_sid($this->generate_forum_link($event['forum_id'], $data['forum_name'])),
308 308
 		));
309 309
 	}
310 310
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 		$row = $event['post_row'];
352 352
 		$start = $this->request->variable('start', 0);
353 353
 		$data = $event['topic_data'];
354
-		$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']);
354
+		$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']);
355 355
 		$event['post_row'] = $row;
356 356
 	}
357 357
 
@@ -370,14 +370,14 @@  discard block
 block discarded – undo
370 370
 			return;
371 371
 		}
372 372
 
373
-		$url_data =$event['url_data'] ;
373
+		$url_data = $event['url_data'];
374 374
 
375 375
 		foreach ($url_data as $id => $data)
376 376
 		{
377 377
 			$row = $data['row'];
378 378
 			if (isset($row['topic_id']))
379 379
 			{
380
-				$url_data[$id]['url'] = $this->generate_topic_link($row['forum_id'], $row['forum_name'], $row['topic_id'], $row['topic_title'],  $data['start'], true);
380
+				$url_data[$id]['url'] = $this->generate_topic_link($row['forum_id'], $row['forum_name'], $row['topic_id'], $row['topic_title'], $data['start'], true);
381 381
 			}
382 382
 			else if (isset($row['forum_id']))
383 383
 			{
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 		$this->topic_id = $event['row']['topic_id'];
404 404
 
405 405
 		$topic_row = $event['topic_row'];
406
-		$u_view_topic= $this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title);
406
+		$u_view_topic = $this->generate_topic_link($this->forum_id, $this->forum_title, $this->topic_id, $this->topic_title);
407 407
 		$topic_row['U_VIEW_TOPIC'] = append_sid($u_view_topic);
408 408
 		$topic_row['U_VIEW_FORUM'] = append_sid($this->generate_forum_link($this->forum_id, $this->forum_title));
409
-		$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']);
409
+		$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']);
410 410
 		$event['topic_row'] = $topic_row;
411 411
 	}
412 412
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		$tpl_ary = $event['tpl_ary'];
438 438
 		$replies = $this->get_count('topic_posts', $event['row'], $event['row']['forum_id']) - 1;
439 439
 		$u_view_topic = $this->generate_topic_link($event['row']['forum_id'], $event['row']['forum_name'], $event['row']['topic_id'], $event['row']['topic_title']);
440
-		$tpl_ary['U_TOPIC'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic) . '#p' . $event['row']['topic_last_post_id']);
440
+		$tpl_ary['U_TOPIC'] = append_sid($this->generate_lastpost_link($replies, $u_view_topic).'#p'.$event['row']['topic_last_post_id']);
441 441
 		$event['tpl_ary'] = $tpl_ary;
442 442
 	}
443 443
 
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
 	{
458 458
 		if ($full)
459 459
 		{
460
-			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';
460
+			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';
461 461
 		}
462
-		return $this->path_helper->update_web_root_path($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');
462
+		return $this->path_helper->update_web_root_path($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');
463 463
 	}
464 464
 
465 465
 	/**
@@ -476,9 +476,9 @@  discard block
 block discarded – undo
476 476
 	{
477 477
 		if ($full)
478 478
 		{
479
-			return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
479
+			return generate_board_url().'/'.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.($start ? 'index-s'.$start.'.html' : '');
480 480
 		}
481
-		return $this->path_helper->update_web_root_path($this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : ''));
481
+		return $this->path_helper->update_web_root_path($this->phpbb_root_path.$this->title_to_url($forum_name).'-f'.$forum_id.'/'.($start ? 'index-s'.$start.'.html' : ''));
482 482
 	}
483 483
 
484 484
 	/**
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
 		{
497 497
 			for ($j = 0; $j < $replies + 1; $j += $per_page)
498 498
 			{
499
-				$last_post_link = $url . '-s' . $j . '.html';
499
+				$last_post_link = $url.'-s'.$j.'.html';
500 500
 			}
501 501
 		}
502 502
 		else
503 503
 		{
504
-			$last_post_link = $url . '.html';
504
+			$last_post_link = $url.'.html';
505 505
 		}
506 506
 		return $last_post_link;
507 507
 	}
@@ -540,10 +540,10 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		if (!$this->auth->acl_get('m_approve', $forum_id))
542 542
 		{
543
-			return (int) $data[$mode . '_approved'];
543
+			return (int) $data[$mode.'_approved'];
544 544
 		}
545 545
 
546
-		return (int) $data[$mode . '_approved'] + (int) $data[$mode . '_unapproved'] + (int) $data[$mode . '_softdeleted'];
546
+		return (int) $data[$mode.'_approved'] + (int) $data[$mode.'_unapproved'] + (int) $data[$mode.'_softdeleted'];
547 547
 	}
548 548
 
549 549
 }
Please login to merge, or discard this patch.