@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | function import() |
| 34 | 34 | { |
| 35 | - global $db, $template, $user, $phpbb_dispatcher, $phpbb_container, $gallery_url, $request, $table_prefix ,$gallery_config, $gallery_album, $request; |
|
| 35 | + global $db, $template, $user, $phpbb_dispatcher, $phpbb_container, $gallery_url, $request, $table_prefix, $gallery_config, $gallery_album, $request; |
|
| 36 | 36 | |
| 37 | 37 | $import_schema = $request->variable('import_schema', ''); |
| 38 | 38 | $images = $request->variable('images', array(''), true); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $album_id = $request->variable('album_id', 0); |
| 303 | 303 | if (isset($_POST['users_pega'])) |
| 304 | 304 | { |
| 305 | - $image_user = $phpbb_container->get('phpbbgallery.core.user'); |
|
| 305 | + $image_user = $phpbb_container->get('phpbbgallery.core.user'); |
|
| 306 | 306 | $image_user->set_user_id($user_row['user_id']); |
| 307 | 307 | if ($user->data['user_id'] != $user_row['user_id']) |
| 308 | 308 | { |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | // Replace the md5 with the ' again and remove the space at the end to prevent \' troubles |
| 48 | 48 | $user_data['username'] = utf8_substr(str_replace("{{$import_schema}}", "'", $user_data['username']), 0, -1); |
| 49 | 49 | $image_name = utf8_substr(str_replace("{{$import_schema}}", "'", $image_name), 0, -1); |
| 50 | - } |
|
| 51 | - else |
|
| 50 | + } else |
|
| 52 | 51 | { |
| 53 | 52 | global $phpEx; |
| 54 | 53 | trigger_error($user->lang('MISSING_IMPORT_SCHEMA', ($import_schema . '.' . $phpEx)), E_USER_WARNING); |
@@ -198,8 +197,7 @@ discard block |
||
| 198 | 197 | if ($filename || ($image_name == '')) |
| 199 | 198 | { |
| 200 | 199 | $sql_ary['image_name'] = str_replace("_", " ", utf8_substr($image_src, 0, utf8_strrpos($image_src, '.'))); |
| 201 | - } |
|
| 202 | - else |
|
| 200 | + } else |
|
| 203 | 201 | { |
| 204 | 202 | $sql_ary['image_name'] = str_replace('{NUM}', $num_offset + $done_images, $image_name); |
| 205 | 203 | } |
@@ -239,14 +237,12 @@ discard block |
||
| 239 | 237 | if (!$errors) |
| 240 | 238 | { |
| 241 | 239 | trigger_error(sprintf($user->lang['IMPORT_FINISHED'], $done_images) . adm_back_link($this->u_action)); |
| 242 | - } |
|
| 243 | - else |
|
| 240 | + } else |
|
| 244 | 241 | { |
| 245 | 242 | $errors = explode("\n", $errors); |
| 246 | 243 | trigger_error(sprintf($user->lang['IMPORT_FINISHED_ERRORS'], $done_images - sizeof($errors)) . implode('<br />', $errors) . adm_back_link($this->u_action), E_USER_WARNING); |
| 247 | 244 | } |
| 248 | - } |
|
| 249 | - else |
|
| 245 | + } else |
|
| 250 | 246 | { |
| 251 | 247 | // Write the new list |
| 252 | 248 | $this->create_import_schema($import_schema, $album_id, $user_data, $start_time, $num_offset, $done_images, $todo_images, $image_name, $filename, $images); |
@@ -256,8 +252,7 @@ discard block |
||
| 256 | 252 | meta_refresh(1, $forward_url); |
| 257 | 253 | trigger_error(sprintf($user->lang['IMPORT_DEBUG_MES'], $done_images, $todo_images)); |
| 258 | 254 | } |
| 259 | - } |
|
| 260 | - else if ($submit) |
|
| 255 | + } else if ($submit) |
|
| 261 | 256 | { |
| 262 | 257 | if (!check_form_key('acp_gallery')) |
| 263 | 258 | { |
@@ -313,8 +308,7 @@ discard block |
||
| 313 | 308 | $album_id = $gallery_album->generate_personal_album($user_row['username'], $user_row['user_id'], $user_row['user_colour'], $image_user); |
| 314 | 309 | } |
| 315 | 310 | unset($image_user); |
| 316 | - } |
|
| 317 | - else |
|
| 311 | + } else |
|
| 318 | 312 | { |
| 319 | 313 | $album_id = $image_user->get_data('personal_album_id'); |
| 320 | 314 | if (!$album_id) |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | foreach ($images as $image_src) |
| 59 | 59 | { |
| 60 | 60 | /** |
| 61 | - * Import the images |
|
| 62 | - */ |
|
| 61 | + * Import the images |
|
| 62 | + */ |
|
| 63 | 63 | |
| 64 | 64 | $image_src = str_replace("{{$import_schema}}", "'", $image_src); |
| 65 | 65 | $image_src_full = $gallery_url->path('import') . utf8_decode($image_src); |
@@ -160,21 +160,21 @@ discard block |
||
| 160 | 160 | $additional_sql_data = array(); |
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | - * Event to trigger before mass update |
|
| 164 | - * |
|
| 165 | - * @event phpbbgallery.acpimport.update_image_before |
|
| 166 | - * @var array additional_sql_data array of additional sql_data |
|
| 167 | - * @var string file_link String with real file link |
|
| 168 | - * @since 1.2.0 |
|
| 169 | - */ |
|
| 163 | + * Event to trigger before mass update |
|
| 164 | + * |
|
| 165 | + * @event phpbbgallery.acpimport.update_image_before |
|
| 166 | + * @var array additional_sql_data array of additional sql_data |
|
| 167 | + * @var string file_link String with real file link |
|
| 168 | + * @since 1.2.0 |
|
| 169 | + */ |
|
| 170 | 170 | $vars = array('additional_sql_data', 'file_link'); |
| 171 | 171 | extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image_before', compact($vars))); |
| 172 | 172 | |
| 173 | 173 | if (($filetype[0] > $gallery_config->get('max_width')) || ($filetype[1] > $gallery_config->get('max_height'))) |
| 174 | 174 | { |
| 175 | 175 | /** |
| 176 | - * Resize oversize images |
|
| 177 | - */ |
|
| 176 | + * Resize oversize images |
|
| 177 | + */ |
|
| 178 | 178 | if ($gallery_config->get('allow_resize')) |
| 179 | 179 | { |
| 180 | 180 | $image_tools->resize_image($gallery_config->get('max_width'), $gallery_config->get('max_height')); |
@@ -187,13 +187,13 @@ discard block |
||
| 187 | 187 | $file_updated = (bool) $image_tools->resized; |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * Event to trigger before mass update |
|
| 191 | - * |
|
| 192 | - * @event phpbbgallery.acpimport.update_image |
|
| 193 | - * @var array additional_sql_data array of additional sql_data |
|
| 194 | - * @var bool file_updated is file resized |
|
| 195 | - * @since 1.2.0 |
|
| 196 | - */ |
|
| 190 | + * Event to trigger before mass update |
|
| 191 | + * |
|
| 192 | + * @event phpbbgallery.acpimport.update_image |
|
| 193 | + * @var array additional_sql_data array of additional sql_data |
|
| 194 | + * @var bool file_updated is file resized |
|
| 195 | + * @since 1.2.0 |
|
| 196 | + */ |
|
| 197 | 197 | $vars = array('additional_sql_data', 'file_updated'); |
| 198 | 198 | extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image', compact($vars))); |
| 199 | 199 | |
@@ -196,8 +196,7 @@ discard block |
||
| 196 | 196 | if (isset($user_image_count[(int) $row['image_user_id']])) |
| 197 | 197 | { |
| 198 | 198 | $user_image_count[(int) $row['image_user_id']]++; |
| 199 | - } |
|
| 200 | - else |
|
| 199 | + } else |
|
| 201 | 200 | { |
| 202 | 201 | $user_image_count[(int) $row['image_user_id']] = 1; |
| 203 | 202 | } |
@@ -246,8 +245,7 @@ discard block |
||
| 246 | 245 | $this->gallery_config->set('newest_pega_username', $newest_pega['username']); |
| 247 | 246 | $this->gallery_config->set('newest_pega_user_colour', $newest_pega['user_colour']); |
| 248 | 247 | $this->gallery_config->set('newest_pega_album_id', $newest_pega['album_id']); |
| 249 | - } |
|
| 250 | - else |
|
| 248 | + } else |
|
| 251 | 249 | { |
| 252 | 250 | $this->gallery_config->set('newest_pega_user_id', 0); |
| 253 | 251 | $this->gallery_config->set('newest_pega_username', ''); |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * Delete source files without a database entry. |
|
| 89 | - * |
|
| 90 | - * @param array $filenames An array of filenames |
|
| 91 | - * @return string Language key for the success message. |
|
| 92 | - */ |
|
| 88 | + * Delete source files without a database entry. |
|
| 89 | + * |
|
| 90 | + * @param array $filenames An array of filenames |
|
| 91 | + * @return string Language key for the success message. |
|
| 92 | + */ |
|
| 93 | 93 | public function delete_files($filenames) |
| 94 | 94 | { |
| 95 | 95 | foreach ($filenames as $file) |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - * Delete images, where the source file is missing. |
|
| 106 | - * |
|
| 107 | - * @param mixed $image_ids Either an array of integers or an integer. |
|
| 108 | - * @return string Language key for the success message. |
|
| 109 | - */ |
|
| 105 | + * Delete images, where the source file is missing. |
|
| 106 | + * |
|
| 107 | + * @param mixed $image_ids Either an array of integers or an integer. |
|
| 108 | + * @return string Language key for the success message. |
|
| 109 | + */ |
|
| 110 | 110 | public function delete_images($image_ids) |
| 111 | 111 | { |
| 112 | 112 | $this->log->add_log('admin', 'clean_deleteentries', 0, 0, array('LOG_CLEANUP_DELETE_ENTRIES', count($image_ids))); |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * Delete images, where the author is missing. |
|
| 120 | - * |
|
| 121 | - * @param mixed $image_ids Either an array of integers or an integer. |
|
| 122 | - * @return string Language key for the success message. |
|
| 123 | - */ |
|
| 119 | + * Delete images, where the author is missing. |
|
| 120 | + * |
|
| 121 | + * @param mixed $image_ids Either an array of integers or an integer. |
|
| 122 | + * @return string Language key for the success message. |
|
| 123 | + */ |
|
| 124 | 124 | public function delete_author_images($image_ids) |
| 125 | 125 | { |
| 126 | 126 | $this->log->add_log('admin', 'clean_deletenoauthors', 0, 0, array('LOG_CLEANUP_DELETE_NO_AUTHOR', count($image_ids))); |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * Delete comments, where the author is missing. |
|
| 134 | - * |
|
| 135 | - * @param mixed $comment_ids Either an array of integers or an integer. |
|
| 136 | - * @return string Language key for the success message. |
|
| 137 | - */ |
|
| 133 | + * Delete comments, where the author is missing. |
|
| 134 | + * |
|
| 135 | + * @param mixed $comment_ids Either an array of integers or an integer. |
|
| 136 | + * @return string Language key for the success message. |
|
| 137 | + */ |
|
| 138 | 138 | public function delete_author_comments($comment_ids) |
| 139 | 139 | { |
| 140 | 140 | $this->log->add_log('admin', 'clean_deletecna', 0, 0, array('LOG_CLEANUP_COMMENT_DELETE_NO_AUTHOR', count($comment_ids))); |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | - * Delete unwanted and obsolete personal galleries. |
|
| 148 | - * |
|
| 149 | - * @param array $unwanted_pegas User IDs we want to delete the pegas. |
|
| 150 | - * @param array $obsolete_pegas User IDs we want to delete the pegas. |
|
| 151 | - * @return array Language keys for the success messages. |
|
| 152 | - */ |
|
| 147 | + * Delete unwanted and obsolete personal galleries. |
|
| 148 | + * |
|
| 149 | + * @param array $unwanted_pegas User IDs we want to delete the pegas. |
|
| 150 | + * @param array $obsolete_pegas User IDs we want to delete the pegas. |
|
| 151 | + * @return array Language keys for the success messages. |
|
| 152 | + */ |
|
| 153 | 153 | public function delete_pegas($unwanted_pegas, $obsolete_pegas) |
| 154 | 154 | { |
| 155 | 155 | |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | /** |
| 283 | - * |
|
| 284 | - */ |
|
| 283 | + * |
|
| 284 | + */ |
|
| 285 | 285 | public function prune($pattern) |
| 286 | 286 | { |
| 287 | 287 | $sql_where = ''; |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | - * |
|
| 329 | - */ |
|
| 328 | + * |
|
| 329 | + */ |
|
| 330 | 330 | public function lang_prune_pattern($pattern) |
| 331 | 331 | { |
| 332 | 332 | if (isset($pattern['image_album_id'])) |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | 'EXIF_CAM_MODEL' => 'Camera-model', |
| 31 | 31 | 'EXIF_DATE' => 'Image taken on', |
| 32 | 32 | 'EXIF_EXPOSURE' => 'Shutter speed', |
| 33 | - 'EXIF_EXPOSURE_EXP' => '%s Sec',// 'EXIF_EXPOSURE' unit |
|
| 33 | + 'EXIF_EXPOSURE_EXP' => '%s Sec', // 'EXIF_EXPOSURE' unit |
|
| 34 | 34 | 'EXIF_EXPOSURE_BIAS' => 'Exposure bias', |
| 35 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV',// 'EXIF_EXPOSURE_BIAS' unit |
|
| 35 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV', // 'EXIF_EXPOSURE_BIAS' unit |
|
| 36 | 36 | 'EXIF_EXPOSURE_PROG' => 'Exposure program', |
| 37 | 37 | 'EXIF_EXPOSURE_PROG_0' => 'Not defined', |
| 38 | 38 | 'EXIF_EXPOSURE_PROG_1' => 'Manual', |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'EXIF_FLASH_CASE_93' => 'Flash fired, auto mode, return light not detected, red-eye reduction mode', |
| 73 | 73 | 'EXIF_FLASH_CASE_95' => 'Flash fired, auto mode, return light detected, red-eye reduction mode', |
| 74 | 74 | 'EXIF_FOCAL' => 'Focus length', |
| 75 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
| 75 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
| 76 | 76 | 'EXIF_ISO' => 'ISO speed rating', |
| 77 | 77 | 'EXIF_METERING_MODE' => 'Metering mode', |
| 78 | 78 | 'EXIF_METERING_MODE_0' => 'Unknown', |
@@ -117,8 +117,7 @@ discard block |
||
| 117 | 117 | try |
| 118 | 118 | { |
| 119 | 119 | $this->loader->load($album_id); |
| 120 | - } |
|
| 121 | - catch (\Exception $e) |
|
| 120 | + } catch (\Exception $e) |
|
| 122 | 121 | { |
| 123 | 122 | throw new \phpbb\exception\http_exception(404, 'ALBUM_NOT_EXIST'); |
| 124 | 123 | } |
@@ -178,8 +177,7 @@ discard block |
||
| 178 | 177 | 'phpbbgallery_core_album_upload', |
| 179 | 178 | array('album_id' => (int) $album_id) |
| 180 | 179 | )); |
| 181 | - } |
|
| 182 | - else |
|
| 180 | + } else |
|
| 183 | 181 | { |
| 184 | 182 | if ($album_data['contest_start'] + $album_data['contest_rating'] > time()) |
| 185 | 183 | { |
@@ -236,8 +234,7 @@ discard block |
||
| 236 | 234 | if (in_array($sort_key, array('r', 'ra'))) |
| 237 | 235 | { |
| 238 | 236 | $sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC'); |
| 239 | - } |
|
| 240 | - else |
|
| 237 | + } else |
|
| 241 | 238 | { |
| 242 | 239 | $sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
| 243 | 240 | } |
@@ -460,8 +457,7 @@ discard block |
||
| 460 | 457 | )); |
| 461 | 458 | $this->url->meta_refresh(3, $back_link); |
| 462 | 459 | return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY')); |
| 463 | - } |
|
| 464 | - else |
|
| 460 | + } else |
|
| 465 | 461 | { |
| 466 | 462 | $this->notifications_helper->add_albums($album_id); |
| 467 | 463 | $this->template->assign_vars(array( |
@@ -470,14 +466,12 @@ discard block |
||
| 470 | 466 | $this->url->meta_refresh(3, $back_link); |
| 471 | 467 | return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY')); |
| 472 | 468 | } |
| 473 | - } |
|
| 474 | - else |
|
| 469 | + } else |
|
| 475 | 470 | { |
| 476 | 471 | if ($this->notifications_helper->get_watched_album($album_id) == 1) |
| 477 | 472 | { |
| 478 | 473 | $lang = $this->language->lang('UNWATCH_ALBUM'); |
| 479 | - } |
|
| 480 | - else |
|
| 474 | + } else |
|
| 481 | 475 | { |
| 482 | 476 | $lang = $this->language->lang('WATCH_ALBUM'); |
| 483 | 477 | } |
@@ -509,8 +503,7 @@ discard block |
||
| 509 | 503 | if (!$this->user->data['is_registered']) |
| 510 | 504 | { |
| 511 | 505 | login_box(); |
| 512 | - } |
|
| 513 | - else |
|
| 506 | + } else |
|
| 514 | 507 | { |
| 515 | 508 | //return $this->error('NOT_AUTHORISED', 403); |
| 516 | 509 | trigger_error($this->language->lang('NOT_AUTHORISED')); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $album_user_id = $image_data['album_user_id']; |
| 343 | 343 | |
| 344 | 344 | //@todo: $rating = new phpbb_gallery_image_rating($image_data['image_id'], $image_data, $image_data); |
| 345 | - $image_data['rating'] = '0';//@todo: $rating->get_image_rating(false, false); |
|
| 345 | + $image_data['rating'] = '0'; //@todo: $rating->get_image_rating(false, false); |
|
| 346 | 346 | //@todo: unset($rating); |
| 347 | 347 | |
| 348 | 348 | $s_user_allowed = (($image_data['image_user_id'] == $this->user->data['user_id']) && ($album_status != \phpbbgallery\core\block::ALBUM_LOCKED)); |
@@ -400,14 +400,14 @@ discard block |
||
| 400 | 400 | |
| 401 | 401 | '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, |
| 402 | 402 | 'S_IMAGE_REPORTED' => $image_data['image_reported'], |
| 403 | - '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']) : '', |
|
| 403 | + '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']) : '', |
|
| 404 | 404 | 'S_STATUS_APPROVED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_APPROVED), |
| 405 | 405 | '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, |
| 406 | 406 | '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'])) : '', |
| 407 | 407 | 'S_STATUS_LOCKED' => ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_LOCKED), |
| 408 | 408 | |
| 409 | 409 | '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'])*/ : '', |
| 410 | - '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']) : '', |
|
| 410 | + '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']) : '', |
|
| 411 | 411 | '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')), |
| 412 | 412 | |
| 413 | 413 | 'S_CONTEST_RANK' => $image_data['image_contest_rank'], |
@@ -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 | } |
@@ -363,8 +363,7 @@ discard block |
||
| 363 | 363 | { |
| 364 | 364 | $url = $this->url->append_sid('image_page', "album_id=$album_id&image_id=$next_image{$additional_parameters}"); |
| 365 | 365 | $tpl = '<a href="{IMAGE_URL}" title="{IMAGE_NAME}">{CONTENT}</a>'; |
| 366 | - } |
|
| 367 | - else |
|
| 366 | + } else |
|
| 368 | 367 | { |
| 369 | 368 | $tpl = '{CONTENT}'; |
| 370 | 369 | } |
@@ -440,8 +439,7 @@ discard block |
||
| 440 | 439 | { |
| 441 | 440 | $this->gallery_config->inc('num_images', (int) $num_images); |
| 442 | 441 | $this->gallery_config->inc('num_comments', (int) $num_comments); |
| 443 | - } |
|
| 444 | - else |
|
| 442 | + } else |
|
| 445 | 443 | { |
| 446 | 444 | $this->gallery_config->dec('num_images', (int) $num_images); |
| 447 | 445 | $this->gallery_config->dec('num_comments', (int) $num_comments); |
@@ -190,13 +190,13 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Event delete images |
|
| 194 | - * |
|
| 195 | - * @event phpbbgallery.core.image.delete_images |
|
| 196 | - * @var array images array of the image ids we are deleting |
|
| 197 | - * @var array filenames array of the image filenames |
|
| 198 | - * @since 1.2.0 |
|
| 199 | - */ |
|
| 193 | + * Event delete images |
|
| 194 | + * |
|
| 195 | + * @event phpbbgallery.core.image.delete_images |
|
| 196 | + * @var array images array of the image ids we are deleting |
|
| 197 | + * @var array filenames array of the image filenames |
|
| 198 | + * @since 1.2.0 |
|
| 199 | + */ |
|
| 200 | 200 | $vars = array('images', 'filenames'); |
| 201 | 201 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.delete_images', compact($vars))); |
| 202 | 202 | |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | - * Get the real filenames, so we can load/delete/edit the image-file. |
|
| 260 | - * |
|
| 261 | - * @param mixed $images Array or integer with the image_id(s) |
|
| 262 | - * @return array Format: $image_id => $filename |
|
| 263 | - */ |
|
| 259 | + * Get the real filenames, so we can load/delete/edit the image-file. |
|
| 260 | + * |
|
| 261 | + * @param mixed $images Array or integer with the image_id(s) |
|
| 262 | + * @return array Format: $image_id => $filename |
|
| 263 | + */ |
|
| 264 | 264 | public function get_filenames($images) |
| 265 | 265 | { |
| 266 | 266 | if (empty($images)) |
@@ -375,13 +375,13 @@ discard block |
||
| 375 | 375 | $tpl = '{CONTENT}'; |
| 376 | 376 | |
| 377 | 377 | /** |
| 378 | - * Event generate link |
|
| 379 | - * |
|
| 380 | - * @event phpbbgallery.core.image.generate_link |
|
| 381 | - * @var string mode type of link |
|
| 382 | - * @var string tpl html to be outputed |
|
| 383 | - * @since 1.2.0 |
|
| 384 | - */ |
|
| 378 | + * Event generate link |
|
| 379 | + * |
|
| 380 | + * @event phpbbgallery.core.image.generate_link |
|
| 381 | + * @var string mode type of link |
|
| 382 | + * @var string tpl html to be outputed |
|
| 383 | + * @since 1.2.0 |
|
| 384 | + */ |
|
| 385 | 385 | $vars = array('mode', 'tpl'); |
| 386 | 386 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event |
| 387 | 387 | break; |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | - * Handle user- & total image_counter |
|
| 395 | - * |
|
| 396 | - * @param array $image_id_ary array with the image_ids which changed their status |
|
| 397 | - * @param bool $add are we adding or removing the images |
|
| 398 | - * @param bool $readd is it possible that there are images which aren't really changed |
|
| 399 | - */ |
|
| 394 | + * Handle user- & total image_counter |
|
| 395 | + * |
|
| 396 | + * @param array $image_id_ary array with the image_ids which changed their status |
|
| 397 | + * @param bool $add are we adding or removing the images |
|
| 398 | + * @param bool $readd is it possible that there are images which aren't really changed |
|
| 399 | + */ |
|
| 400 | 400 | public function handle_counter($image_id_ary, $add, $readd = false) |
| 401 | 401 | { |
| 402 | 402 | if (empty($image_id_ary)) |
@@ -467,11 +467,11 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | - * Approve image |
|
| 471 | - * @param (array) $image_id_ary The image ID array to be approved |
|
| 472 | - * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 473 | - * return 0 on success |
|
| 474 | - */ |
|
| 470 | + * Approve image |
|
| 471 | + * @param (array) $image_id_ary The image ID array to be approved |
|
| 472 | + * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 473 | + * return 0 on success |
|
| 474 | + */ |
|
| 475 | 475 | public function approve_images($image_id_ary, $album_id) |
| 476 | 476 | { |
| 477 | 477 | $sql = 'SELECT image_id, image_name, image_user_id |
@@ -507,10 +507,10 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /** |
| 510 | - * UnApprove image |
|
| 511 | - * @param (array) $image_id_ary The image ID array to be unapproved |
|
| 512 | - * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 513 | - */ |
|
| 510 | + * UnApprove image |
|
| 511 | + * @param (array) $image_id_ary The image ID array to be unapproved |
|
| 512 | + * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 513 | + */ |
|
| 514 | 514 | public function unapprove_images($image_id_ary, $album_id) |
| 515 | 515 | { |
| 516 | 516 | self::handle_counter($image_id_ary, false); |
@@ -563,10 +563,10 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | /** |
| 566 | - * Lock images |
|
| 567 | - * @param (array) $image_id_ary Array of images we want to lock |
|
| 568 | - * @param (int) $album_id Album id, so we can log the action |
|
| 569 | - */ |
|
| 566 | + * Lock images |
|
| 567 | + * @param (array) $image_id_ary Array of images we want to lock |
|
| 568 | + * @param (int) $album_id Album id, so we can log the action |
|
| 569 | + */ |
|
| 570 | 570 | public function lock_images($image_id_ary, $album_id) |
| 571 | 571 | { |
| 572 | 572 | self::handle_counter($image_id_ary, false); |
@@ -590,9 +590,9 @@ discard block |
||
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | /** |
| 593 | - * Get last image id |
|
| 594 | - * Return (int) image_id |
|
| 595 | - **/ |
|
| 593 | + * Get last image id |
|
| 594 | + * Return (int) image_id |
|
| 595 | + **/ |
|
| 596 | 596 | public function get_last_image() |
| 597 | 597 | { |
| 598 | 598 | $this->gallery_auth->load_user_permissions($this->user->data['user_id']); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $sql = 'SELECT a2.* |
| 96 | 96 | FROM ' . $this->table_albums . ' a1 |
| 97 | - LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition .') AND a2.album_user_id = ' . (int) $branch_user_id .' |
|
| 97 | + LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition . ') AND a2.album_user_id = ' . (int) $branch_user_id . ' |
|
| 98 | 98 | WHERE a1.album_id = ' . (int) $album_id . ' |
| 99 | 99 | AND a1.album_user_id = ' . (int) $branch_user_id . ' |
| 100 | 100 | ORDER BY a2.left_id ' . (($order == 'descending') ? 'ASC' : 'DESC'); |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | 'ALBUM_ID' => $album_data['album_id'], |
| 178 | 178 | 'ALBUM_NAME' => $album_data['album_name'], |
| 179 | 179 | 'ALBUM_DESC' => generate_text_for_display($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options']), |
| 180 | - 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
| 181 | - 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
| 182 | - 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
| 180 | + 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
| 181 | + 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
| 182 | + 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
| 183 | 183 | 'U_VIEW_ALBUM' => $this->helper->route('phpbbgallery_core_album', array('album_id' => (int) $album_data['album_id'])), |
| 184 | 184 | )); |
| 185 | 185 | |
@@ -691,9 +691,9 @@ discard block |
||
| 691 | 691 | // phpbb_ext_gallery_core_image::generate_link('thumbnail', $phpbb_ext_gallery->config->get('link_thumbnail'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 692 | 692 | $lastimage_uc_thumbnail = $row['album_image'] ? generate_board_url() . '/' . $row['album_image'] : $this->helper->route('phpbbgallery_core_image_file_mini', array('image_id' => $row['album_last_image_id'])); |
| 693 | 693 | // phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 694 | - $lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
| 694 | + $lastimage_uc_name = ''; //@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
| 695 | 695 | // phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 696 | - $lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
| 696 | + $lastimage_uc_icon = ''; //@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
| 697 | 697 | } |
| 698 | 698 | else |
| 699 | 699 | { |
@@ -222,8 +222,7 @@ discard block |
||
| 222 | 222 | SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "' |
| 223 | 223 | WHERE parent_id = " . (int) $album_data['parent_id']; |
| 224 | 224 | $this->db->sql_query($sql); |
| 225 | - } |
|
| 226 | - else |
|
| 225 | + } else |
|
| 227 | 226 | { |
| 228 | 227 | $album_parents = unserialize($album_data['album_parents']); |
| 229 | 228 | } |
@@ -291,16 +290,14 @@ discard block |
||
| 291 | 290 | if (!empty($row['user_id'])) |
| 292 | 291 | { |
| 293 | 292 | $album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
| 294 | - } |
|
| 295 | - else |
|
| 293 | + } else |
|
| 296 | 294 | { |
| 297 | 295 | $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']); |
| 298 | 296 | |
| 299 | 297 | if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')) |
| 300 | 298 | { |
| 301 | 299 | $album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>'; |
| 302 | - } |
|
| 303 | - else |
|
| 300 | + } else |
|
| 304 | 301 | { |
| 305 | 302 | $album_moderators[$a_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>'; |
| 306 | 303 | } |
@@ -344,8 +341,7 @@ discard block |
||
| 344 | 341 | } |
| 345 | 342 | $root_data = array('album_id' => \phpbbgallery\core\block::PUBLIC_ALBUM); |
| 346 | 343 | $sql_where = 'a.album_user_id = ' . \phpbbgallery\core\block::PUBLIC_ALBUM; |
| 347 | - } |
|
| 348 | - else if ($root_data == 'personal') |
|
| 344 | + } else if ($root_data == 'personal') |
|
| 349 | 345 | { |
| 350 | 346 | if ($mark_read == 'albums') |
| 351 | 347 | { |
@@ -362,8 +358,7 @@ discard block |
||
| 362 | 358 | { |
| 363 | 359 | $sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char); |
| 364 | 360 | } |
| 365 | - } |
|
| 366 | - else if ($first_char) |
|
| 361 | + } else if ($first_char) |
|
| 367 | 362 | { |
| 368 | 363 | $sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char); |
| 369 | 364 | } |
@@ -407,8 +402,7 @@ discard block |
||
| 407 | 402 | 'phpbbgallery_core_search_recent_page',), |
| 408 | 403 | 'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start |
| 409 | 404 | );*/ |
| 410 | - } |
|
| 411 | - else |
|
| 405 | + } else |
|
| 412 | 406 | { |
| 413 | 407 | $sql_where = 'a.left_id > ' . $root_data['left_id'] . ' AND a.left_id < ' . $root_data['right_id'] . ' AND a.album_user_id = ' . $root_data['album_user_id']; |
| 414 | 408 | } |
@@ -496,10 +490,12 @@ discard block |
||
| 496 | 490 | continue; |
| 497 | 491 | } |
| 498 | 492 | |
| 499 | - if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
| 493 | + if (false) { |
|
| 494 | + //@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
| 500 | 495 | { |
| 501 | 496 | // if the user does not have permissions to list this album, skip everything until next branch |
| 502 | 497 | $right_id = $row['right_id']; |
| 498 | + } |
|
| 503 | 499 | continue; |
| 504 | 500 | } |
| 505 | 501 | |
@@ -524,8 +520,7 @@ discard block |
||
| 524 | 520 | $album_rows[$parent_id]['album_type_last_image'] = $row['album_type']; |
| 525 | 521 | $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked']; |
| 526 | 522 | $album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time']; |
| 527 | - } |
|
| 528 | - else if ($row['album_type']) |
|
| 523 | + } else if ($row['album_type']) |
|
| 529 | 524 | { |
| 530 | 525 | $subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false; |
| 531 | 526 | $subalbums[$parent_id][$album_id]['name'] = $row['album_name']; |
@@ -567,16 +562,14 @@ discard block |
||
| 567 | 562 | { |
| 568 | 563 | $this->misc->markread('all'); |
| 569 | 564 | $message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>'); |
| 570 | - } |
|
| 571 | - else |
|
| 565 | + } else |
|
| 572 | 566 | { |
| 573 | 567 | $this->misc->markread('albums', $album_ids); |
| 574 | 568 | $message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>'); |
| 575 | 569 | } |
| 576 | 570 | meta_refresh(3, $redirect); |
| 577 | 571 | trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message); |
| 578 | - } |
|
| 579 | - else |
|
| 572 | + } else |
|
| 580 | 573 | { |
| 581 | 574 | $message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); |
| 582 | 575 | meta_refresh(3, $redirect); |
@@ -654,8 +647,7 @@ discard block |
||
| 654 | 647 | 'name' => $subalbum_row['name'], |
| 655 | 648 | 'unread' => $subalbum_unread, |
| 656 | 649 | ); |
| 657 | - } |
|
| 658 | - else |
|
| 650 | + } else |
|
| 659 | 651 | { |
| 660 | 652 | unset($subalbums[$album_id][$subalbum_id]); |
| 661 | 653 | } |
@@ -668,8 +660,7 @@ discard block |
||
| 668 | 660 | |
| 669 | 661 | $l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS'); |
| 670 | 662 | $folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; |
| 671 | - } |
|
| 672 | - else |
|
| 663 | + } else |
|
| 673 | 664 | { |
| 674 | 665 | $folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES'; |
| 675 | 666 | $folder_image = ($album_unread) ? 'forum_unread' : 'forum_read'; |
@@ -695,8 +686,7 @@ discard block |
||
| 695 | 686 | $lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 696 | 687 | // phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 697 | 688 | $lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
| 698 | - } |
|
| 699 | - else |
|
| 689 | + } else |
|
| 700 | 690 | { |
| 701 | 691 | $lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0; |
| 702 | 692 | $lastimage_uc_fake_thumbnail = $lastimage_uc_fake_thumbnail_url = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = ''; |
@@ -85,8 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $mod_array[] = 0; |
| 87 | 87 | } |
| 88 | - } |
|
| 89 | - else |
|
| 88 | + } else |
|
| 90 | 89 | { |
| 91 | 90 | $mod_array = array($album); |
| 92 | 91 | } |
@@ -162,8 +161,7 @@ discard block |
||
| 162 | 161 | $this->template->assign_vars(array( |
| 163 | 162 | 'TOTAL_PAGES' => $this->lang->lang('PAGE_TITLE_NUMBER', $page + 1), |
| 164 | 163 | )); |
| 165 | - } |
|
| 166 | - else |
|
| 164 | + } else |
|
| 167 | 165 | { |
| 168 | 166 | $this->pagination->generate_template_pagination(array( |
| 169 | 167 | 'routes' => array( |
@@ -160,8 +160,7 @@ discard block |
||
| 160 | 160 | if (isset($this->data[$key])) |
| 161 | 161 | { |
| 162 | 162 | return $this->data[$key]; |
| 163 | - } |
|
| 164 | - else if ($default && $this->get_default_value($key) !== null) |
|
| 163 | + } else if ($default && $this->get_default_value($key) !== null) |
|
| 165 | 164 | { |
| 166 | 165 | return $this->get_default_value($key); |
| 167 | 166 | } |
@@ -359,12 +358,10 @@ discard block |
||
| 359 | 358 | if (is_array($user_ids) && !empty($user_ids)) |
| 360 | 359 | { |
| 361 | 360 | $sql_where = 'WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids)); |
| 362 | - } |
|
| 363 | - else if ($user_ids == 'all') |
|
| 361 | + } else if ($user_ids == 'all') |
|
| 364 | 362 | { |
| 365 | 363 | $sql_where = ''; |
| 366 | - } |
|
| 367 | - else |
|
| 364 | + } else |
|
| 368 | 365 | { |
| 369 | 366 | $sql_where = 'WHERE user_id = ' . (int) $user_ids; |
| 370 | 367 | } |
@@ -395,8 +392,7 @@ discard block |
||
| 395 | 392 | { |
| 396 | 393 | // While incrementing, the iamges might be lower than 0. |
| 397 | 394 | $validated_data[$name] = (int) $value; |
| 398 | - } |
|
| 399 | - else |
|
| 395 | + } else |
|
| 400 | 396 | { |
| 401 | 397 | $validated_data[$name] = max(0, (int) $value); |
| 402 | 398 | } |
@@ -542,8 +538,7 @@ discard block |
||
| 542 | 538 | 'warnings' => 0, |
| 543 | 539 | 'allow_pm' => 0, |
| 544 | 540 | ); |
| 545 | - } |
|
| 546 | - else |
|
| 541 | + } else |
|
| 547 | 542 | { |
| 548 | 543 | $user_sig = ''; |
| 549 | 544 | // We add the signature to every posters entry because enable_sig is post dependent |
@@ -589,8 +584,7 @@ discard block |
||
| 589 | 584 | if ((!empty($row['user_allow_viewemail']) && $this->auth->acl_get('u_sendemail')) || $this->auth->acl_get('a_email')) |
| 590 | 585 | { |
| 591 | 586 | $user_cache[$user_id]['email'] = ($this->config['board_email_form'] && $this->config['email_enable']) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=email&u=$user_id") : (($this->config['board_hide_emails'] && !$this->auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); |
| 592 | - } |
|
| 593 | - else |
|
| 587 | + } else |
|
| 594 | 588 | { |
| 595 | 589 | $user_cache[$user_id]['email'] = ''; |
| 596 | 590 | } |
@@ -603,8 +597,7 @@ discard block |
||
| 603 | 597 | if ($diff == 0) |
| 604 | 598 | { |
| 605 | 599 | $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; |
| 606 | - } |
|
| 607 | - else |
|
| 600 | + } else |
|
| 608 | 601 | { |
| 609 | 602 | $diff = ($diff < 0) ? 1 : 0; |
| 610 | 603 | } |
@@ -245,8 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $this->loader->load($this->data['image_album_id']); |
| 248 | - } |
|
| 249 | - catch (\Exception $e) |
|
| 248 | + } catch (\Exception $e) |
|
| 250 | 249 | { |
| 251 | 250 | throw new \phpbb\exception\http_exception(404, 'INVALID_IMAGE'); |
| 252 | 251 | } |
@@ -306,8 +305,7 @@ discard block |
||
| 306 | 305 | if (in_array($sort_key, array('r', 'ra'))) |
| 307 | 306 | { |
| 308 | 307 | $sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC'); |
| 309 | - } |
|
| 310 | - else |
|
| 308 | + } else |
|
| 311 | 309 | { |
| 312 | 310 | $sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
| 313 | 311 | } |
@@ -532,8 +530,7 @@ discard block |
||
| 532 | 530 | if (isset($album_data['contest_start'])) |
| 533 | 531 | { |
| 534 | 532 | $s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false; |
| 535 | - } |
|
| 536 | - else |
|
| 533 | + } else |
|
| 537 | 534 | { |
| 538 | 535 | $s_hide_comment_input = false; |
| 539 | 536 | } |
@@ -580,8 +577,7 @@ discard block |
||
| 580 | 577 | //$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0')); |
| 581 | 578 | $this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0))); |
| 582 | 579 | } |
| 583 | - } |
|
| 584 | - else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments']) |
|
| 580 | + } else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments']) |
|
| 585 | 581 | { |
| 586 | 582 | $this->template->assign_var('S_COMMENTS_DISABLED', true); |
| 587 | 583 | } |
@@ -772,8 +768,7 @@ discard block |
||
| 772 | 768 | 'NAME' => $field_data['PROFILE_FIELD_NAME'], |
| 773 | 769 | 'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'], |
| 774 | 770 | )); |
| 775 | - } |
|
| 776 | - else |
|
| 771 | + } else |
|
| 777 | 772 | { |
| 778 | 773 | $this->template->assign_block_vars('commentrow.custom_fields', $field_data); |
| 779 | 774 | } |
@@ -901,8 +896,7 @@ discard block |
||
| 901 | 896 | { |
| 902 | 897 | $change_image_count = true; |
| 903 | 898 | } |
| 904 | - } |
|
| 905 | - else if ($this->request->variable('change_author', '', true)) |
|
| 899 | + } else if ($this->request->variable('change_author', '', true)) |
|
| 906 | 900 | { |
| 907 | 901 | $errors[] = $this->language->lang('INVALID_USERNAME'); |
| 908 | 902 | } |
@@ -923,8 +917,7 @@ discard block |
||
| 923 | 917 | { |
| 924 | 918 | $personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user); |
| 925 | 919 | } |
| 926 | - } |
|
| 927 | - else |
|
| 920 | + } else |
|
| 928 | 921 | { |
| 929 | 922 | $personal_album_id = $this->gallery_user->get_data('personal_album_id'); |
| 930 | 923 | if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album())) |
@@ -1092,8 +1085,7 @@ discard block |
||
| 1092 | 1085 | $this->notification_helper->read('approval', $album_id); |
| 1093 | 1086 | $this->url->meta_refresh(3, $album_backlink); |
| 1094 | 1087 | trigger_error($message); |
| 1095 | - } |
|
| 1096 | - else |
|
| 1088 | + } else |
|
| 1097 | 1089 | { |
| 1098 | 1090 | if (isset($_POST['cancel'])) |
| 1099 | 1091 | { |
@@ -1101,8 +1093,7 @@ discard block |
||
| 1101 | 1093 | $message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>'); |
| 1102 | 1094 | $this->url->meta_refresh(3, $image_backlink); |
| 1103 | 1095 | trigger_error($message); |
| 1104 | - } |
|
| 1105 | - else |
|
| 1096 | + } else |
|
| 1106 | 1097 | { |
| 1107 | 1098 | confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields); |
| 1108 | 1099 | } |
@@ -1207,8 +1198,7 @@ discard block |
||
| 1207 | 1198 | { |
| 1208 | 1199 | // @todo Add "redirect after login" url |
| 1209 | 1200 | login_box(); |
| 1210 | - } |
|
| 1211 | - else |
|
| 1201 | + } else |
|
| 1212 | 1202 | { |
| 1213 | 1203 | //return $this->error('NOT_AUTHORISED', 403); |
| 1214 | 1204 | redirect('/gallery/album/' . $album_id); |