Hi
My english is no good.
2Moons 1.8 to 2.0 available.
This mode allows you to change the image of the selected planet.
If there is a planet icon on the right, it will change as well.
A screenshot is attached.
I hope this helps a lot.
1. Create a php file.
includes/game/ShowEditimgPage.class.php
Display All
2. Create a tpl file.
templates/game/page.editimg.tpl
Display All
3. Open the file
templates/game/page.galaxy.default
Find line
.
.
<img src="{$dpath}planeten/small/s_{$currentPlanet.planet.image}.jpg" height="30" width="30" alt="">
.
.
img line change ( jpg->gif )
<img src="{$dpath}planeten/small/s_{$currentPlanet.planet.image}.gif" height="30" width="30" alt="">
4. Add link.
<a href="game.php?page=editimg">Planet image</a>
Thanks.
My english is no good.
2Moons 1.8 to 2.0 available.
This mode allows you to change the image of the selected planet.
If there is a planet icon on the right, it will change as well.
A screenshot is attached.
I hope this helps a lot.
1. Create a php file.
includes/game/ShowEditimgPage.class.php
PHP Source Code: ShowEditimgPage.class
- <?php
- class ShowEditimgPage extends AbstractGamePage
- {
- public static $requireModule = 0;
- function __construct()
- {
- parent::__construct();
- }
- function show()
- {
- global $USER, $PLANET, $LNG;
- $skdata = HTTP::_GP('sk', '');
- $db = Database::get();
- switch($skdata){
- case'change':
- $planetimage = HTTP::_GP('planetimage', '');
- $sql = "UPDATE %%PLANETS%% SET image = :pimg WHERE id = :planetID ;";
- $db->update($sql, array(
- ':planetID' => $PLANET['id'],
- ':pimg' => $planetimage
- ));
- $this->printMessage("<span style=font-size:1.2em;color:#58FA58>The image of the current planet has been changed.</span>", array(array(
- 'label' => "<font class=submit0>Move</font>",
- 'url' => 'game.php?page=editimg'
- )));
- }
- $this->assign(array(
- 'm1' => 1,
- ));
- $this->display('page.editimg.tpl');
- }
- }
2. Create a tpl file.
templates/game/page.editimg.tpl
HTML Source Code: page.editimg.tpl
- {block name="title" prepend}{$LNG.lm_statistics}{/block}
- {block name="content"}
- <style>
- </style>
- <div class="content_page">
- <div class="title fontsize12">
- Planet image change
- </div>
- <div style="text-align:center;line-height:1.5em;font-size:1.2em;color: #5ca6aa;background: #091d2e;padding:5px 0 0 0;">
- This mode allows you to change the image of the selected planet.
- </div>
- <form action="game.php?page=editimg&sk=change" method="post">
- <table style="width:100%">
- <tr class="title">
- <td colspan="4" style="font-size:1.3em;height:30px;">Choice</td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_trockenplanet01.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet01"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet02.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet02"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet03.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet04.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet04"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_trockenplanet05.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet05"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet06.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet06"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet07.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet07"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet08.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet08" ></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_trockenplanet09.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet09"></td>
- <td><img src="{$dpath}planeten/small/s_trockenplanet10.gif" width="50"> <input type="radio" name="planetimage" value="trockenplanet10"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet01.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet01"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet02.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet02"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet03.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet04.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet04"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet05.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet05"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet06.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet06"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet07.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet07"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet08.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet08"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet09.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet09"></td>
- <td><img src="{$dpath}planeten/small/s_dschjungelplanet10.gif" width="50"> <input type="radio" name="planetimage" value="dschjungelplanet10"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_eisplanet01.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet01"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet02.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet02"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet03.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet04.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet04"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_eisplanet05.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet05"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet06.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet06"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet07.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet07"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet08.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet08"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_eisplanet09.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet09"></td>
- <td><img src="{$dpath}planeten/small/s_eisplanet10.gif" width="50"> <input type="radio" name="planetimage" value="eisplanet10"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet01.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet01"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet02.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet02"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_wasserplanet03.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet04.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet04"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet05.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet05"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet06.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet06"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_wasserplanet07.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet07"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet08.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet08"></td>
- <td><img src="{$dpath}planeten/small/s_wasserplanet09.gif" width="50"> <input type="radio" name="planetimage" value="wasserplanet09"></td>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet01.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet01"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet02.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet02"></td>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet03.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet04.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet04"></td>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet05.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet05"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet06.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet06"></td>
- <td><img src="{$dpath}planeten/small/s_normaltempplanet07.gif" width="50"> <input type="radio" name="planetimage" value="normaltempplanet07"></td>
- <td><img src="{$dpath}planeten/small/s_wuestenplanet01.gif" width="50"> <input type="radio" name="planetimage" value="wuestenplanet01"></td>
- <td><img src="{$dpath}planeten/small/s_wuestenplanet02.gif" width="50"> <input type="radio" name="planetimage" value="wuestenplanet02"></td>
- </tr>
- <tr>
- <td><img src="{$dpath}planeten/small/s_wuestenplanet03.gif" width="50"> <input type="radio" name="planetimage" value="wuestenplanet03"></td>
- <td><img src="{$dpath}planeten/small/s_wuestenplanet04.gif" width="50"> <input type="radio" name="planetimage" value="wuestenplanet04"></td>
- </tr>
- <tr>
- <td> </td><td> </td><td colspan="2"><input type="submit" value="Change image"><br><br><br><br></td><td> </td><td> </td>
- </tr>
- </table>
- </form>
- </div>
- {/block}
3. Open the file
templates/game/page.galaxy.default
Find line
.
.
<img src="{$dpath}planeten/small/s_{$currentPlanet.planet.image}.jpg" height="30" width="30" alt="">
.
.
img line change ( jpg->gif )
<img src="{$dpath}planeten/small/s_{$currentPlanet.planet.image}.gif" height="30" width="30" alt="">
4. Add link.
<a href="game.php?page=editimg">Planet image</a>
Thanks.
--------------------------------------------------------------------------------------