diff --git a/.gitattributes b/.gitattributes index 44bff05e9..edb2c4820 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ -.gitattributes export-ignore -.idea export-ignore -phpunit.xml.dist export-ignore -.vscode export-ignore -.codegpt export-ignore -gallery-core.json export-ignore +.gitattributes export-ignore +.idea export-ignore +phpunit.xml.dist export-ignore +.vscode export-ignore +.codegpt export-ignore +gallery-core.json export-ignore gallery-cleanup.json export-ignore -gallery-exif.json export-ignore -gallery-import.json export-ignore \ No newline at end of file +gallery-exif.json export-ignore +gallery-import.json export-ignore \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d7af8adc6..d19082f13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ env: - IMAGE_ICC="1" # Should we run icc profile sniffer on your images? - EPV="1" # Should we run EPV (Extension Pre Validator) on your code? - PHPBB_BRANCH="3.3.x" - - COVERAGE="1" # Should we run covarage? + - COVERAGE="1" # Should we run coverage? branches: only: @@ -58,7 +58,7 @@ install: - sh -c "if [ '$COVER' != '0' ]; then sed -i '/phpenv/d' travis/setup-php-extensions.sh; fi" - travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION - - sh -c "if [ '$COVERAGE' != '0' ] && [ '$COVER' != '0' ]; then phpBB/ext/$EXTNAME/travis/prepare-covarage.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" + - sh -c "if [ '$COVERAGE' != '0' ] && [ '$COVER' != '0' ]; then phpBB/ext/$EXTNAME/travis/prepare-coverage.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" - ../$EXTNAME/travis/prepare-epv.sh $EPV $NOTESTS before_script: diff --git a/acpcleanup/acp/main_info.php b/acpcleanup/acp/main_info.php index 8a9a7f24d..da3d8ca79 100644 --- a/acpcleanup/acp/main_info.php +++ b/acpcleanup/acp/main_info.php @@ -1,7 +1,7 @@ 0)); */ $return = array(); - if ($obsolent_pegas) + if ($obsolete_pegas) { $return[] = 'CLEAN_PERSONALS_DONE'; } diff --git a/acpcleanup/language/bg/info_acp_gallery_cleanup.php b/acpcleanup/language/bg/info_acp_gallery_cleanup.php index b14dc8848..ff8f2fcb8 100644 --- a/acpcleanup/language/bg/info_acp_gallery_cleanup.php +++ b/acpcleanup/language/bg/info_acp_gallery_cleanup.php @@ -1,7 +1,7 @@ gallery_auth->get_zebra_state($zebra_array, (int) $row['album_user_id'], (int) $row['album_id']) < (int) $row['album_auth_access']) { continue; diff --git a/core/album/manage.php b/core/album/manage.php index cbc4493b8..b67003633 100644 --- a/core/album/manage.php +++ b/core/album/manage.php @@ -997,10 +997,10 @@ public function delete_album_content($album_id) // Adjust users image counts if (!empty($image_counts)) { - foreach ($image_counts as $image_user_id => $substract) + foreach ($image_counts as $image_user_id => $subtract) { $this->gallery_user->set_user_id($image_user_id); - $this->gallery_user->update_images((0 - $substract)); + $this->gallery_user->update_images((0 - $subtract)); } } @@ -1072,7 +1072,7 @@ public function move_album_by($album_row, $action = 'move_up', $steps = 1) /** * $left_id and $right_id define the scope of the nodes that are affected by the move. - * $diff_up and $diff_down are the values to substract or add to each node's left_id + * $diff_up and $diff_down are the values to subtract or add to each node's left_id * and right_id in order to move them up or down. * $move_up_left and $move_up_right define the scope of the nodes that are moving * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. diff --git a/core/comment.php b/core/comment.php index 668fc09c7..ad094f78f 100644 --- a/core/comment.php +++ b/core/comment.php @@ -175,6 +175,7 @@ public function sync_image_comments($image_ids = false) GROUP BY comment_image_id, comment_id ORDER BY comment_id DESC'; $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) { $resync[$row['comment_image_id']] = array( diff --git a/core/controller/image.php b/core/controller/image.php index 6719d4fb7..3e78be529 100644 --- a/core/controller/image.php +++ b/core/controller/image.php @@ -599,6 +599,7 @@ public function base($image_id, $page = 0) { $this->display_comments($image_id, $this->data, $album_id, $album_data, ($page - 1) * $this->gallery_config->get('items_per_page'), $this->gallery_config->get('items_per_page')); } + return $this->helper->render('gallery/viewimage_body.html', $page_title); } @@ -640,9 +641,9 @@ protected function display_comments($image_id, $image_data, $album_id, $album_da $this->load_users_data(); + // Load online-information if ($this->config['load_onlinetrack'] && sizeof($this->users_id_array)) { - // Load online-information $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline FROM ' . SESSIONS_TABLE . ' WHERE ' . $this->db->sql_in_set('session_user_id', $this->users_id_array) . ' @@ -661,7 +662,7 @@ protected function display_comments($image_id, $image_data, $album_id, $album_da { $edit_info = ''; - // Let's deply new profile + // Let's deploy new profile $poster_id = $row['comment_user_id']; if ($row['comment_edit_count'] > 0) diff --git a/core/controller/index.php b/core/controller/index.php index 7e2df7603..8dcb96231 100644 --- a/core/controller/index.php +++ b/core/controller/index.php @@ -229,7 +229,7 @@ public function base() } } $this->display_legend(); - $this->display_brithdays(); + $this->display_birthdays(); $this->assign_dropdown_links('phpbbgallery_core_index'); $this->template->assign_block_vars('navlinks', array( @@ -396,7 +396,7 @@ protected function display_legend() )); } - protected function display_brithdays() + protected function display_birthdays() { // Generate birthday list if required ... if ($this->config['load_birthdays'] && $this->config['allow_birthdays'] && $this->config['phpbb_gallery_disp_birthdays'] && $this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) diff --git a/core/controller/moderate.php b/core/controller/moderate.php index 4a4a12abd..7b94a4d2d 100644 --- a/core/controller/moderate.php +++ b/core/controller/moderate.php @@ -330,7 +330,7 @@ public function action_log($page, $album_id) /** * Index Controller - * Route: gallery/modarate/reports + * Route: gallery/moderate/reports * * @param $page * @param $album_id @@ -536,7 +536,7 @@ public function album_overview($album_id, $page) /** * Index Controller - * Route: gallery/modarate/image/{image_id} + * Route: gallery/moderate/image/{image_id} * * @param $image_id * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object @@ -687,7 +687,7 @@ public function image($image_id) /** * Index Controller - * Route: gallery/modarate/image/{image_id}/approve + * Route: gallery/moderate/image/{image_id}/approve * * @param $image_id * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object @@ -754,7 +754,7 @@ public function approve($image_id) /** * Index Controller - * Route: gallery/modarate/image/{image_id}/unapprove + * Route: gallery/moderate/image/{image_id}/unapprove * * @param $image_id * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object @@ -794,7 +794,7 @@ public function unapprove($image_id) /** * Index Controller - * Route: gallery/modarate/image/{image_id}/move + * Route: gallery/moderate/image/{image_id}/move * * @param $image_id * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object @@ -842,7 +842,7 @@ public function move($image_id): \Symfony\Component\HttpFoundation\Response /** * Index Controller - * Route: gallery/modarate/image/{image_id}/lock + * Route: gallery/moderate/image/{image_id}/lock * * @param $image_id * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object diff --git a/core/image/image.php b/core/image/image.php index 8c1f7f5b9..61cac5492 100644 --- a/core/image/image.php +++ b/core/image/image.php @@ -158,7 +158,7 @@ public function get_new_author_info($username) } /** - * Delete an image completly. + * Delete an image completely. * * @param array $images Array with the image_id(s) * @param array $filenames Array with filenames for the image_ids. If a filename is missing it's queried from the database. @@ -668,6 +668,7 @@ public function assign_block($image_block_name, $image_data, $display_option = 0 $action = false; break; } + switch ($imagename_link) { case 'image_page': @@ -680,6 +681,7 @@ public function assign_block($image_block_name, $image_data, $display_option = 0 $action_image = false; break; } + $this->template->assign_block_vars($image_block_name, array( 'IMAGE_ID' => $image_data['image_id'], 'U_IMAGE' => $show_imagename ? $action_image : false, diff --git a/core/log.php b/core/log.php index 9c43be3cc..150244d6b 100644 --- a/core/log.php +++ b/core/log.php @@ -81,9 +81,9 @@ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $ * Add item to log * * @param string $log_type type of action (user/mod/admin/system) max 16 chars - * @param string $log_action action we are loging (add/remove/approve/unaprove/delete) max 32 chars + * @param string $log_action action we are logging (add/remove/approve/unapproved/delete) max 32 chars * @param int $album - * @param int $image Image we are loging for (can be 0) + * @param int $image Image we are logging for (can be 0) * @param array|string $description Description string */ public function add_log($log_type, $log_action, $album = 0, $image = 0, $description = array()) @@ -152,7 +152,7 @@ public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, { $sql_where[] = "l.log_type = '" . $this->db->sql_escape($type) . "'"; } - // If album is -1 we are calling it from ACP so ... prority! + // If album is -1 we are calling it from ACP so ... priority! // If album is 0 we are calling it from moderator log, so we need album we can access $mod_array = $this->gallery_auth->acl_album_ids('m_status'); // Patch for missing album @@ -210,6 +210,7 @@ public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, $sql_array['ORDER_BY'] = 'l.log_time ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); $sql_array['GROUP_BY'] = 'l.log_time, l.log_id, i.image_id'; } + // So we need count - so define SELECT $sql_array['SELECT'] = 'SUM(l.log_id) as count'; $sql = $this->db->sql_build_query('SELECT', $sql_array); diff --git a/exif/config/services.yml b/exif/config/services.yml index a33be4359..455f585f2 100644 --- a/exif/config/services.yml +++ b/exif/config/services.yml @@ -1,11 +1,11 @@ -services: - phpbbgallery.exif.listener: - class: phpbbgallery\exif\event\exif_listener - arguments: +services: + phpbbgallery.exif.listener: + class: phpbbgallery\exif\event\exif_listener + arguments: - '@user' - '@phpbbgallery.core.config' - '@phpbbgallery.core.auth' - '@phpbbgallery.core.url' - - '@phpbbgallery.core.user' - tags: + - '@phpbbgallery.core.user' + tags: - { name: event.listener } \ No newline at end of file diff --git a/exif/event/exif_listener.php b/exif/event/exif_listener.php index 7274186eb..fb2038e0b 100644 --- a/exif/event/exif_listener.php +++ b/exif/event/exif_listener.php @@ -1,7 +1,7 @@ withConsecutive but I want to - * will have to make diferent test for each case + * will have to make different test for each case * */ public function test_controller_base_case_1() diff --git a/travis/prepare-covarage.sh b/travis/prepare-coverage.sh old mode 100755 new mode 100644 similarity index 94% rename from travis/prepare-covarage.sh rename to travis/prepare-coverage.sh index 8d3880ee7..7d2bb5250 --- a/travis/prepare-covarage.sh +++ b/travis/prepare-coverage.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Collapsible Categories extension for the phpBB Forum Software package. +# phpBB Gallery extension for the phpBB Forum Software package. # # @copyright (c) 2015 phpBB Limited # @license GNU General Public License, version 2 (GPL-2.0) diff --git a/travis/run-slow-tests.sh b/travis/run-slow-tests.sh index be8165c78..60f07e52f 100755 --- a/travis/run-slow-tests.sh +++ b/travis/run-slow-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Collapsible Categories extension for the phpBB Forum Software package. +# phpBB Gallery extension for the phpBB Forum Software package. # # @copyright (c) 2015 phpBB Limited # @license GNU General Public License, version 2 (GPL-2.0) diff --git a/travis/run-tests.sh b/travis/run-tests.sh index eeb21c4d0..ed1ce3a73 100755 --- a/travis/run-tests.sh +++ b/travis/run-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Collapsible Categories extension for the phpBB Forum Software package. +# phpBB Gallery extension for the phpBB Forum Software package. # # @copyright (c) 2015 phpBB Limited # @license GNU General Public License, version 2 (GPL-2.0) diff --git a/travis/send-coverage.sh b/travis/send-coverage.sh index 6fd7824a3..a53be0a1c 100755 --- a/travis/send-coverage.sh +++ b/travis/send-coverage.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Collapsible Categories extension for the phpBB Forum Software package. +# phpBB Gallery extension for the phpBB Forum Software package. # # @copyright (c) 2015 phpBB Limited # @license GNU General Public License, version 2 (GPL-2.0)