@@ -118,8 +118,7 @@ |
||
118 | 118 | if (isset(self::$is_dynamic[$name])) |
119 | 119 | { |
120 | 120 | $config->set('phpbb_gallery_' . $name, $value, true); |
121 | - } |
|
122 | - else |
|
121 | + } else |
|
123 | 122 | { |
124 | 123 | $config->set('phpbb_gallery_' . $name, $value); |
125 | 124 | } |
@@ -89,8 +89,7 @@ |
||
89 | 89 | if (is_dir($file)) |
90 | 90 | { |
91 | 91 | $this->recursiveRemoveDirectory($file); |
92 | - } |
|
93 | - else |
|
92 | + } else |
|
94 | 93 | { |
95 | 94 | unlink($file); |
96 | 95 | } |
@@ -111,8 +111,7 @@ |
||
111 | 111 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_image'); |
112 | 112 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_comment'); |
113 | 113 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_report'); |
114 | - } |
|
115 | - catch (\phpbb\notification\exception $e) |
|
114 | + } catch (\phpbb\notification\exception $e) |
|
116 | 115 | { |
117 | 116 | // continue |
118 | 117 | } |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | if (isset($this->config['phpbb_gallery_' . $option])) |
148 | 148 | { |
149 | 149 | $config_ary[$option] = $this->config['phpbb_gallery_' . $option]; |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | $config_ary[$option] = $default; |
154 | 153 | } |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | if (isset($this->config['phpbb_gallery_' . $key])) |
162 | 161 | { |
163 | 162 | return $this->config['phpbb_gallery_' . $key]; |
164 | - } |
|
165 | - else |
|
163 | + } else |
|
166 | 164 | { |
167 | 165 | return $this->configs_array[$key]; |
168 | 166 | } |
@@ -149,8 +149,7 @@ discard block |
||
149 | 149 | if (!$sql_limit) |
150 | 150 | { |
151 | 151 | $result = $this->db->sql_query($sql); |
152 | - } |
|
153 | - else |
|
152 | + } else |
|
154 | 153 | { |
155 | 154 | $result = $this->db->sql_query_limit($sql, $sql_limit); |
156 | 155 | } |
@@ -446,8 +445,7 @@ discard block |
||
446 | 445 | 'BLOCK_NAME' => $block_name ? $block_name : '' , |
447 | 446 | 'U_BLOCK' => $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'), |
448 | 447 | )); |
449 | - } |
|
450 | - else |
|
448 | + } else |
|
451 | 449 | { |
452 | 450 | $this->template->assign_block_vars('imageblock', array( |
453 | 451 | 'BLOCK_NAME' => $block_name ? $block_name : $this->language->lang('RECENT_IMAGES'), |
@@ -505,8 +503,7 @@ discard block |
||
505 | 503 | 'phpbbgallery_core_search_egosearch_page',), |
506 | 504 | 'params' => array()), 'pagination', 'page', $count, $limit, $start |
507 | 505 | ); |
508 | - } |
|
509 | - else |
|
506 | + } else |
|
510 | 507 | { |
511 | 508 | $this->template->assign_vars(array( |
512 | 509 | 'TOTAL_IMAGES' => $this->language->lang('VIEW_ALBUM_IMAGES', $count), |
@@ -161,8 +161,7 @@ discard block |
||
161 | 161 | if (isset($this->image_size['file'])) |
162 | 162 | { |
163 | 163 | $file_size = $this->image_size['file']; |
164 | - } |
|
165 | - else if ($force_filesize) |
|
164 | + } else if ($force_filesize) |
|
166 | 165 | { |
167 | 166 | $file_size = @filesize($this->image_source); |
168 | 167 | } |
@@ -296,8 +295,7 @@ discard block |
||
296 | 295 | { |
297 | 296 | $this->thumb_height = $max_height; |
298 | 297 | $this->thumb_width = round($max_width * (($this->image_size['width'] / $max_width) / ($this->image_size['height'] / $max_height))); |
299 | - } |
|
300 | - else |
|
298 | + } else |
|
301 | 299 | { |
302 | 300 | $this->thumb_height = round($max_height * (($this->image_size['height'] / $max_height) / ($this->image_size['width'] / $max_width))); |
303 | 301 | $this->thumb_width = $max_width; |
@@ -407,8 +405,7 @@ discard block |
||
407 | 405 | { |
408 | 406 | $this->image_source = $get_wm_name; |
409 | 407 | $this->read_image(); |
410 | - } |
|
411 | - else |
|
408 | + } else |
|
412 | 409 | { |
413 | 410 | $this->watermark_size = getimagesize($this->watermark_source); |
414 | 411 | switch ($this->watermark_size['mime']) |
@@ -437,16 +434,14 @@ discard block |
||
437 | 434 | if ($watermark_position & $phpbb_gallery_constants::WATERMARK_LEFT) |
438 | 435 | { |
439 | 436 | $dst_x = 5; |
440 | - } |
|
441 | - else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT) |
|
437 | + } else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT) |
|
442 | 438 | { |
443 | 439 | $dst_x = ($this->image_size['width'] - $this->watermark_size[0] - 5); |
444 | 440 | } |
445 | 441 | if ($watermark_position & $phpbb_gallery_constants::WATERMARK_TOP) |
446 | 442 | { |
447 | 443 | $dst_y = 5; |
448 | - } |
|
449 | - else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE) |
|
444 | + } else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE) |
|
450 | 445 | { |
451 | 446 | $dst_y = (($this->image_size['height'] * 0.5) - ($this->watermark_size[1] * 0.5)); |
452 | 447 | } |
@@ -146,8 +146,7 @@ |
||
146 | 146 | 'U_GALLERY_IMAGES_ALLOW' => true, |
147 | 147 | 'U_GALLERY_IMAGES' => $user_info['user_images'], |
148 | 148 | )); |
149 | - } |
|
150 | - else |
|
149 | + } else |
|
151 | 150 | { |
152 | 151 | $this->template->assign_vars(array( |
153 | 152 | 'U_GALLERY_IMAGES_ALLOW' => true, |
@@ -244,8 +244,7 @@ |
||
244 | 244 | if (is_array($ids)) |
245 | 245 | { |
246 | 246 | return array_map('intval', $ids); |
247 | - } |
|
248 | - else |
|
247 | + } else |
|
249 | 248 | { |
250 | 249 | return array((int) $ids); |
251 | 250 | } |
@@ -130,9 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $this->unserialize_auth_data($cached_permissions); |
132 | 132 | return; |
133 | - } |
|
134 | - |
|
135 | - else if ($user_id != $this->user->user_id) |
|
133 | + } else if ($user_id != $this->user->user_id) |
|
136 | 134 | { |
137 | 135 | $this->user->set_user_id($user_id); |
138 | 136 | $cached_permissions = $this->user->get_data('user_permissions'); |
@@ -252,8 +250,7 @@ discard block |
||
252 | 250 | if (!isset($acl_array[$key])) |
253 | 251 | { |
254 | 252 | $acl_array[$key] = $key . '::' . $a_id; |
255 | - } |
|
256 | - else |
|
253 | + } else |
|
257 | 254 | { |
258 | 255 | $acl_array[$key] .= ':' . $a_id; |
259 | 256 | } |
@@ -302,8 +299,7 @@ discard block |
||
302 | 299 | if ($data[$permission] == self::ACL_NEVER) |
303 | 300 | { |
304 | 301 | $this->_auth_data_never[$album_id]->set_bit(self::$_permissions_flipped[$permission], true); |
305 | - } |
|
306 | - else if ($data[$permission] == self::ACL_YES) |
|
302 | + } else if ($data[$permission] == self::ACL_YES) |
|
307 | 303 | { |
308 | 304 | $this->_auth_data[$album_id]->set_bit(self::$_permissions_flipped[$permission], true); |
309 | 305 | if (substr($permission, 0, 2) == 'm_') |
@@ -311,8 +307,7 @@ discard block |
||
311 | 307 | $this->_auth_data[$album_id]->set_bit(self::$_permissions_flipped['m_'], true); |
312 | 308 | } |
313 | 309 | } |
314 | - } |
|
315 | - else |
|
310 | + } else |
|
316 | 311 | { |
317 | 312 | $this->_auth_data[$album_id]->set_count($permission, $data[$permission]); |
318 | 313 | } |
@@ -358,17 +353,17 @@ discard block |
||
358 | 353 | $albums = array();//@todo $this->cache->obtain_album_list(); |
359 | 354 | foreach ($albums as $album) |
360 | 355 | { |
361 | - if (!$album['album_auth_access'] || ($album['album_user_id'] == self::PUBLIC_ALBUM))# || ($album['album_user_id'] == $user_id)) |
|
356 | + if (!$album['album_auth_access'] || ($album['album_user_id'] == self::PUBLIC_ALBUM)) { |
|
357 | + # || ($album['album_user_id'] == $user_id)) |
|
362 | 358 | { |
363 | 359 | continue; |
364 | 360 | } |
365 | - else if ($user_id == ANONYMOUS) |
|
361 | + } else if ($user_id == ANONYMOUS) |
|
366 | 362 | { |
367 | 363 | // Level 1: No guests |
368 | 364 | $this->_auth_data[$album['album_id']] = new \phpbbgallery\core\auth\set(); |
369 | 365 | continue; |
370 | - } |
|
371 | - else if ($album['album_auth_access'] == self::ACCESS_NOT_FOES) |
|
366 | + } else if ($album['album_auth_access'] == self::ACCESS_NOT_FOES) |
|
372 | 367 | { |
373 | 368 | if ($zebra == null) |
374 | 369 | { |
@@ -380,8 +375,7 @@ discard block |
||
380 | 375 | $this->_auth_data[$album['album_id']] = new \phpbbgallery\core\auth\set(); |
381 | 376 | continue; |
382 | 377 | } |
383 | - } |
|
384 | - else if ($album['album_auth_access'] == self::ACCESS_SPECIAL_FRIENDS) |
|
378 | + } else if ($album['album_auth_access'] == self::ACCESS_SPECIAL_FRIENDS) |
|
385 | 379 | { |
386 | 380 | if ($zebra == null) |
387 | 381 | { |
@@ -393,8 +387,7 @@ discard block |
||
393 | 387 | $this->_auth_data[$album['album_id']] = new \phpbbgallery\core\auth\set(); |
394 | 388 | continue; |
395 | 389 | } |
396 | - } |
|
397 | - else if ($album['album_auth_access'] == self::ACCESS_FRIENDS) |
|
390 | + } else if ($album['album_auth_access'] == self::ACCESS_FRIENDS) |
|
398 | 391 | { |
399 | 392 | if ($zebra == null) |
400 | 393 | { |
@@ -428,21 +421,18 @@ discard block |
||
428 | 421 | if ($row['foe']) |
429 | 422 | { |
430 | 423 | $zebra['foe'][] = (int) $row['user_id']; |
431 | - } |
|
432 | - else |
|
424 | + } else |
|
433 | 425 | { |
434 | 426 | if (isset($row['bff'])) |
435 | 427 | { |
436 | 428 | if ($row['bff']) |
437 | 429 | { |
438 | 430 | $zebra['bff'][] = (int) $row['user_id']; |
439 | - } |
|
440 | - else |
|
431 | + } else |
|
441 | 432 | { |
442 | 433 | $zebra['friend'][] = (int) $row['user_id']; |
443 | 434 | } |
444 | - } |
|
445 | - else |
|
435 | + } else |
|
446 | 436 | { |
447 | 437 | $zebra['friend'][] = (int) $row['user_id']; |
448 | 438 | } |
@@ -487,16 +477,13 @@ discard block |
||
487 | 477 | if (in_array($album_author, $zebra_array['foe'])) |
488 | 478 | { |
489 | 479 | $state = 1; |
490 | - } |
|
491 | - else if (in_array($album_author, $zebra_array['friend'])) |
|
480 | + } else if (in_array($album_author, $zebra_array['friend'])) |
|
492 | 481 | { |
493 | 482 | $state = 3; |
494 | - } |
|
495 | - else if (in_array($album_author, $zebra_array['bff'])) |
|
483 | + } else if (in_array($album_author, $zebra_array['bff'])) |
|
496 | 484 | { |
497 | 485 | $state = 4; |
498 | - } |
|
499 | - else |
|
486 | + } else |
|
500 | 487 | { |
501 | 488 | $state = 2; |
502 | 489 | } |
@@ -543,12 +530,10 @@ discard block |
||
543 | 530 | if (is_array($user_ids)) |
544 | 531 | { |
545 | 532 | $sql_where = 'WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids)); |
546 | - } |
|
547 | - else if ($user_ids == 'all') |
|
533 | + } else if ($user_ids == 'all') |
|
548 | 534 | { |
549 | 535 | $sql_where = ''; |
550 | - } |
|
551 | - else |
|
536 | + } else |
|
552 | 537 | { |
553 | 538 | $sql_where = 'WHERE user_id = ' . (int) $user_ids; |
554 | 539 | } |
@@ -617,8 +602,7 @@ discard block |
||
617 | 602 | if ($this->user->is_user($u_id)) |
618 | 603 | { |
619 | 604 | $p_id = self::OWN_ALBUM; |
620 | - } |
|
621 | - else |
|
605 | + } else |
|
622 | 606 | { |
623 | 607 | if (!isset($this->_auth_data[$a_id])) |
624 | 608 | { |
@@ -700,12 +684,10 @@ discard block |
||
700 | 684 | if ($this->user->is_user($album['album_user_id'])) |
701 | 685 | { |
702 | 686 | $a_id = self::OWN_ALBUM; |
703 | - } |
|
704 | - else if ($album['album_user_id'] > self::PUBLIC_ALBUM) |
|
687 | + } else if ($album['album_user_id'] > self::PUBLIC_ALBUM) |
|
705 | 688 | { |
706 | 689 | $a_id = self::PERSONAL_ALBUM; |
707 | - } |
|
708 | - else |
|
690 | + } else |
|
709 | 691 | { |
710 | 692 | $a_id = $album['album_id']; |
711 | 693 | } |
@@ -755,8 +737,7 @@ discard block |
||
755 | 737 | if ($album_data['album_user_id'] != 0) |
756 | 738 | { |
757 | 739 | $sql = 'SELECT * FROM ' . $this->table_permissions . ' WHERE ' . $this->db->sql_in_set('perm_system', array(-2, -3)); |
758 | - } |
|
759 | - else |
|
740 | + } else |
|
760 | 741 | { |
761 | 742 | $sql = 'SELECT * FROM ' . $this->table_permissions . ' WHERE perm_album_id = ' . (int) $album_id; |
762 | 743 | } |