def bonus

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

  • hey i found this defbonus.....when installed id get this error ( i think this is 1.8 and someone tried to mod it to 1.7...just a guess) got it from another forum

    PHP Source Code

    1. Missing argument 1 for Config::get(), called in /includes/pages/game/class.ShowDefBonusPage.php on line 33 and defined
    2. File: /includes/classes/Config.class.php (Line 55)
    3. line 33 $config = Config::get();
    4. here is php file
    5. <?php
    6. /**
    7. * @package 2moons 1.7
    8. * @copyright
    9. * @version
    10. * @link
    11. */
    12. class ShowDefBonusPage extends AbstractPage
    13. {
    14. public static $requireModule = 0;
    15. function __construct()
    16. {
    17. parent::__construct();
    18. }
    19. function show()
    20. {
    21. global $LNG, $PLANET, $USER, $resource;
    22. $this->tplObj->loadscript('countdown.js');
    23. /**
    24. * Blocage si le joueur est en mode vacance
    25. * Blocking if Player is in Vacation Mode
    26. **/
    27. if(!empty($USER['urlaubs_modus'])){
    28. $this->printMessage("You can't access this page while you are in V mode!", true, array('game.php?page=DefBonus', 2));
    29. }
    30. $config = Config::get();
    31. $time = "1 Day";
    32. $ship1 = 200000 * $config->resource_multiplier;
    33. $ship2 = 10000 * $config->resource_multiplier;
    34. $ship3 = 200000 * $config->resource_multiplier;
    35. $cost = 10000;
    36. if($_POST){
    37. if($USER['darkmatter'] >= $cost){
    38. if($USER['def_bonus_time'] + 12*60*60 < TIMESTAMP){
    39. $db = Database::get();
    40. $USER['darkmatter'] -= $cost;
    41. $db->update("UPDATE %%USERS%% SET `def_bonus_time` = :bonusTime WHERE `id` = :userID ;", [':bonusTime' => TIMESTAMP, ':userID' => $USER['id']]);
    42. $db->update("UPDATE %%PLANETS%% SET `small_laser` = `small_laser` + :ship1, `misil_launcher` = `misil_launcher` + :ship3, `graviton_canyon` = `graviton_canyon` + :ship2 WHERE `id` = :planetID ;", [':ship1' => $ship1, ':ship2' => $ship2, ':ship3' => $ship3, ":planetID" => $PLANET['id']]);
    43. $this->printMessage("Pack has been bought and the account has been updated succesfully!", true, array('game.php?page=DefBonus', 2));
    44. }
    45. else{
    46. $this->printMessage("You can use this pack once every 2 days!", true, array('game.php?page=DefBonus', 2));
    47. }
    48. }
    49. else{
    50. $this->printMessage("You do not have enough Dark matter!", true, array('game.php?page=DefBonus', 2));
    51. }
    52. }
    53. $this->assign(array(
    54. 'cost' => pretty_number($cost),
    55. 'time' => $time,
    56. 'status' => ((($USER['def_bonus_time']+12*60*60) < TIMESTAMP) ? true : (($USER['def_bonus_time']+12*60*60) - TIMESTAMP)),
    57. 'ship1' => pretty_number($ship1),
    58. 'ship2' => pretty_number($ship2),
    59. 'ship3' => pretty_number($ship3),
    60. ));
    61. $this->display('page.defbonus.default.tpl');
    62. }
    63. }
    64. ?>
    Display All
  • PHP Source Code

    1. <?php
    2. /**
    3. * @package 2moons 1.7
    4. * @copyright
    5. * @version
    6. * @link
    7. */
    8. class ShowDefBonusPage extends AbstractPage
    9. {
    10. public static $requireModule = 0;
    11. function __construct()
    12. {
    13. parent::__construct();
    14. }
    15. function show()
    16. {
    17. global $LNG, $PLANET, $USER, $resource, $CONF;
    18. $this->tplObj->loadscript('countdown.js');
    19. /**
    20. * Blocage si le joueur est en mode vacance
    21. * Blocking if Player is in Vacation Mode
    22. **/
    23. if(!empty($USER['urlaubs_modus'])){
    24. $this->printMessage("You can't access this page while you are in V mode!", true, array('game.php?page=DefBonus', 2));
    25. }
    26. $time = "1 Day";
    27. $ship1 = 200000 * $CONF['resource_multiplier'];
    28. $ship2 = 10000 * $CONF['resource_multiplier'];
    29. $ship3 = 200000 * $CONF['resource_multiplier'];
    30. $cost = 10000;
    31. if($_POST){
    32. if($USER['darkmatter'] >= $cost){
    33. if($USER['def_bonus_time'] + 12*60*60 < TIMESTAMP){
    34. $USER['darkmatter'] -= $cost;
    35. $GLOBALS['DATABASE']->query("UPDATE ".USERS." SET `def_bonus_time` = ".TIMESTAMP." `id` = ".$USER['id']." ;");
    36. $GLOBALS['DATABASE']->query("UPDATE ".PLANETS." SET `small_laser` = `small_laser` + ".$ship1.", `misil_launcher` = `misil_launcher` + ".$ship3.", `graviton_canyon` = `graviton_canyon` + ".$ship2." WHERE `id` = ".$PLANET['id']." ;");
    37. $this->printMessage("Pack has been bought and the account has been updated succesfully!", true, array('game.php?page=DefBonus', 2));
    38. }
    39. else{
    40. $this->printMessage("You can use this pack once every 2 days!", true, array('game.php?page=DefBonus', 2));
    41. }
    42. }
    43. else{
    44. $this->printMessage("You do not have enough Dark matter!", true, array('game.php?page=DefBonus', 2));
    45. }
    46. }
    47. $this->tplObj->assign_vars(array(
    48. 'cost' => pretty_number($cost),
    49. 'time' => $time,
    50. 'status' => ((($USER['def_bonus_time']+12*60*60) < TIMESTAMP) ? true : (($USER['def_bonus_time']+12*60*60) - TIMESTAMP)),
    51. 'ship1' => pretty_number($ship1),
    52. 'ship2' => pretty_number($ship2),
    53. 'ship3' => pretty_number($ship3),
    54. ));
    55. $this->display('page.defbonus.default.tpl');
    56. }
    57. }
    58. ?>
    Display All
  • error.......thanks for helping
    Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/techsup0/public_html/includes/pages/game/class.ShowDefBonusPage.php on line 44

    line 44 : $GLOBAL['DATABASE']->query("UPDATE ".PLANETS." SET `small_laser` = `small_laser` + ".$ship1.", `misil_launcher` = `misil_launcher` + ".$ship3.", `graviton_canyon` = `graviton_canyon` + ".$ship2." WHERE `id` = $PLANET['id'] ;");
  • you added this to the database


    alter table uni1_users add bonus_page_time2 int(11) not null default '0';
  • im sorry for bothering you guys.....yes the table was added


    Fatal error: Call to undefined method ShowDefBonusPage::assign() in /home/techsup0/public_html/includes/pages/game/class.ShowDefBonusPage.php on line 56

    line 56 : $this->assign(array(
  • :P :P :P :P i think i busted a few nerves today sorry
    $GLOBAL['DATABASE']->query("UPDATE ".USERS." SET `def_bonus_time` = ".TIMESTAMP." `id` = ".$USER['id']." ;");


    Undefined variable: GLOBAL
    File: /includes/pages/game/class.ShowDefBonusPage.php (Line 42)
  • heres the working php for 1.7

    <?php
    class ShowDefBonusPage extends AbstractPage
    {
    public static $requireModule = 0;
    function __construct()
    {
    parent::__construct();
    }
    function show()
    {
    global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
    $this->tplObj->loadscript('countdown.js');



    if(!empty($USER['urlaubs_modus'])){
    $this->printMessage("You can't access this page while you are in V mode!", true, array('game.php?page=DefBonus', 2));
    die();
    }
    $time = "1 Day";
    $ship1 = 200000;
    $ship2 = 10000;
    $ship3 = 200000;
    $cost = 10000;

    if($_POST){
    if($USER['darkmatter'] >= $cost){
    if($USER['def_bonus_time']+12*60*60 < TIMESTAMP){
    $USER['darkmatter'] -= $cost;
    $GLOBALS['DATABASE']->query("UPDATE ".USERS." set `def_bonus_time` = '".TIMESTAMP."' where `id` = '".$USER['id']."';");
    $GLOBALS['DATABASE']->query("UPDATE ".PLANETS." set `small_laser` = `small_laser` + '".$ship1."', `misil_launcher` = `misil_launcher` + '".$ship3."', `graviton_canyon` = `graviton_canyon` + '".$ship2."' where `id` = '".$PLANET['id']."';");
    $this->printMessage("Pack has been bought and the account has been updated succesfully!", true, array('game.php?page=DefBonus', 2));
    die();
    }
    else{
    $this->printMessage("You can use this pack once every 2 days!", true, array('game.php?page=DefBonus', 2));
    die();
    }
    }
    else{
    $this->printMessage("You do not have enough Dark matter!", true, array('game.php?page=DefBonus', 2));
    die();
    }
    }
    $this->tplObj->assign_vars(array(
    'cost' => pretty_number($cost),
    'time' => $time,
    'status' => ((($USER['def_bonus_time']+12*60*60) < TIMESTAMP) ? true : (($USER['def_bonus_time']+12*60*60) - TIMESTAMP)),
    'ship1' => pretty_number($ship1),
    'ship2' => pretty_number($ship2),
    'ship3' => pretty_number($ship3),
    ));


    $this->display('page.defbonus.default.tpl');

    }
    }
    ?>