@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | \phpbbgallery\core\album\album $album, \phpbbgallery\core\config $gallery_config, \phpbb\controller\helper $helper, |
103 | 103 | \phpbbgallery\core\url $url, \phpbbgallery\core\log $gallery_log, \phpbbgallery\core\notification\helper $notification_helper, |
104 | 104 | \phpbbgallery\core\report $report, \phpbbgallery\core\cache $gallery_cache, \phpbbgallery\core\user $gallery_user, |
105 | - \phpbbgallery\core\contest $contest,\phpbbgallery\core\file\file $file, |
|
105 | + \phpbbgallery\core\contest $contest, \phpbbgallery\core\file\file $file, |
|
106 | 106 | $table_images) |
107 | 107 | { |
108 | 108 | $this->db = $db; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @since 1.2.0 |
384 | 384 | */ |
385 | 385 | $vars = array('mode', 'tpl'); |
386 | - extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event |
|
386 | + extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars))); //@todo: Correctly identify the event |
|
387 | 387 | break; |
388 | 388 | } |
389 | 389 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | |
407 | 407 | $num_images = $num_comments = 0; |
408 | 408 | $sql = 'SELECT SUM(image_comments) as comments |
409 | - FROM ' . $this->table_images .' |
|
409 | + FROM ' . $this->table_images . ' |
|
410 | 410 | WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
411 | 411 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . ' |
412 | 412 | GROUP BY image_user_id'; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $this->db->sql_freeresult($result); |
416 | 416 | |
417 | 417 | $sql = 'SELECT COUNT(image_id) images, image_user_id |
418 | - FROM ' . $this->table_images .' |
|
418 | + FROM ' . $this->table_images . ' |
|
419 | 419 | WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
420 | 420 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . ' |
421 | 421 | GROUP BY image_user_id'; |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | return; |
456 | 456 | } |
457 | 457 | |
458 | - $sql = 'SELECT * FROM ' . $this->table_images .' WHERE image_id = ' . (int) $image_id; |
|
458 | + $sql = 'SELECT * FROM ' . $this->table_images . ' WHERE image_id = ' . (int) $image_id; |
|
459 | 459 | $result = $this->db->sql_query($sql); |
460 | 460 | $row = $this->db->sql_fetchrow($result); |
461 | 461 | $this->db->sql_freeresult($result); |
@@ -515,14 +515,14 @@ discard block |
||
515 | 515 | { |
516 | 516 | self::handle_counter($image_id_ary, false); |
517 | 517 | |
518 | - $sql = 'UPDATE ' . $this->table_images .' |
|
518 | + $sql = 'UPDATE ' . $this->table_images . ' |
|
519 | 519 | SET image_status = ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
520 | 520 | WHERE image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . ' |
521 | 521 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary); |
522 | 522 | $this->db->sql_query($sql); |
523 | 523 | |
524 | 524 | $sql = 'SELECT image_id, image_name |
525 | - FROM ' . $this->table_images .' |
|
525 | + FROM ' . $this->table_images . ' |
|
526 | 526 | WHERE image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . ' |
527 | 527 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary); |
528 | 528 | $result = $this->db->sql_query($sql); |
@@ -704,14 +704,14 @@ discard block |
||
704 | 704 | 'U_USER_IP' => $show_ip && $this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) ? $image_data['image_user_ip'] : false, |
705 | 705 | |
706 | 706 | 'S_IMAGE_REPORTED' => $image_data['image_reported'], |
707 | - 'U_IMAGE_REPORTED' => '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
707 | + 'U_IMAGE_REPORTED' => '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
708 | 708 | 'S_STATUS_APPROVED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED), |
709 | 709 | 'S_STATUS_UNAPPROVED' => ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false, |
710 | 710 | 'S_STATUS_UNAPPROVED_ACTION' => ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => (int) $image_data['image_id'])) : '', |
711 | 711 | 'S_STATUS_LOCKED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_LOCKED), |
712 | 712 | |
713 | 713 | 'U_REPORT' => ($this->gallery_auth->acl_check('m_report', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported'])*/ : '', |
714 | - 'U_STATUS' => '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
714 | + 'U_STATUS' => '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
715 | 715 | 'L_STATUS' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')), |
716 | 716 | )); |
717 | 717 | } |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | * |
24 | 24 | * Constants defining some album properties |
25 | 25 | */ |
26 | - const PUBLIC_ALBUM = 0; |
|
26 | + const PUBLIC_ALBUM = 0; |
|
27 | 27 | |
28 | - const TYPE_CAT = 0; |
|
29 | - const TYPE_UPLOAD = 1; |
|
28 | + const TYPE_CAT = 0; |
|
29 | + const TYPE_UPLOAD = 1; |
|
30 | 30 | const TYPE_CONTEST = 2; |
31 | 31 | |
32 | - const ALBUM_OPEN = 0; |
|
32 | + const ALBUM_OPEN = 0; |
|
33 | 33 | const ALBUM_LOCKED = 1; |
34 | 34 | |
35 | 35 | /** |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Only visible for moderators. |
60 | 60 | */ |
61 | - const STATUS_UNAPPROVED = 0; |
|
61 | + const STATUS_UNAPPROVED = 0; |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Visible for everyone with the i_view-permissions |
65 | 65 | */ |
66 | - const STATUS_APPROVED = 1; |
|
66 | + const STATUS_APPROVED = 1; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Visible for everyone with the i_view-permissions, but only moderators can comment. |
70 | 70 | */ |
71 | - const STATUS_LOCKED = 2; |
|
71 | + const STATUS_LOCKED = 2; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Orphan files are only visible for their author, because they're not yet ready uploaded. |
75 | 75 | */ |
76 | - const STATUS_ORPHAN = 3; |
|
76 | + const STATUS_ORPHAN = 3; |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Constants regarding the image contest relation |
@@ -316,7 +316,7 @@ |
||
316 | 316 | |
317 | 317 | public function generate_image_src() |
318 | 318 | { |
319 | - $this->image_src = $this->path . $this->data['image_filename']; |
|
319 | + $this->image_src = $this->path . $this->data['image_filename']; |
|
320 | 320 | |
321 | 321 | if ($this->data['image_filemissing'] || !file_exists($this->path_source . $this->data['image_filename'])) |
322 | 322 | { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $approve_ary = $this->request->variable('approval', array('' => array(0))); |
194 | 194 | $action_ary = $this->request->variable('action', array('' => 0)); |
195 | 195 | $back_link = $this->request->variable('back_link', $album_id > 0 ? $this->helper->route('phpbbgallery_core_moderate_queue_approve_album', array('album_id' => $album_id)) : $this->helper->route('phpbbgallery_core_moderate_queue_approve')); |
196 | - list($action, ) = each($action_ary); |
|
196 | + list($action,) = each($action_ary); |
|
197 | 197 | |
198 | 198 | $this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core'); |
199 | 199 | $this->language->add_lang('mcp'); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | else |
258 | 258 | { |
259 | - $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
|
259 | + $s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />'; |
|
260 | 260 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
261 | 261 | foreach ($approve_ary as $id => $var) |
262 | 262 | { |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $report_ary = $this->request->variable('report', array(0)); |
339 | 339 | $action_ary = $this->request->variable('action', array('' => 0)); |
340 | 340 | $back_link = $this->request->variable('back_link', $album_id > 0 ? $this->helper->route('phpbbgallery_core_moderate_reports_album', array('album_id' => $album_id)) : $this->helper->route('phpbbgallery_core_moderate_reports')); |
341 | - list($action, ) = each($action_ary); |
|
341 | + list($action,) = each($action_ary); |
|
342 | 342 | |
343 | 343 | $this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core'); |
344 | 344 | $this->language->add_lang('mcp'); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | else |
356 | 356 | { |
357 | - $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
|
357 | + $s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />'; |
|
358 | 358 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
359 | 359 | foreach ($report_ary as $var) |
360 | 360 | { |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | case 'reports_close': |
577 | 577 | if (confirm_box(true)) |
578 | 578 | { |
579 | - $back_link = $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id)); |
|
579 | + $back_link = $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id)); |
|
580 | 580 | $this->report->close_reports_by_image($image_id); |
581 | 581 | $message = $this->language->lang('WAITING_REPORTED_DONE', 1); |
582 | 582 | $this->url->meta_refresh(3, $back_link); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | 'REPORT_TIME' => $this->user->format_date($var['report_time']), |
673 | 673 | 'REPORT_NOTE' => $var['report_note'], |
674 | 674 | 'STATUS' => $var['report_status'], |
675 | - 'MANAGER' => $var['report_manager'] != 0 ? $this->user_loader->get_username($var['report_manager'], 'full') : false, |
|
675 | + 'MANAGER' => $var['report_manager'] != 0 ? $this->user_loader->get_username($var['report_manager'], 'full') : false, |
|
676 | 676 | )); |
677 | 677 | } |
678 | 678 | return $this->helper->render('gallery/moderate_image_overview.html', $this->language->lang('GALLERY')); |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | $image_data = $this->image->get_image_data($image_id); |
798 | 798 | $album_id = $image_data['image_album_id']; |
799 | 799 | //$user_id = $image_data['image_user_id']; |
800 | - $album_data = $this->album->get_info($album_id); |
|
800 | + $album_data = $this->album->get_info($album_id); |
|
801 | 801 | $album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id)); |
802 | 802 | $image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id)); |
803 | 803 | $album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login'); |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $image_data = $this->image->get_image_data($image_id); |
846 | 846 | $album_id = $image_data['image_album_id']; |
847 | 847 | //$user_id = $image_data['image_user_id']; |
848 | - $album_data = $this->album->get_info($album_id); |
|
848 | + $album_data = $this->album->get_info($album_id); |
|
849 | 849 | $album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id)); |
850 | 850 | $image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id)); |
851 | 851 | $album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login'); |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | $image_id_ary = array($image_id); |
862 | 862 | $this->image->lock_images($image_id_ary, $album_data['album_id']); |
863 | 863 | // To DO - add notification |
864 | - $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1)); |
|
864 | + $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE', 1)); |
|
865 | 865 | meta_refresh($meta_refresh_time, $image_backlink); |
866 | 866 | trigger_error($message); |
867 | 867 | } |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | * @param string $images_table Gallery image table |
73 | 73 | */ |
74 | 74 | public function __construct(\phpbb\config\config $config, \phpbb\controller\helper $helper, |
75 | - \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, |
|
75 | + \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, |
|
76 | 76 | \phpbb\template\template $template, \phpbb\user $user, \phpbb\language\language $language, |
77 | 77 | \phpbbgallery\core\album\display $display, \phpbbgallery\core\album\loader $loader, |
78 | 78 | \phpbbgallery\core\auth\auth $auth, \phpbbgallery\core\auth\level $auth_level, |
79 | - \phpbbgallery\core\config $gallery_config,\phpbbgallery\core\notification\helper $notifications_helper, |
|
79 | + \phpbbgallery\core\config $gallery_config, \phpbbgallery\core\notification\helper $notifications_helper, |
|
80 | 80 | \phpbbgallery\core\url $url, \phpbbgallery\core\image\image $image, \phpbb\request\request $request, |
81 | 81 | \phpbbgallery\core\contest $contest, |
82 | 82 | $images_table) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | protected function display_images($album_id, $album_data, $start, $limit) |
223 | 223 | { |
224 | - $sort_days = $this->request->variable('st', 0); |
|
224 | + $sort_days = $this->request->variable('st', 0); |
|
225 | 225 | $sort_key = $this->request->variable('sk', ($album_data['album_sort_key']) ? $album_data['album_sort_key'] : $this->config['phpbb_gallery_default_sort_key']); |
226 | 226 | $sort_dir = $this->request->variable('sd', ($album_data['album_sort_dir']) ? $album_data['album_sort_dir'] : $this->config['phpbb_gallery_default_sort_dir']); |
227 | 227 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $album_user_id = $image_data['album_user_id']; |
345 | 345 | |
346 | 346 | //@todo: $rating = new phpbb_gallery_image_rating($image_data['image_id'], $image_data, $image_data); |
347 | - $image_data['rating'] = '0';//@todo: $rating->get_image_rating(false, false); |
|
347 | + $image_data['rating'] = '0'; //@todo: $rating->get_image_rating(false, false); |
|
348 | 348 | //@todo: unset($rating); |
349 | 349 | |
350 | 350 | $s_user_allowed = (($image_data['image_user_id'] == $this->user->data['user_id']) && ($album_status != \phpbbgallery\core\block::ALBUM_LOCKED)); |
@@ -402,14 +402,14 @@ discard block |
||
402 | 402 | |
403 | 403 | 'U_USER_IP' => $show_ip && $this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? $image_data['image_user_ip'] : false, |
404 | 404 | 'S_IMAGE_REPORTED' => $image_data['image_reported'], |
405 | - 'U_IMAGE_REPORTED' => '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
405 | + 'U_IMAGE_REPORTED' => '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
406 | 406 | 'S_STATUS_APPROVED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED), |
407 | 407 | 'S_STATUS_UNAPPROVED' => ($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false, |
408 | 408 | 'S_STATUS_UNAPPROVED_ACTION' => ($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => $image_data['image_id'])) : '', |
409 | 409 | 'S_STATUS_LOCKED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_LOCKED), |
410 | 410 | |
411 | 411 | 'U_REPORT' => ($this->auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported'])*/ : '', |
412 | - 'U_STATUS' => '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
412 | + 'U_STATUS' => '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
413 | 413 | 'L_STATUS' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')), |
414 | 414 | |
415 | 415 | 'S_CONTEST_RANK' => $image_data['image_contest_rank'], |
@@ -141,24 +141,24 @@ discard block |
||
141 | 141 | |
142 | 142 | public function base($page = 1) |
143 | 143 | { |
144 | - $search_id = $this->request->variable('search_id', ''); |
|
144 | + $search_id = $this->request->variable('search_id', ''); |
|
145 | 145 | $image_id = $this->request->variable('image_id', 0); |
146 | 146 | |
147 | - $submit = $this->request->variable('submit', false); |
|
147 | + $submit = $this->request->variable('submit', false); |
|
148 | 148 | $keywords = utf8_normalize_nfc($this->request->variable('keywords', '', true)); |
149 | 149 | $add_keywords = utf8_normalize_nfc($this->request->variable('add_keywords', '', true)); |
150 | 150 | $username = $this->request->variable('username', '', true); |
151 | - $user_id = $this->request->variable('user_id', array(0)); |
|
151 | + $user_id = $this->request->variable('user_id', array(0)); |
|
152 | 152 | $search_terms = $this->request->variable('terms', 'all'); |
153 | 153 | $search_album = $this->request->variable('aid', array(0)); |
154 | 154 | $search_child = $this->request->variable('sc', true); |
155 | - $search_fields = $this->request->variable('sf', 'all'); |
|
156 | - $sort_days = $this->request->variable('st', 0); |
|
155 | + $search_fields = $this->request->variable('sf', 'all'); |
|
156 | + $sort_days = $this->request->variable('st', 0); |
|
157 | 157 | $sort_key = $this->request->variable('sk', 't'); |
158 | 158 | $sort_dir = $this->request->variable('sd', 'd'); |
159 | 159 | |
160 | - $start = ($page - 1) * $this->gallery_config->get('items_per_page'); |
|
161 | - if ($keywords != '' && $add_keywords ='' ) |
|
160 | + $start = ($page - 1) * $this->gallery_config->get('items_per_page'); |
|
161 | + if ($keywords != '' && $add_keywords = '') |
|
162 | 162 | { |
163 | 163 | $submit = true; |
164 | 164 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if ($this->gallery_config->get('allow_rates')) |
175 | 175 | { |
176 | 176 | $sort_by_text['ra'] = $this->language->lang('RATING'); |
177 | - $sort_by_sql['ra'] = 'image_rate_points';//@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg'; |
|
177 | + $sort_by_sql['ra'] = 'image_rate_points'; //@todo: (phpbb_gallery_contest::$mode == phpbb_gallery_contest::MODE_SUM) ? 'image_rate_points' : 'image_rate_avg'; |
|
178 | 178 | $sort_by_text['r'] = $this->language->lang('RATES_COUNT'); |
179 | 179 | $sort_by_sql['r'] = 'image_rates'; |
180 | 180 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | { |
206 | 206 | trigger_error(sprintf($this->language->lang('TOO_FEW_AUTHOR_CHARS'), $this->config['min_search_author_chars'])); |
207 | 207 | } |
208 | - $username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) .'\''; |
|
208 | + $username_parsed = (strpos($username, '*') !== false) ? ' username_clean ' . $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), utf8_clean_string($this->db->sql_escape($username)))) : ' username_clean = \'' . $this->db->sql_escape(utf8_clean_string($username)) . '\''; |
|
209 | 209 | $sql = 'SELECT user_id |
210 | 210 | FROM ' . USERS_TABLE . ' |
211 | 211 | WHERE ' . $username_parsed . ' |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | if (!empty($user_id)) |
225 | 225 | { |
226 | - $sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id); |
|
226 | + $sql_where[] = $this->db->sql_in_set('i.image_user_id', $user_id); |
|
227 | 227 | } |
228 | 228 | // if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode |
229 | 229 | // so we can keep the old keywords in their old mode, but add the new ones as required words |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | else |
237 | 237 | { |
238 | 238 | $search_terms = 'all'; |
239 | - $keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords; |
|
239 | + $keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' . $add_keywords; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | $keywords_ary = ($keywords) ? explode(' ', $keywords) : array(); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $match_search_query = ''; |
262 | 262 | foreach ($matches as $match) |
263 | 263 | { |
264 | - $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') '; |
|
264 | + $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER(' . $match . ') '; |
|
265 | 265 | $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . mb_strtolower($word) . $this->db->get_any_char())); |
266 | 266 | } |
267 | 267 | $search_query .= ((!$search_query) ? '' : (($search_terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')'; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | trigger_error('NO_SEARCH_RESULTS'); |
291 | 291 | } |
292 | 292 | $sql_array['SELECT'] = '*, a.album_name, a.album_status, a.album_user_id, a.album_id'; |
293 | - $sql_array['LEFT_JOIN'] = array( |
|
293 | + $sql_array['LEFT_JOIN'] = array( |
|
294 | 294 | array( |
295 | 295 | 'FROM' => array($this->albums_table => 'a'), |
296 | 296 | 'ON' => 'a.album_id = i.image_album_id', |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | 'U_IMAGENAME' => ($last_image['image_id'] > 0) ? $last_image['image_name'] : false, |
160 | 160 | 'U_IMAGE_ACTION' => $action_image, |
161 | 161 | 'U_IMAGENAME_ACTION' => $this->helper->route('phpbbgallery_core_image', array('image_id' => $last_image['image_id'])), |
162 | - 'U_TIME' => ($last_image['image_id'] > 0) ? $this->user->format_date($last_image['image_time']) : false, |
|
162 | + 'U_TIME' => ($last_image['image_id'] > 0) ? $this->user->format_date($last_image['image_time']) : false, |
|
163 | 163 | 'U_UPLOADER' => ($last_image['image_id'] > 0) ? get_username_string('full', $last_image['image_user_id'], $last_image['image_username'], $last_image['image_user_colour']) : false, |
164 | 164 | )); |
165 | 165 | $this->gallery_user->set_user_id($this->user->data['user_id']); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | 'TOTAL_IMAGES' => ($this->gallery_config->get('disp_statistic')) ? $this->language->lang('TOTAL_IMAGES_SPRINTF', $this->gallery_config->get('num_images')) : '', |
319 | 319 | 'TOTAL_COMMENTS' => ($this->gallery_config->get('allow_comments')) ? $this->language->lang('TOTAL_COMMENTS_SPRINTF', $this->gallery_config->get('num_comments')) : '', |
320 | 320 | 'TOTAL_PGALLERIES' => ($this->gallery_auth->acl_check('a_list', \phpbbgallery\core\auth\auth::PERSONAL_ALBUM)) ? $this->language->lang('TOTAL_PEGAS_SPRINTF', $this->gallery_config->get('num_pegas')) : '', |
321 | - 'NEWEST_PGALLERIES' => ($this->gallery_config->get('num_pegas')) ? sprintf($this->language->lang('NEWEST_PGALLERY'), '<a href="' . $this->helper->route('phpbbgallery_core_album', array('album_id' => $this->gallery_config->get('newest_pega_album_id'))) . '" '. ($this->gallery_config->get('newest_pega_user_colour') ? 'class="username-coloured" style="color: #' . $this->gallery_config->get('newest_pega_user_colour') . ';"' : 'class="username"') . '>' . $this->gallery_config->get('newest_pega_username') . '</a>') : '', |
|
321 | + 'NEWEST_PGALLERIES' => ($this->gallery_config->get('num_pegas')) ? sprintf($this->language->lang('NEWEST_PGALLERY'), '<a href="' . $this->helper->route('phpbbgallery_core_album', array('album_id' => $this->gallery_config->get('newest_pega_album_id'))) . '" ' . ($this->gallery_config->get('newest_pega_user_colour') ? 'class="username-coloured" style="color: #' . $this->gallery_config->get('newest_pega_user_colour') . ';"' : 'class="username"') . '>' . $this->gallery_config->get('newest_pega_username') . '</a>') : '', |
|
322 | 322 | )); |
323 | 323 | |
324 | 324 | $this->template->assign_vars(array( |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | |
417 | 417 | while ($row = $this->db->sql_fetchrow($result)) |
418 | 418 | { |
419 | - $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
|
420 | - $birthday_year = (int) substr($row['user_birthday'], -4); |
|
421 | - $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : ''; |
|
419 | + $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
|
420 | + $birthday_year = (int) substr($row['user_birthday'], -4); |
|
421 | + $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : ''; |
|
422 | 422 | |
423 | 423 | $this->template->assign_block_vars('birthdays', array( |
424 | 424 | 'USERNAME' => $birthday_username, |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | include_once($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
198 | 198 | } |
199 | 199 | |
200 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
201 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
200 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
201 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
202 | 202 | $img_status = ($bbcode_status) ? true : false; |
203 | 203 | $url_status = ($this->config['allow_post_links']) ? true : false; |
204 | 204 | $flash_status = false; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | $message_parser = new \parse_message(); |
308 | - $message_parser->message = utf8_normalize_nfc($comment_plain); |
|
308 | + $message_parser->message = utf8_normalize_nfc($comment_plain); |
|
309 | 309 | if ($message_parser->message) |
310 | 310 | { |
311 | 311 | $message_parser->parse(true, true, true, true, false, true, true, true); |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
465 | 465 | } |
466 | 466 | |
467 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
468 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
467 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
468 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
469 | 469 | $img_status = ($bbcode_status) ? true : false; |
470 | 470 | $url_status = ($this->config['allow_post_links']) ? true : false; |
471 | 471 | $flash_status = false; |
@@ -678,8 +678,8 @@ discard block |
||
678 | 678 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
679 | 679 | } |
680 | 680 | |
681 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
682 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
681 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
682 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
683 | 683 | $img_status = ($bbcode_status) ? true : false; |
684 | 684 | $url_status = ($this->config['allow_post_links']) ? true : false; |
685 | 685 | $flash_status = false; |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | 'IMAGE_NAME' => $image_data['image_name'], |
760 | 760 | |
761 | 761 | 'S_SIGNATURE_CHECKED' => (isset($sig_checked) && $sig_checked) ? ' checked="checked"' : '', |
762 | - 'S_ALBUM_ACTION' => append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/'. (int) $comment_id), |
|
762 | + 'S_ALBUM_ACTION' => append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/' . (int) $comment_id), |
|
763 | 763 | )); |
764 | 764 | |
765 | 765 | if ($submit && !$error) |
@@ -808,8 +808,8 @@ discard block |
||
808 | 808 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
809 | 809 | } |
810 | 810 | |
811 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
812 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
811 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
812 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
813 | 813 | $img_status = ($bbcode_status) ? true : false; |
814 | 814 | $url_status = ($this->config['allow_post_links']) ? true : false; |
815 | 815 | $flash_status = false; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function base($image_id, $page = 0) |
229 | 229 | { |
230 | 230 | |
231 | - $this->language->add_lang( array('gallery'), 'phpbbgallery/core'); |
|
231 | + $this->language->add_lang(array('gallery'), 'phpbbgallery/core'); |
|
232 | 232 | try |
233 | 233 | { |
234 | 234 | $sql = 'SELECT * |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | $this->language->add_lang('posting'); |
509 | 509 | $this->url->_include('functions_posting', 'phpbb'); |
510 | 510 | |
511 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
512 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
511 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
512 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
513 | 513 | $img_status = ($bbcode_status) ? true : false; |
514 | 514 | $url_status = ($this->config['allow_post_links']) ? true : false; |
515 | 515 | $flash_status = false; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | if ($this->users_data_array[$poster_id]['sig'] && empty($this->users_data_array[$poster_id]['sig_parsed'])) |
668 | 668 | { |
669 | 669 | $parse_flags = ($this->users_data_array[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; |
670 | - $user_cache[$poster_id]['sig'] = generate_text_for_display($this->users_data_array[$poster_id]['sig'], $this->users_data_array[$poster_id]['sig_bbcode_uid'], $this->users_data_array[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true); |
|
670 | + $user_cache[$poster_id]['sig'] = generate_text_for_display($this->users_data_array[$poster_id]['sig'], $this->users_data_array[$poster_id]['sig_bbcode_uid'], $this->users_data_array[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true); |
|
671 | 671 | $user_cache[$poster_id]['sig_parsed'] = true; |
672 | 672 | } |
673 | 673 | |
@@ -812,8 +812,8 @@ discard block |
||
812 | 812 | $this->display->generate_navigation($album_data); |
813 | 813 | add_form_key('gallery'); |
814 | 814 | $submit = $this->request->variable('submit', false); |
815 | - $image_backlink = append_sid('./gallery/image/'. $image_id); |
|
816 | - $album_backlink = append_sid('./gallery/album/'. $image_data['image_album_id']); |
|
815 | + $image_backlink = append_sid('./gallery/image/' . $image_id); |
|
816 | + $album_backlink = append_sid('./gallery/album/' . $image_data['image_album_id']); |
|
817 | 817 | $disp_image_data = $image_data; |
818 | 818 | $owner_id = $image_data['image_user_id']; |
819 | 819 | $album_loginlink = './ucp.php?mode=login'; |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | include_once($this->phpbb_root_path . 'includes/message_parser.' . $this->php_ext); |
847 | 847 | } |
848 | 848 | $message_parser = new \parse_message(); |
849 | - $message_parser->message = utf8_normalize_nfc($image_desc); |
|
849 | + $message_parser->message = utf8_normalize_nfc($image_desc); |
|
850 | 850 | if ($message_parser->message) |
851 | 851 | { |
852 | 852 | $message_parser->parse(true, true, true, true, false, true, true, true); |
@@ -1002,8 +1002,8 @@ discard block |
||
1002 | 1002 | { |
1003 | 1003 | include_once($this->phpbb_root_path . 'includes/message_parser.' . $this->php_ext); |
1004 | 1004 | } |
1005 | - $message_parser = new \parse_message(); |
|
1006 | - $message_parser->message = $disp_image_data['image_desc']; |
|
1005 | + $message_parser = new \parse_message(); |
|
1006 | + $message_parser->message = $disp_image_data['image_desc']; |
|
1007 | 1007 | $message_parser->decode_message($disp_image_data['image_desc_uid']); |
1008 | 1008 | |
1009 | 1009 | $page_title = $disp_image_data['image_name']; |
@@ -1114,8 +1114,8 @@ discard block |
||
1114 | 1114 | $album_data = $this->album->get_info($album_id); |
1115 | 1115 | $this->language->add_lang(array('gallery'), 'phpbbgallery/core'); |
1116 | 1116 | $album_loginlink = './ucp.php?mode=login'; |
1117 | - $image_backlink = append_sid('./gallery/image/'. $image_id); |
|
1118 | - $album_backlink = append_sid('./gallery/album/'. $image_data['image_album_id']); |
|
1117 | + $image_backlink = append_sid('./gallery/image/' . $image_id); |
|
1118 | + $album_backlink = append_sid('./gallery/album/' . $image_data['image_album_id']); |
|
1119 | 1119 | $this->gallery_auth->load_user_premissions($this->user->data['user_id']); |
1120 | 1120 | if (!$this->gallery_auth->acl_check('i_report', $album_id, $album_data['album_user_id']) || ($image_data['image_user_id'] == $this->user->data['user_id'])) |
1121 | 1121 | { |