@@ -13,41 +13,41 @@ discard block |
||
| 13 | 13 | class rating |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * The image ID we want to rate |
|
| 17 | - */ |
|
| 16 | + * The image ID we want to rate |
|
| 17 | + */ |
|
| 18 | 18 | public $image_id = 0; |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * Private objects with the values for the image/album from the database |
|
| 22 | - */ |
|
| 21 | + * Private objects with the values for the image/album from the database |
|
| 22 | + */ |
|
| 23 | 23 | private $image_data = null; |
| 24 | 24 | private $album_data = null; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Rating the user gave the image. |
|
| 28 | - */ |
|
| 27 | + * Rating the user gave the image. |
|
| 28 | + */ |
|
| 29 | 29 | public $user_rating = null; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * Is rating currently possible? |
|
| 33 | - * Might be blocked because of contest-settings. |
|
| 34 | - */ |
|
| 32 | + * Is rating currently possible? |
|
| 33 | + * Might be blocked because of contest-settings. |
|
| 34 | + */ |
|
| 35 | 35 | public $rating_enabled = false; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * Classic-rating box with a dropdown. |
|
| 39 | - */ |
|
| 38 | + * Classic-rating box with a dropdown. |
|
| 39 | + */ |
|
| 40 | 40 | const MODE_SELECT = 1; |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Rating with stars, like the old-system from youtube. |
|
| 43 | + * Rating with stars, like the old-system from youtube. |
|
| 44 | 44 | //@todo: const MODE_STARS = 2; |
| 45 | - */ |
|
| 45 | + */ |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Simple thumbs up or down. |
|
| 48 | + * Simple thumbs up or down. |
|
| 49 | 49 | //@todo: const MODE_THUMB = 3; |
| 50 | - */ |
|
| 50 | + */ |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Constructor |
@@ -154,8 +154,8 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | - * Displays the box where the user can rate the image. |
|
| 158 | - */ |
|
| 157 | + * Displays the box where the user can rate the image. |
|
| 158 | + */ |
|
| 159 | 159 | public function display_box() |
| 160 | 160 | { |
| 161 | 161 | $this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode')); |
@@ -230,8 +230,8 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | - * Get rated value for a image |
|
| 234 | - */ |
|
| 233 | + * Get rated value for a image |
|
| 234 | + */ |
|
| 235 | 235 | private function get_image_rating_value() |
| 236 | 236 | { |
| 237 | 237 | /*if (phpbb_ext_gallery_core_contest::$mode == phpbb_ext_gallery_core_contest::MODE_SUM) |
@@ -245,14 +245,14 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * Is the user allowed to rate? |
|
| 249 | - * Following statements must be true: |
|
| 250 | - * - User must have permissions. |
|
| 251 | - * - User is neither owner of the image nor guest. |
|
| 252 | - * - Album and image are not locked. |
|
| 253 | - * |
|
| 254 | - * @return bool |
|
| 255 | - */ |
|
| 248 | + * Is the user allowed to rate? |
|
| 249 | + * Following statements must be true: |
|
| 250 | + * - User must have permissions. |
|
| 251 | + * - User is neither owner of the image nor guest. |
|
| 252 | + * - Album and image are not locked. |
|
| 253 | + * |
|
| 254 | + * @return bool |
|
| 255 | + */ |
|
| 256 | 256 | public function is_allowed() |
| 257 | 257 | { |
| 258 | 258 | return $this->gallery_auth->acl_check('i_rate', $this->album_data('album_id'), $this->album_data('album_user_id')) && |
@@ -261,25 +261,25 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
| 264 | - * Is the user able to rate? |
|
| 265 | - * Following statements must be true: |
|
| 266 | - * - User must be allowed to rate |
|
| 267 | - * - If the image is in a contest, it must be in the rating timespan |
|
| 268 | - * |
|
| 269 | - * @return bool |
|
| 270 | - */ |
|
| 264 | + * Is the user able to rate? |
|
| 265 | + * Following statements must be true: |
|
| 266 | + * - User must be allowed to rate |
|
| 267 | + * - If the image is in a contest, it must be in the rating timespan |
|
| 268 | + * |
|
| 269 | + * @return bool |
|
| 270 | + */ |
|
| 271 | 271 | public function is_able() |
| 272 | 272 | { |
| 273 | 273 | return $this->is_allowed(); //&& phpbb_ext_gallery_core_contest::is_step('rate', $this->album_data(true)); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
| 277 | - * Get rating from a user for a given image |
|
| 278 | - * |
|
| 279 | - * @param int $user_id |
|
| 280 | - * |
|
| 281 | - * @return mixed False if the user did not rate or is guest, otherwise int the points. |
|
| 282 | - */ |
|
| 277 | + * Get rating from a user for a given image |
|
| 278 | + * |
|
| 279 | + * @param int $user_id |
|
| 280 | + * |
|
| 281 | + * @return mixed False if the user did not rate or is guest, otherwise int the points. |
|
| 282 | + */ |
|
| 283 | 283 | public function get_user_rating($user_id) |
| 284 | 284 | { |
| 285 | 285 | if (isset($this->user_rating[$user_id])) |
@@ -355,10 +355,10 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
| 358 | - * Recalculate the average image-rating and such stuff. |
|
| 359 | - * |
|
| 360 | - * @param mixed $image_ids Array or integer with image_id where we recalculate the rating. |
|
| 361 | - */ |
|
| 358 | + * Recalculate the average image-rating and such stuff. |
|
| 359 | + * |
|
| 360 | + * @param mixed $image_ids Array or integer with image_id where we recalculate the rating. |
|
| 361 | + */ |
|
| 362 | 362 | public function recalc_image_rating($image_ids) |
| 363 | 363 | { |
| 364 | 364 | if (is_array($image_ids)) |
@@ -389,11 +389,11 @@ discard block |
||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
| 392 | - * Delete all ratings for given image_ids |
|
| 393 | - * |
|
| 394 | - * @param mixed $image_ids Array or integer with image_id where we delete the rating. |
|
| 395 | - * @param bool $reset_average Shall we also reset the average? We can save that query, when the images are deleted anyway. |
|
| 396 | - */ |
|
| 392 | + * Delete all ratings for given image_ids |
|
| 393 | + * |
|
| 394 | + * @param mixed $image_ids Array or integer with image_id where we delete the rating. |
|
| 395 | + * @param bool $reset_average Shall we also reset the average? We can save that query, when the images are deleted anyway. |
|
| 396 | + */ |
|
| 397 | 397 | public function delete_ratings($image_ids, $reset_average = false) |
| 398 | 398 | { |
| 399 | 399 | if (is_array($image_ids)) |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function display_box() |
| 160 | 160 | { |
| 161 | - $this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode')); |
|
| 161 | + $this->template->assign_var('GALLERY_RATING', self::MODE_SELECT); //@todo: phpbb_ext_gallery_core_config::get('rating_mode')); |
|
| 162 | 162 | |
| 163 | 163 | switch (self::MODE_SELECT)//@todo: phpbb_ext_gallery_core_config::get('rating_mode')) |
| 164 | 164 | { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function get_image_rating($user_rating = false, $display_contest_end = true) |
| 203 | 203 | { |
| 204 | - $this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode')); |
|
| 204 | + $this->template->assign_var('GALLERY_RATING', self::MODE_SELECT); //@todo: phpbb_ext_gallery_core_config::get('rating_mode')); |
|
| 205 | 205 | |
| 206 | 206 | switch (self::MODE_SELECT)//@todo: phpbb_ext_gallery_core_config::get('rating_mode')) |
| 207 | 207 | { |
@@ -216,8 +216,7 @@ discard block |
||
| 216 | 216 | return $this->language->lang('CONTEST_RATING_HIDDEN'); |
| 217 | 217 | } |
| 218 | 218 | return $this->language->lang('CONTEST_RESULT_HIDDEN', $this->user->format_date(($this->album_data('contest_start') + $this->album_data('contest_end')), false, true)); |
| 219 | - } |
|
| 220 | - else |
|
| 219 | + } else |
|
| 221 | 220 | { |
| 222 | 221 | if ($user_rating) |
| 223 | 222 | { |
@@ -364,8 +363,7 @@ discard block |
||
| 364 | 363 | if (is_array($image_ids)) |
| 365 | 364 | { |
| 366 | 365 | $image_ids = array_map('intval', $image_ids); |
| 367 | - } |
|
| 368 | - else |
|
| 366 | + } else |
|
| 369 | 367 | { |
| 370 | 368 | $image_ids = (int) $image_ids; |
| 371 | 369 | } |
@@ -399,8 +397,7 @@ discard block |
||
| 399 | 397 | if (is_array($image_ids)) |
| 400 | 398 | { |
| 401 | 399 | $image_ids = array_map('intval', $image_ids); |
| 402 | - } |
|
| 403 | - else |
|
| 400 | + } else |
|
| 404 | 401 | { |
| 405 | 402 | $image_ids = (int) $image_ids; |
| 406 | 403 | } |
@@ -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_premissions($this->user->data['user_id']); |
@@ -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 | } |
@@ -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', $num_images); |
| 442 | 441 | $this->gallery_config->inc('num_comments', $num_comments); |
| 443 | - } |
|
| 444 | - else |
|
| 442 | + } else |
|
| 445 | 443 | { |
| 446 | 444 | $this->gallery_config->dec('num_images', $num_images); |
| 447 | 445 | $this->gallery_config->dec('num_comments', $num_comments); |
@@ -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 |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Image File Controller |
|
| 102 | - * Route: gallery/image/{image_id}/source |
|
| 103 | - * |
|
| 104 | - * @param int $image_id |
|
| 105 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 106 | - */ |
|
| 101 | + * Image File Controller |
|
| 102 | + * Route: gallery/image/{image_id}/source |
|
| 103 | + * |
|
| 104 | + * @param int $image_id |
|
| 105 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 106 | + */ |
|
| 107 | 107 | public function source($image_id) |
| 108 | 108 | { |
| 109 | 109 | $this->auth->load_user_premissions($this->user->data['user_id']); |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * Image File Controller |
|
| 159 | - * Route: gallery/image/{image_id}/medium |
|
| 160 | - * |
|
| 161 | - * @param int $image_id |
|
| 162 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 163 | - */ |
|
| 158 | + * Image File Controller |
|
| 159 | + * Route: gallery/image/{image_id}/medium |
|
| 160 | + * |
|
| 161 | + * @param int $image_id |
|
| 162 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 163 | + */ |
|
| 164 | 164 | public function medium($image_id) |
| 165 | 165 | { |
| 166 | 166 | |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Image File Controller |
|
| 194 | - * Route: gallery/image/{image_id}/mini |
|
| 195 | - * |
|
| 196 | - * @param int $image_id |
|
| 197 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 198 | - */ |
|
| 193 | + * Image File Controller |
|
| 194 | + * Route: gallery/image/{image_id}/mini |
|
| 195 | + * |
|
| 196 | + * @param int $image_id |
|
| 197 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 198 | + */ |
|
| 199 | 199 | public function mini($image_id) |
| 200 | 200 | { |
| 201 | 201 | $this->path = $this->path_mini; |
@@ -354,11 +354,11 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
| 357 | - * Image File Controller |
|
| 358 | - * Route: gallery/image/{image_id}/x |
|
| 359 | - * |
|
| 360 | - * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object |
|
| 361 | - */ |
|
| 357 | + * Image File Controller |
|
| 358 | + * Route: gallery/image/{image_id}/x |
|
| 359 | + * |
|
| 360 | + * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object |
|
| 361 | + */ |
|
| 362 | 362 | public function display() |
| 363 | 363 | { |
| 364 | 364 | $this->tool->set_last_modified($this->gallery_user->get_data('user_permissions_changed')); |
@@ -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 | { |
@@ -234,8 +234,7 @@ discard block |
||
| 234 | 234 | $this->data['image_filemissing'] = 0; |
| 235 | 235 | $this->data['image_filemissing'] = 0; |
| 236 | 236 | $this->data['album_watermark'] = 0; |
| 237 | - } |
|
| 238 | - else |
|
| 237 | + } else |
|
| 239 | 238 | { |
| 240 | 239 | $sql = 'SELECT * |
| 241 | 240 | FROM ' . $this->table_images . ' i |
@@ -398,8 +397,7 @@ discard block |
||
| 398 | 397 | { |
| 399 | 398 | $response->headers->set('expires', '-1'); |
| 400 | 399 | } |
| 401 | - } |
|
| 402 | - else |
|
| 400 | + } else |
|
| 403 | 401 | { |
| 404 | 402 | $response->headers->set('Content-Disposition', 'inline; ' . $this->tool->header_filename(htmlspecialchars_decode($this->tool->image_name)) . '.' . ($this->tool->image_type == 'jpeg' ? 'jpg' : $this->tool->image_type)); |
| 405 | 403 | if ($this->tool->is_ie_greater7($this->user->browser)) |
@@ -249,8 +249,7 @@ discard block |
||
| 249 | 249 | 'last_image' => end($process->images), |
| 250 | 250 | ); |
| 251 | 251 | $this->notification_helper->new_image($data); |
| 252 | - } |
|
| 253 | - else |
|
| 252 | + } else |
|
| 254 | 253 | { |
| 255 | 254 | $target = array( |
| 256 | 255 | 'album_id' => $album_id, |
@@ -355,8 +354,7 @@ discard block |
||
| 355 | 354 | { |
| 356 | 355 | $this->language->add_lang('ucp'); |
| 357 | 356 | $error_array[] = $this->language->lang($result . '_USERNAME'); |
| 358 | - } |
|
| 359 | - else |
|
| 357 | + } else |
|
| 360 | 358 | { |
| 361 | 359 | $process->set_username($username); |
| 362 | 360 | } |
@@ -375,8 +373,7 @@ discard block |
||
| 375 | 373 | if (!$process->uploaded_files) |
| 376 | 374 | { |
| 377 | 375 | $process->new_error($this->language->lang('UPLOAD_NO_FILE')); |
| 378 | - } |
|
| 379 | - else |
|
| 376 | + } else |
|
| 380 | 377 | { |
| 381 | 378 | $mode = 'upload_edit'; |
| 382 | 379 | // Remove submit, so we get the first screen of step 2. |
@@ -422,8 +419,7 @@ discard block |
||
| 422 | 419 | if ($VAR == 'zip') |
| 423 | 420 | { |
| 424 | 421 | continue; |
| 425 | - } |
|
| 426 | - else |
|
| 422 | + } else |
|
| 427 | 423 | { |
| 428 | 424 | $filetypes[] = $VAR; |
| 429 | 425 | } |
@@ -523,8 +519,7 @@ discard block |
||
| 523 | 519 | 'last_image' => end($process->images), |
| 524 | 520 | ); |
| 525 | 521 | $this->notification_helper->new_image($data); |
| 526 | - } |
|
| 527 | - else |
|
| 522 | + } else |
|
| 528 | 523 | { |
| 529 | 524 | $target = array( |
| 530 | 525 | 'album_id' => (int) $album_id, |
@@ -591,8 +586,7 @@ discard block |
||
| 591 | 586 | if (file_exists($phpbbgallery_core_file) && is_writable($phpbbgallery_core_file) && file_exists($phpbbgallery_core_file_source) && is_writable($phpbbgallery_core_file_source) && file_exists($phpbbgallery_core_file_medium) && is_writable($phpbbgallery_core_file_medium) && file_exists($phpbbgallery_core_file_mini) && is_writable($phpbbgallery_core_file_mini)) |
| 592 | 587 | { |
| 593 | 588 | return true; |
| 594 | - } |
|
| 595 | - else |
|
| 589 | + } else |
|
| 596 | 590 | { |
| 597 | 591 | return false; |
| 598 | 592 | } |
@@ -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 | } |
@@ -148,8 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 150 | 150 | } |
| 151 | - } |
|
| 152 | - else |
|
| 151 | + } else |
|
| 153 | 152 | { |
| 154 | 153 | $album = $this->album->get_info($album_id); |
| 155 | 154 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -207,8 +206,7 @@ discard block |
||
| 207 | 206 | { |
| 208 | 207 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 209 | 208 | } |
| 210 | - } |
|
| 211 | - else |
|
| 209 | + } else |
|
| 212 | 210 | { |
| 213 | 211 | $album = $this->album->get_info($album_id); |
| 214 | 212 | if (!$this->gallery_auth->acl_check('m_status', $album['album_id'], $album['album_user_id'])) |
@@ -253,8 +251,7 @@ discard block |
||
| 253 | 251 | $this->url->meta_refresh(3, $back_link); |
| 254 | 252 | trigger_error($message); |
| 255 | 253 | } |
| 256 | - } |
|
| 257 | - else |
|
| 254 | + } else |
|
| 258 | 255 | { |
| 259 | 256 | $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
| 260 | 257 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -303,8 +300,7 @@ discard block |
||
| 303 | 300 | { |
| 304 | 301 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 305 | 302 | } |
| 306 | - } |
|
| 307 | - else |
|
| 303 | + } else |
|
| 308 | 304 | { |
| 309 | 305 | $album = $this->album->get_info($album_id); |
| 310 | 306 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -351,8 +347,7 @@ discard block |
||
| 351 | 347 | $message = $this->language->lang('WAITING_REPORTED_DONE', count($report_ary)); |
| 352 | 348 | $this->url->meta_refresh(3, $back_link); |
| 353 | 349 | trigger_error($message); |
| 354 | - } |
|
| 355 | - else |
|
| 350 | + } else |
|
| 356 | 351 | { |
| 357 | 352 | $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
| 358 | 353 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -372,8 +367,7 @@ discard block |
||
| 372 | 367 | { |
| 373 | 368 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 374 | 369 | } |
| 375 | - } |
|
| 376 | - else |
|
| 370 | + } else |
|
| 377 | 371 | { |
| 378 | 372 | $album = $this->album->get_info($album_id); |
| 379 | 373 | if (!$this->gallery_auth->acl_check('m_report', $album['album_id'], $album['album_user_id'])) |
@@ -468,8 +462,7 @@ discard block |
||
| 468 | 462 | trigger_error($message); |
| 469 | 463 | break; |
| 470 | 464 | } |
| 471 | - } |
|
| 472 | - else |
|
| 465 | + } else |
|
| 473 | 466 | { |
| 474 | 467 | $s_hidden_fields = '<input type="hidden" name="select_action" value="' . $action . '" />'; |
| 475 | 468 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -490,8 +483,7 @@ discard block |
||
| 490 | 483 | 'S_HIDDEN_FIELDS' => $s_hidden_fields, |
| 491 | 484 | )); |
| 492 | 485 | return $this->helper->render('gallery/mcp_body.html', $this->language->lang('GALLERY')); |
| 493 | - } |
|
| 494 | - else |
|
| 486 | + } else |
|
| 495 | 487 | { |
| 496 | 488 | confirm_box(false, $this->language->lang('QUEUES_A_' . strtoupper($action) . '2_CONFIRM'), $s_hidden_fields); |
| 497 | 489 | } |
@@ -506,8 +498,7 @@ discard block |
||
| 506 | 498 | { |
| 507 | 499 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 508 | 500 | } |
| 509 | - } |
|
| 510 | - else |
|
| 501 | + } else |
|
| 511 | 502 | { |
| 512 | 503 | $album = $this->album->get_info($album_id); |
| 513 | 504 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -581,8 +572,7 @@ discard block |
||
| 581 | 572 | $message = $this->language->lang('WAITING_REPORTED_DONE', 1); |
| 582 | 573 | $this->url->meta_refresh(3, $back_link); |
| 583 | 574 | trigger_error($message); |
| 584 | - } |
|
| 585 | - else |
|
| 575 | + } else |
|
| 586 | 576 | { |
| 587 | 577 | $s_hidden_fields = '<input type="hidden" name="action" value="reports_close" />'; |
| 588 | 578 | confirm_box(false, $this->language->lang('REPORT_A_CLOSE2_CONFIRM'), $s_hidden_fields); |
@@ -624,8 +614,7 @@ discard block |
||
| 624 | 614 | { |
| 625 | 615 | $select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>'; |
| 626 | 616 | $select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>'; |
| 627 | - } |
|
| 628 | - else |
|
| 617 | + } else |
|
| 629 | 618 | { |
| 630 | 619 | $select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>'; |
| 631 | 620 | $select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>'; |
@@ -644,8 +633,7 @@ discard block |
||
| 644 | 633 | if ($open_report) |
| 645 | 634 | { |
| 646 | 635 | $select_select .= '<option value="reports_close">' . $this->language->lang('REPORT_A_CLOSE') . '</option>'; |
| 647 | - } |
|
| 648 | - else |
|
| 636 | + } else |
|
| 649 | 637 | { |
| 650 | 638 | $select_select .= '<option value="reports_open">' . $this->language->lang('REPORT_A_OPEN') . '</option>'; |
| 651 | 639 | } |
@@ -727,8 +715,7 @@ discard block |
||
| 727 | 715 | )); |
| 728 | 716 | return $this->helper->render('gallery/message.html', $this->language->lang('GALLERY')); |
| 729 | 717 | //trigger_error($message); |
| 730 | - } |
|
| 731 | - else |
|
| 718 | + } else |
|
| 732 | 719 | { |
| 733 | 720 | $this->template->assign_vars(array( |
| 734 | 721 | 'S_NOTIFY_POSTER' => $show_notify, |
@@ -777,8 +764,7 @@ discard block |
||
| 777 | 764 | $message = sprintf($this->language->lang('WAITING_UNAPPROVED_IMAGE', 1)); |
| 778 | 765 | meta_refresh($meta_refresh_time, $image_backlink); |
| 779 | 766 | trigger_error($message); |
| 780 | - } |
|
| 781 | - else |
|
| 767 | + } else |
|
| 782 | 768 | { |
| 783 | 769 | $s_hidden_fields = ''; |
| 784 | 770 | confirm_box(false, 'QUEUE_A_UNAPPROVE2', $s_hidden_fields); |
@@ -819,8 +805,7 @@ discard block |
||
| 819 | 805 | $this->album->update_info($moving_target); |
| 820 | 806 | meta_refresh($meta_refresh_time, $image_backlink); |
| 821 | 807 | trigger_error($message); |
| 822 | - } |
|
| 823 | - else |
|
| 808 | + } else |
|
| 824 | 809 | { |
| 825 | 810 | $category_select = $this->album->get_albumbox(false, 'moving_target', $album_id, 'm_move', $album_id); |
| 826 | 811 | $this->template->assign_vars(array( |
@@ -864,8 +849,7 @@ discard block |
||
| 864 | 849 | $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1)); |
| 865 | 850 | meta_refresh($meta_refresh_time, $image_backlink); |
| 866 | 851 | trigger_error($message); |
| 867 | - } |
|
| 868 | - else |
|
| 852 | + } else |
|
| 869 | 853 | { |
| 870 | 854 | $s_hidden_fields = ''; |
| 871 | 855 | confirm_box(false, 'QUEUE_A_LOCK2', $s_hidden_fields); |
@@ -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'], |
@@ -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' => $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')); |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | $this->language->add_lang(array('gallery'), 'phpbbgallery/core'); |
| 166 | 166 | $this->language->add_lang('search'); |
| 167 | 167 | /** |
| 168 | - * Build the sort options |
|
| 169 | - */ |
|
| 168 | + * Build the sort options |
|
| 169 | + */ |
|
| 170 | 170 | $limit_days = array(0 => $this->language->lang('ALL_IMAGES'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); |
| 171 | 171 | $sort_by_text = array('t' => $this->language->lang('TIME'), 'n' => $this->language->lang('IMAGE_NAME'), 'u' => $this->language->lang('SORT_USERNAME'), 'vc' => $this->language->lang('GALLERY_VIEWS')); |
| 172 | 172 | $sort_by_sql = array('t' => 'image_time', 'n' => 'image_name_clean', 'u' => 'image_username_clean', 'vc' => 'image_view_count'); |
@@ -369,11 +369,11 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | /** |
| 372 | - * Index Controller |
|
| 373 | - * Route: gallery/search/random |
|
| 374 | - * |
|
| 375 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 376 | - */ |
|
| 372 | + * Index Controller |
|
| 373 | + * Route: gallery/search/random |
|
| 374 | + * |
|
| 375 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 376 | + */ |
|
| 377 | 377 | public function random() |
| 378 | 378 | { |
| 379 | 379 | $this->language->add_lang(array('gallery'), 'phpbbgallery/core'); |
@@ -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', |
@@ -232,8 +232,7 @@ discard block |
||
| 232 | 232 | if ($search_terms == 'all') |
| 233 | 233 | { |
| 234 | 234 | $keywords .= ' ' . $add_keywords; |
| 235 | - } |
|
| 236 | - else |
|
| 235 | + } else |
|
| 237 | 236 | { |
| 238 | 237 | $search_terms = 'all'; |
| 239 | 238 | $keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords; |
@@ -271,8 +270,7 @@ discard block |
||
| 271 | 270 | if (empty($search_album)) |
| 272 | 271 | { |
| 273 | 272 | $sql_where[] = $this->db->sql_in_set('i.image_album_id', $this->gallery_auth->acl_album_ids('i_view')); |
| 274 | - } |
|
| 275 | - else |
|
| 273 | + } else |
|
| 276 | 274 | { |
| 277 | 275 | $sql_where[] = $this->db->sql_in_set('i.image_album_id', $search_album); |
| 278 | 276 | } |
@@ -111,11 +111,11 @@ |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | - * Index Controller |
|
| 115 | - * Route: gallery |
|
| 116 | - * |
|
| 117 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 118 | - */ |
|
| 114 | + * Index Controller |
|
| 115 | + * Route: gallery |
|
| 116 | + * |
|
| 117 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
| 118 | + */ |
|
| 119 | 119 | public function base() |
| 120 | 120 | { |
| 121 | 121 | // Display login box for guests and an error for users |
@@ -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, |
@@ -131,8 +131,7 @@ discard block |
||
| 131 | 131 | if ($this->gallery_config->get('pegas_index_album')) |
| 132 | 132 | { |
| 133 | 133 | $this->display->display_albums('personal', $this->config['load_moderators']); |
| 134 | - } |
|
| 135 | - else |
|
| 134 | + } else |
|
| 136 | 135 | { |
| 137 | 136 | $last_image = $this->image->get_last_image(); |
| 138 | 137 | if (empty($last_image)) |
@@ -347,8 +346,7 @@ discard block |
||
| 347 | 346 | FROM ' . GROUPS_TABLE . ' |
| 348 | 347 | WHERE group_legend > 0 |
| 349 | 348 | ORDER BY ' . $order_legend . ' ASC'; |
| 350 | - } |
|
| 351 | - else |
|
| 349 | + } else |
|
| 352 | 350 | { |
| 353 | 351 | $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend |
| 354 | 352 | FROM ' . GROUPS_TABLE . ' g |
@@ -373,8 +371,7 @@ discard block |
||
| 373 | 371 | if ($row['group_name'] == 'BOTS' || ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile'))) |
| 374 | 372 | { |
| 375 | 373 | $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>'; |
| 376 | - } |
|
| 377 | - else |
|
| 374 | + } else |
|
| 378 | 375 | { |
| 379 | 376 | $legend[] = '<a' . $colour_text . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>'; |
| 380 | 377 | } |