errors

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

  • Hello my script is unofficial, if you require help, it should be good to post some code

    Regards
  • lol....sorry about that.....here is the error i get



    Issue: Undefined index: lvlup
    File: /includes/pages/game/class.ShowBuildingsPage.php (Line 142)
    URL: darkhorizons.ca/test/game.php?page=buildings
    PHP: Version 5.4.45 [ litespeed ]
    MySQL: 10.0.27-MariaDB

    Debug Track:
    #0 /includes/pages/game/class.ShowBuildingsPage.php(142): errorHandler(8, 'Undefined index...', 'FILEPATH ...', 142, Array)
    #1 /includes/pages/game/class.ShowBuildingsPage.php(303): ShowBuildingsPage->AddBuildingToQueue(1, 0, true)
    #2 /game.php(40): ShowBuildingsPage->show()
    #3 {main}
  • You have a missing variable $lvlup here class.ShowBuildingsPage.php (Line 142)
    You need to code this, normaly it is defined in the template file, and also in the addbuildingtoqueue function

    Regards
  • You should have this in the tpl file normaly

    HTML Source Code

    1. <input id="b_input_{$ID}" class="build_number" type="number" value="{$Element.levelToBuild + 1}" min="{$Element.levelToBuild + 1}" maxlength="3" size="3" name="lvlup" onchange="counting('{$ID}');"></input>

    This in the php file

    PHP Source Code

    1. private function AddBuildingToQueue($Element, $lvlup, $lvlup1, $AddMode = true)
    2. {
    3. if($this->bOnInsert==FALSE)
    4. {
    5. $this->build_anz=(int)$_POST['lvlup'] - $_POST['lvlup1'];
    6. if($this->build_anz>=1 )
    7. {
    8. $this->bOnInsert=TRUE;
    9. while($this->build_anz>0)
    10. {
    11. $this->DoAddBuildingToQueue($Element, $AddMode);
    12. $this->build_anz=$this->build_anz-1;
    13. }
    14. $this->bOnInsert=FALSE;
    15. }
    16. }
    17. }
    Display All

    This also in php file

    PHP Source Code

    1. $this->AddBuildingToQueue($Element, $lvlup1, true);

    But it should be changed in

    PHP Source Code

    1. $this->AddBuildingToQueue($Element, $lvlup, $lvlup1, true);

    And this also in php file

    PHP Source Code

    1. $lvlup1 = HTTP::_GP('lvlup1', 0);

    You should add under/above it (doesnt matter)

    PHP Source Code

    1. $lvlup = HTTP::_GP('lvlup', 0);