Hi
My english is no good.
This mod is a galaxy dot map.
The distribution of planets in each galaxy can be easily identified.
A screenshot is attached.
I hope this helps a lot.
1. Create a file.
includes/game/ShowDotmapPage.class.php
Display All
2. Create a templates file.
page.dotmap.default.tpl
Display All
3. Add it to the desired location in the page.galaxy.default file.
<a href="game.php?page=dotmap&galaxy={$galaxy}" onclick="return Dialog.open(this.href, 520, 600);" href="#">DotMap of Galaxy {$galaxy}</a>
4. The map.png and map1.png files are attached.
Thanks.
My english is no good.
This mod is a galaxy dot map.
The distribution of planets in each galaxy can be easily identified.
A screenshot is attached.
I hope this helps a lot.
1. Create a file.
includes/game/ShowDotmapPage.class.php
PHP Source Code: ShowDotmapPage.class.php
- <?php
- class ShowDotmapPage extends AbstractGamePage
- {
- public static $requireModule = 0;
- function __construct()
- {
- parent::__construct();
- $this->setWindow('popup');
- $this->initTemplate();
- }
- function show()
- {
- global $USER, $LNG, $PLANET;
- $galaxy = HTTP::_GP('galaxy', '');
- $db = Database::get();
- $config = Config::get();
- $galaxyList = array();
- if(!empty($galaxy) && $galaxy == 1 || $galaxy == 2 || $galaxy == 3 || $galaxy == 4 || $galaxy == 5 || $galaxy == 6 || $galaxy == 7 || $galaxy == 8 || $galaxy == 9)
- {
- $sql = "SELECT * FROM %%PLANETS%% WHERE galaxy = :galaxy AND universe = :universe AND planet_type = '1' ORDER BY system DESC, planet DESC;" ;
- $Resulta = $db->select($sql, array(
- ':universe' => Universe::current(),
- ':galaxy' => $galaxy
- ));
- foreach ($Resulta as $Row)
- {
- $galaxyList[$Row['system']][$Row['planet']] = 1;
- }
- $col = $config->max_system + 1;
- echo "<div style=float:left;margin-left:-140px>
- <table border=1px>
- <tr><td colspan=$col><h2>Dot map of Galaxy $galaxy </h2></td></tr>
- <tr><td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td>
- <td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td></tr>";
- for ($y = 1; $y <= $config->max_system; $y++) {
- echo "<tr><td>$y</td>";
- for ($x = 1; $x <= $config->max_planets; $x++) {
- if(isset($galaxyList[$y][$x])){
- echo "<td class='tooltip' data-tooltip-content=$galaxy:$y:$x><img src=styles/theme/gow/img/map.png></td>";
- }else{
- echo "<td><img src=styles/theme/gow/img/map1.png></td>";
- }
- }
- "</tr>";
- }
- echo "<table></div>";
- } //if end
- $this->assign(array(
- 'galaxyList' => $galaxyList,
- ));
- $this->display('page.dotmap.default.tpl');
- }
- }
2. Create a templates file.
page.dotmap.default.tpl
Source Code
3. Add it to the desired location in the page.galaxy.default file.
<a href="game.php?page=dotmap&galaxy={$galaxy}" onclick="return Dialog.open(this.href, 520, 600);" href="#">DotMap of Galaxy {$galaxy}</a>
4. The map.png and map1.png files are attached.
Thanks.
--------------------------------------------------------------------------------------
The post was edited 2 times, last by noonn ().