Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added resource limitation mods during an expedition by admin panel
- Loading branch information
Showing
8 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* 2moons-2.0 | ||
* The project is reserved for its owner for any bug or question you can contact him | ||
* Created by 2moons-2.0. | ||
* User: Danter14 (danter14000@gmail.com) | ||
* Copyright: 2019 - Danter14 | ||
* GitHub: https://github.com/HikeGame/Spaccon-1.0 | ||
* Date: 17/01/2019 | ||
* File: ShowConfigModsPage.php | ||
* Version: 1.0.0 | ||
*/ | ||
if (!allowedTo(str_replace(array(dirname(__FILE__), '\\', '/', '.php'), '', __FILE__))) throw new Exception("Permission error!"); | ||
|
||
function ShowConfigModsPage() | ||
{ | ||
global $LNG; | ||
$config = Config::get(Universe::getEmulated()); | ||
|
||
if (!empty($_POST)) | ||
{ | ||
$config_before = array( | ||
'expedition_limit_res' => $config->expedition_limit_res, | ||
'expedition_limit_res_active' => $config->expedition_limit_res_active, | ||
); | ||
|
||
$expedition_limit_res_active = isset($_POST['expedition_limit_res_active']) && $_POST['expedition_limit_res_active'] == 'on' ? 1 : 0; | ||
|
||
$expedition_limit_res = HTTP::_GP('expedition_limit_res', 0); | ||
|
||
$config_after = array( | ||
'expedition_limit_res' => $expedition_limit_res, | ||
'expedition_limit_res_active' => $expedition_limit_res_active, | ||
); | ||
|
||
foreach($config_after as $key => $value) | ||
{ | ||
$config->$key = $value; | ||
} | ||
$config->save(); | ||
|
||
$LOG = new Log(3); | ||
$LOG->target = 0; | ||
$LOG->old = $config_before; | ||
$LOG->new = $config_after; | ||
$LOG->save(); | ||
} | ||
|
||
$template = new template(); | ||
|
||
$template->assign_vars(array( | ||
'expedition_limit_res' => $config->expedition_limit_res, | ||
'expedition_limit_res_active' => $config->expedition_limit_res_active, | ||
)); | ||
|
||
$template->show('ConfigModsBody.tpl'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{include file="overall_header.tpl"} | ||
<center> | ||
<form action="" method="post"> | ||
<input type="hidden" name="opt_save" value="1"> | ||
<table width="70%" cellpadding="2" cellspacing="2"> | ||
<tr> | ||
<th colspan="2">{$LNG.msg_expedition}</th><th> </th> | ||
</tr | ||
<tr> | ||
<td>{$LNG.msg_expedition_active}<br></td> | ||
<td><input name="expedition_limit_res_active"{if $expedition_limit_res_active} checked="checked"{/if} type="checkbox"></td> | ||
<td><img src="./styles/resource/images/admin/i.gif" width="16" height="16" alt="" class="tooltip" data-tooltip-content="{$LNG.msg_expedition_active_desc}"></td> | ||
</tr> | ||
<tr> | ||
<td>{$LNG.msg_expedition_active_price}</td> | ||
<td><input name="expedition_limit_res" maxlength="40" size="60" value="{$expedition_limit_res}" type="text"></td> | ||
<td><img src="./styles/resource/images/admin/i.gif" width="16" height="16" alt="" class="tooltip" data-tooltip-content="{$LNG.msg_expedition_active_price_desc}"></td> | ||
</tr> | ||
<tr> | ||
<td colspan="3"><input value="{$LNG.se_save_parameters}" type="submit"></td> | ||
</tr> | ||
</table> | ||
</form> | ||
</center> | ||
{include file="overall_footer.tpl"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters