Add new option in left menu

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

    • Add new option in left menu

      i wanna ask how i add let say new text option of page below simular
      to create new page where i should edit files :)




      Galaxy
      Alliance
      Forum
      Statistics
      Records
      Hall of Fame
      Search
      Chat
      Support
      FAQ
      Banned
      Rules
      Simulator
    • New page should be created as php file on includes/pages/game

      FIlename: Show(YOURPAGENAME)Page.class.php
      Content to run ingame

      Source Code

      1. class Show(YOURPAGENAME)Page extends AbstractGamePage
      2. {
      3. public static $requireModule = 0;
      4. function __construct()
      5. {
      6. parent::__construct();
      7. /* If you want to remove headers etc, like phalanx, news page... */
      8. // $this->setWindow('popup');
      9. $this->initTemplate();
      10. }
      11. function show()
      12. {
      13. // Which vars should be run, $reslist arrays for vars, $resource for specific elements, $PLANET for your planets...
      14. global $LNG, $USER;
      15. $this->display('(TEMPLATENAME).tpl');
      16. }
      17. }
      Display All

      Then you have to create a template file under styles/templates/game. it must match with $this->display file name

      Source Code

      1. {block name="title" prepend}My Page{/block}
      2. {block name="content"}
      3. My HTML/PHP stuff
      4. {/block}
      To add your page ingame button you go to main.navigation.tpl and simply add <li><a href="game.php?page=(YOURPAGENAME)">My Page</a></li> and you're done
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Check my mods here - stellaron.space/index.php?page=2Moons

      I can build any mod. Need my service? Contact me via PM
    • when you create the php that gos in the icludes/game folder and the tpl file the styles/templates/game in the navigation.tpl or were ever you want it you place the hyperlink to the location
    • you mean link to text or sommething else can you show me example where i should put it i wanna write some text there but nothing shows up
    • i placed in left menu dark matter shop now when i click on it it says this
      This page does not exist
      for now i wanna write text inside dark shop page to remove this This page does not exist
      Images
      • a1.png

        1.45 MB, 1,366×609, viewed 100 times
      • a2.png

        1.27 MB, 1,366×602, viewed 97 times
    • i bought paypal mod and added to left side
      when you create page and everything go to
      Styles -Templates-Game - main.navigation.tpl
      Find any line like these and add new line copy let say this imperium and where it starts with game.php copy yours page name
      it must be like this "game.php?page=Premium "added instead "game.php?page=imperium" then add name to see on left side

      {$LNG.lm_empire} change to {$LNG.Premium}

      and yours code should look like this

      {if isModuleAvailable($smarty.const.MODULE_IMPERIUM)}<li><a href="game.php?page=Premium">{$LNG.Premium}</a></li>{/if}

      Then save and reload page
      {if isModuleAvailable($smarty.const.MODULE_IMPERIUM)}<li><a href="game.php?page=imperium">{$LNG.lm_empire}</a></li>{/if}
      {if isModuleAvailable($smarty.const.MODULE_IMPERIUM)}<li><a href="game.php?page=imperium">{$LNG.lm_empire}</a></li>{/if}
      {if isModuleAvailable($smarty.const.MODULE_RESEARCH)}<li><a href="game.php?page=research">{$LNG.lm_research}</a></li>{/if}
      {if isModuleAvailable($smarty.const.MODULE_BUILDING)}<li><a href="game.php?page=buildings">{$LNG.lm_buildings}</a></li>{/if}
      Images
      • 11.png

        1.02 MB, 1,246×585, viewed 22 times