Hi
My english is no good.
2Moons 1.8 to 2.0 available.
This is a mod for finding Debris Field.
Ranked by metal or crystal size.
A screenshot is attached.
I hope this helps a lot.
1. Create a php file.
includes/game/ShowDebrisearchPage.class.php
Display All
2. Create a templates file.
templates\game\page.debriSearch.tpl
Display All
3. Add link.
<a href="game.php?page=debrisearch">Debris field</a>
Thanks.
My english is no good.
2Moons 1.8 to 2.0 available.
This is a mod for finding Debris Field.
Ranked by metal or crystal size.
A screenshot is attached.
I hope this helps a lot.
1. Create a php file.
includes/game/ShowDebrisearchPage.class.php
PHP Source Code: ShowDebrisearchPage.class.php
- <?php
- class ShowDebrisearchPage extends AbstractGamePage
- {
- public static $requireModule = 0;
- function __construct()
- {
- parent::__construct();
- }
- function show()
- {
- global $USER, $PLANET, $LNG ;
- $edit = HTTP::_GP('edit', '');
- $db = Database::get();
- /* ###### Activate to show only admin. #######
- if($USER['authlevel'] != 3){
- $this->printMessage("This is an invalid page.", array(array(
- 'label' => "Back",
- 'url' => 'game.php?page=overview'
- )));
- }
- */
- switch($edit)
- {
- default:
- $sql = "SELECT der_metal, der_crystal, galaxy, system, planet FROM %%PLANETS%% WHERE universe = :uni ORDER BY (der_metal + (der_crystal * 2)) DESC LIMIT 150;";
- $search = $db->select($sql, array(
- ':uni' => Universe::current()
- ));
- break;
- case 'met':
- $sql = "SELECT der_metal, der_crystal, galaxy, system, planet FROM %%PLANETS%% WHERE universe = :uni ORDER BY der_metal DESC LIMIT 150;";
- $search = $db->select($sql, array(
- ':uni' => Universe::current()
- ));
- break;
- case 'cry':
- $sql = "SELECT der_metal, der_crystal, galaxy, system, planet FROM %%PLANETS%% WHERE universe = :uni ORDER BY der_crystal DESC LIMIT 150;";
- $search = $db->select($sql, array(
- ':uni' => Universe::current()
- ));
- break;
- }
- $SearchResult = array();
- $i = 1;
- foreach($search as $s)
- {
- $SearchResult[] = array(
- 'rank' => $i,
- 'der_metal' => number_format($s['der_metal']),
- 'der_crystal' => number_format($s['der_crystal']),
- 'galaxy1' => $s['galaxy'],
- 'system1' => $s['system'],
- 'planet1' => $s['planet'],
- );
- $i++;
- }
- $this->assign(array(
- 'SearchResult' => $SearchResult,
- ));
- $this->display('page.debriSearch.tpl');
- }
- }
2. Create a templates file.
templates\game\page.debriSearch.tpl
Source Code: page.debriSearch.tpl
- {block name="title" prepend}{$LNG.lm_banned}{/block}
- {block name="content"}
- <style>
- .fontsize12{
- font-size:1.2em;
- }
- </style>
- <div class="content_page">
- <div class="title">
- Debri Status
- </div>
- <table width="100%" border="0" cellpadding="0" cellspacing="1">
- <tr>
- <th colspan="4" style="text-align:center;background-color:transparent;height:30px;color:#fff;font-weight:700;font-size:14px">Debris Zone Ranking(1 ~ 150)</th>
- </tr>
- <tr style="color:green">
- <td colspan="4" style="height:25px" class="fontsize12">Choice->
- <a href="game.php?page=debrisearch" class="fontsize12">【Metal + Crystal】</a>
- <a href="game.php?page=debrisearch&edit=met" class="fontsize12">【Metal】</a>
- <a href="game.php?page=debrisearch&edit=cry" class="fontsize12">【Crystal】</a>
- </td>
- </tr>
- <tr class="title" >
- <th height="27px" class="fontsize12">No.</th>
- <th class="fontsize12">Coordinate</th>
- <th class="fontsize12">Metal</th>
- <th class="fontsize12">Crystal</th>
- </tr>
- {foreach item=SearchInfo from=$SearchResult}
- <tr>
- <td class="fontsize12">{$SearchInfo.rank}</td>
- <td style="height:27px;" class="fontsize12">
- <a href="game.php?page=galaxy&galaxy={$SearchInfo.galaxy1}&system={$SearchInfo.system1}">[{$SearchInfo.galaxy1}:{$SearchInfo.system1}:{$SearchInfo.planet1}]</a></td>
- <td class="fontsize12">{$SearchInfo.der_metal}</td>
- <td class="fontsize12">{$SearchInfo.der_crystal}</td>
- </tr>
- {/foreach}
- </table>
- </div>
- {/block}
3. Add link.
<a href="game.php?page=debrisearch">Debris field</a>
Thanks.

--------------------------------------------------------------------------------------
The post was edited 1 time, last by noonn ().