The reward time has been changed from 24 hours to 12:00 AM the next day.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • The reward time has been changed from 24 hours to 12:00 AM the next day.

    /includes/pages/game/ShowBonusPage.class.php

    PHP Source Code

    1. <?php
    2. /*
    3. * ╔══╗╔══╗╔╗──╔╗╔═══╗╔══╗╔╗─╔╗╔╗╔╗──╔╗╔══╗╔══╗╔══╗
    4. * ║╔═╝║╔╗║║║──║║║╔═╗║║╔╗║║╚═╝║║║║║─╔╝║╚═╗║║╔═╝╚═╗║
    5. * ║║──║║║║║╚╗╔╝║║╚═╝║║╚╝║║╔╗─║║╚╝║─╚╗║╔═╝║║╚═╗──║║
    6. * ║║──║║║║║╔╗╔╗║║╔══╝║╔╗║║║╚╗║╚═╗║──║║╚═╗║║╔╗║──║║
    7. * ║╚═╗║╚╝║║║╚╝║║║║───║║║║║║─║║─╔╝║──║║╔═╝║║╚╝║──║║
    8. * ╚══╝╚══╝╚╝──╚╝╚╝───╚╝╚╝╚╝─╚╝─╚═╝──╚╝╚══╝╚══╝──╚╝
    9. *
    10. * @author Aurum79 aka Чук
    11. * @info ***
    12. * @link https://github.com/Yaro2709/New-Star
    13. * @Basis 2Moons: XG-Project v2.8.0
    14. * @Basis New-Star: 2Moons v1.8.0
    15. */
    16. class ShowBonusPage extends AbstractGamePage
    17. {
    18. public static $requireModule = MODULE_BONUS;
    19. function __construct()
    20. {
    21. parent::__construct();
    22. }
    23. function show()
    24. {
    25. global $USER, $PLANET, $LNG, $resource;
    26. $time = time();
    27. $midnight = strtotime('tomorrow midnight', $USER['bonus_time']);
    28. if ($time >= $midnight) {
    29. $bonus = [
    30. 921 => rand(100, 1000),
    31. 922 => rand(15, 100),
    32. 924 => rand(1, 3)
    33. ];
    34. foreach ($bonus as $id => $key) {
    35. $USER[$resource[$id]] += $bonus[$id];
    36. }
    37. $time = time();
    38. $db = Database::get();
    39. $sql = 'UPDATE %%USERS%% SET bonus_time = :time WHERE id = :userID;';
    40. $db->update($sql, array(
    41. ':time' => time(),
    42. ':userID' => $USER['id']
    43. ));
    44. $bonusList = [];
    45. foreach ($bonus as $id => $key) {
    46. $bonusList[$id] = [
    47. 'bonus' => $key
    48. ];
    49. }
    50. $this->tplObj->assign_vars([
    51. 'bonusList' => $bonusList
    52. ]);
    53. $this->display('page.bonus.default.tpl');
    54. } else {
    55. $this->redirectTo('game.php');
    56. }
    57. }
    58. }
    Display All

    The post was edited 3 times, last by Aerry ().

  • /styles/theme/nsc/templates/game/main.navigation.tpl


    PHP Source Code

    1. {if time() >= strtotime('tomorrow midnight', $bonus_time)}
    2. <a class="big_btn blue btn_menu btn_menu_big" href="game.php?page=bonus">{$LNG.lm_bonus}</a>
    3. {else}
    4. <a class="big_btn blue btn_menu btn_menu_big">{strtotime('tomorrow midnight', $bonus_time)}</a>
    5. {/if}

    The post was edited 2 times, last by Aerry ().