@@ -211,7 +211,7 @@ public function update_album_data(&$album_data, &$contest_data)
211211 }
212212 }*/
213213 // Validate the contest timestamps:
214- if ($ album_data ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST )
214+ if ($ album_data ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST )
215215 {
216216 if ($ this ->user ->data ['user_timezone ' ] == '' )
217217 {
@@ -386,7 +386,7 @@ public function update_album_data(&$album_data, &$contest_data)
386386 $ album_data ['album_id ' ] = (int ) $ this ->db ->sql_nextid ();
387387
388388 // Type is contest, so create it...
389- if ($ album_data ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST )
389+ if ($ album_data ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST )
390390 {
391391 $ contest_data_sql = $ contest_data ;
392392 $ contest_data_sql ['contest_album_id ' ] = $ album_data ['album_id ' ];
@@ -408,28 +408,28 @@ public function update_album_data(&$album_data, &$contest_data)
408408 $ row = $ this ->gallery_album ->get_info ($ album_data_sql ['album_id ' ]);
409409 $ reset_marked_images = false ;
410410
411- if ($ row ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] != \phpbbgallery \core \block::TYPE_CONTEST )
411+ if ($ row ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] != \phpbbgallery \core \block::TYPE_CONTEST )
412412 {
413413 // Changing a contest to album? No!
414414 // Changing a contest to category? No!
415415 $ errors [] = $ this ->language ->lang ('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE ' );
416416 return $ errors ;
417417 }
418- else if ($ row ['album_type ' ] != \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST )
418+ else if ($ row ['album_type ' ] != \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST )
419419 {
420420 // Changing a album to contest? No!
421421 // Changing a category to contest? No!
422422 $ errors [] = $ this ->language ->lang ('ALBUM_NO_TYPE_CHANGE_TO_CONTEST ' );
423423 return $ errors ;
424424 }
425- else if ($ row ['album_type ' ] == \phpbbgallery \core \block::TYPE_CAT && $ album_data_sql ['album_type ' ] == \phpbbgallery \core \block::TYPE_UPLOAD )
425+ else if ($ row ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CAT && $ album_data_sql ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_UPLOAD )
426426 {
427427 // Changing a category to a album? Yes!
428428 // Reset the data (you couldn't upload directly in a cat, you must use a album)
429429 $ album_data_sql ['album_images ' ] = $ album_data_sql ['album_images_real ' ] = $ album_data_sql ['album_last_image_id ' ] = $ album_data_sql ['album_last_user_id ' ] = $ album_data_sql ['album_last_image_time ' ] = $ album_data_sql ['album_contest ' ] = 0 ;
430430 $ album_data_sql ['album_last_username ' ] = $ album_data_sql ['album_last_user_colour ' ] = $ album_data_sql ['album_last_image_name ' ] = '' ;
431431 }
432- else if ($ row ['album_type ' ] == \phpbbgallery \core \block::TYPE_UPLOAD && $ album_data_sql ['album_type ' ] == \phpbbgallery \core \block::TYPE_CAT )
432+ else if ($ row ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_UPLOAD && $ album_data_sql ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CAT )
433433 {
434434 // Changing a album to a category? Yes!
435435 // we're turning a uploadable album into a non-uploadable album
@@ -455,13 +455,13 @@ public function update_album_data(&$album_data, &$contest_data)
455455 return array ($ this ->language ->lang ('NO_ALBUM_ACTION ' ));
456456 }
457457 }
458- else if ($ row ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] == \phpbbgallery \core \block::TYPE_CONTEST )
458+ else if ($ row ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST && $ album_data_sql ['album_type ' ] == ( int ) \phpbbgallery \core \block::TYPE_CONTEST )
459459 {
460460 // Changing a contest to contest? Yes!
461461 // We need to check for the contest_data
462462 $ row_contest = $ this ->gallery_contest ->get_contest ($ album_data ['album_id ' ], 'album ' );
463463 $ contest_data ['contest_id ' ] = $ row_contest ['contest_id ' ];
464- if ($ row_contest ['contest_marked ' ] == \phpbbgallery \core \block::NO_CONTEST )
464+ if ($ row_contest ['contest_marked ' ] == ( int ) \phpbbgallery \core \block::NO_CONTEST )
465465 {
466466 // If the old contest is finished, but the new one isn't, we need to remark the images!
467467 // If we change it the other way round, the album.php will do the end on the first visit!
@@ -520,14 +520,14 @@ public function update_album_data(&$album_data, &$contest_data)
520520 $contest_id = $contest_data['contest_id'];
521521 unset($contest_data['contest_id']);
522522
523- $sql = 'UPDATE ' . GALLERY_CONTESTS_TABLE . '
523+ $sql = 'UPDATE ' . $this->contests_table . '
524524 SET ' . $db->sql_build_array('UPDATE', $contest_data) . '
525525 WHERE contest_id = ' . (int) $contest_id;
526526 $db->sql_query($sql);
527527 if ($reset_marked_images)
528528 {
529529 // If the old contest is finished, but the new one isn't, we need to remark the images!
530- $sql = 'UPDATE ' . GALLERY_IMAGES_TABLE . '
530+ $sql = 'UPDATE ' . $this->images_table . '
531531 SET image_contest_rank = 0,
532532 image_contest_end = 0,
533533 image_contest = ' . phpbb_ext_gallery_core_image::IN_CONTEST . '
0 commit comments