mirror of
https://github.com/slawkens/myaac.git
synced 2025-07-09 13:28:32 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2fe9924437 | ||
![]() |
f0f2e3785f | ||
![]() |
36ca755243 | ||
![]() |
f17269e44c | ||
![]() |
dcb96f4ce1 | ||
![]() |
a89f9a8484 | ||
![]() |
45d6047031 |
@ -27,6 +27,13 @@ $nameOrNumberColumn = getAccountIdentityColumn();
|
|||||||
|
|
||||||
$hasSecretColumn = $db->hasColumn('accounts', 'secret');
|
$hasSecretColumn = $db->hasColumn('accounts', 'secret');
|
||||||
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||||
|
|
||||||
|
$hasCoinsTransferableColumn = $db->hasColumn('accounts', 'coins_transferable');
|
||||||
|
$hasTransferableCoinsColumn = $db->hasColumn('accounts', 'transferable_coins');
|
||||||
|
$coinsTransferableColumn =
|
||||||
|
$hasTransferableCoinsColumn ?
|
||||||
|
'transferable_coins' : 'coins_transferable';
|
||||||
|
|
||||||
$hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
|
$hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
|
||||||
$hasTypeColumn = $db->hasColumn('accounts', 'type');
|
$hasTypeColumn = $db->hasColumn('accounts', 'type');
|
||||||
$hasGroupColumn = $db->hasColumn('accounts', 'group_id');
|
$hasGroupColumn = $db->hasColumn('accounts', 'group_id');
|
||||||
@ -141,6 +148,13 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
$t_coins = $_POST['t_coins'];
|
$t_coins = $_POST['t_coins'];
|
||||||
verify_number($t_coins, 'Tibia coins', 12);
|
verify_number($t_coins, 'Tibia coins', 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// transferable tibia coins
|
||||||
|
if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn) {
|
||||||
|
$t_coins_transferable = $_POST['t_coins_transferable'];
|
||||||
|
verify_number($t_coins_transferable, 'Transferable Tibia coins', 12);
|
||||||
|
}
|
||||||
|
|
||||||
// prem days
|
// prem days
|
||||||
$p_days = (int)$_POST['p_days'];
|
$p_days = (int)$_POST['p_days'];
|
||||||
verify_number($p_days, 'Prem days', 11);
|
verify_number($p_days, 'Prem days', 11);
|
||||||
@ -185,12 +199,18 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
if ($hasSecretColumn) {
|
if ($hasSecretColumn) {
|
||||||
$account->setCustomField('secret', $secret);
|
$account->setCustomField('secret', $secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
$account->setCustomField('key', $key);
|
$account->setCustomField('key', $key);
|
||||||
$account->setEMail($email);
|
$account->setEMail($email);
|
||||||
|
|
||||||
if ($hasCoinsColumn) {
|
if ($hasCoinsColumn) {
|
||||||
$account->setCustomField('coins', $t_coins);
|
$account->setCustomField('coins', $t_coins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn) {
|
||||||
|
$account->setCustomField($coinsTransferableColumn, $t_coins_transferable);
|
||||||
|
}
|
||||||
|
|
||||||
$lastDay = 0;
|
$lastDay = 0;
|
||||||
if($p_days != 0 && $p_days != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
if($p_days != 0 && $p_days != OTS_Account::GRATIS_PREMIUM_DAYS) {
|
||||||
$lastDay = time();
|
$lastDay = time();
|
||||||
@ -401,6 +421,12 @@ else if (isset($_REQUEST['search'])) {
|
|||||||
<input type="text" class="form-control" id="t_coins" name="t_coins" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField('coins') ?>"/>
|
<input type="text" class="form-control" id="t_coins" name="t_coins" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField('coins') ?>"/>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if ($hasCoinsTransferableColumn || $hasTransferableCoinsColumn): ?>
|
||||||
|
<div class="col-12 col-sm-12 col-lg-6">
|
||||||
|
<label for="t_coins_transferable">Transferable Tibia Coins:</label>
|
||||||
|
<input type="text" class="form-control" id="t_coins_transferable" name="t_coins_transferable" autocomplete="off" maxlength="11" value="<?php echo $account->getCustomField($coinsTransferableColumn) ?>"/>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="col-12 col-sm-12 col-lg-6">
|
<div class="col-12 col-sm-12 col-lg-6">
|
||||||
<label for="p_days">Premium Days:</label>
|
<label for="p_days">Premium Days:</label>
|
||||||
<input type="text" class="form-control" id="p_days" name="p_days" autocomplete="off" maxlength="11" value="<?php echo $account->getPremDays(); ?>"/>
|
<input type="text" class="form-control" id="p_days" name="p_days" autocomplete="off" maxlength="11" value="<?php echo $account->getPremDays(); ?>"/>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
||||||
|
|
||||||
const MYAAC = true;
|
const MYAAC = true;
|
||||||
const MYAAC_VERSION = '1.7.1';
|
const MYAAC_VERSION = '1.7.2-dev';
|
||||||
const DATABASE_VERSION = 45;
|
const DATABASE_VERSION = 45;
|
||||||
const TABLE_PREFIX = 'myaac_';
|
const TABLE_PREFIX = 'myaac_';
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
|
@ -162,15 +162,6 @@ if(setting('core.anonymous_usage_statistics')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @var OTS_Account $account_logged
|
|
||||||
*/
|
|
||||||
if ($logged && admin()) {
|
|
||||||
$content .= $twig->render('admin-bar.html.twig', [
|
|
||||||
'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$title_full = (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName'];
|
$title_full = (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName'];
|
||||||
require $template_path . '/' . $template_index;
|
require $template_path . '/' . $template_index;
|
||||||
|
|
||||||
|
@ -512,6 +512,13 @@ function template_place_holder($type): string
|
|||||||
}
|
}
|
||||||
elseif ($type === 'body_start') {
|
elseif ($type === 'body_start') {
|
||||||
$ret .= $twig->render('browsehappy.html.twig');
|
$ret .= $twig->render('browsehappy.html.twig');
|
||||||
|
|
||||||
|
if (admin()) {
|
||||||
|
global $account_logged;
|
||||||
|
$ret .= $twig->render('admin-bar.html.twig', [
|
||||||
|
'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif($type === 'body_end') {
|
elseif($type === 'body_end') {
|
||||||
$ret .= template_ga_code();
|
$ret .= template_ga_code();
|
||||||
|
@ -1062,6 +1062,12 @@ Sent by MyAAC,<br/>
|
|||||||
'desc' => 'How often to update highscores from database in minutes. Too low may slow down your website.<br/>0 to disable.',
|
'desc' => 'How often to update highscores from database in minutes. Too low may slow down your website.<br/>0 to disable.',
|
||||||
'default' => 15,
|
'default' => 15,
|
||||||
],
|
],
|
||||||
|
'highscores_skills_box' => [
|
||||||
|
'name' => 'Display Skills Box',
|
||||||
|
'type' => 'boolean',
|
||||||
|
'desc' => 'show "Choose a skill" box on the highscores (allowing peoples to sort highscores by skill)?',
|
||||||
|
'default' => true,
|
||||||
|
],
|
||||||
'highscores_vocation_box' => [
|
'highscores_vocation_box' => [
|
||||||
'name' => 'Display Vocation Box',
|
'name' => 'Display Vocation Box',
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
|
@ -532,8 +532,9 @@ class Plugins {
|
|||||||
self::$plugin_json = $plugin_json;
|
self::$plugin_json = $plugin_json;
|
||||||
if ($plugin_json == null) {
|
if ($plugin_json == null) {
|
||||||
self::$warnings[] = 'Cannot load ' . $file_name . '. File might be not a valid json code.';
|
self::$warnings[] = 'Cannot load ' . $file_name . '. File might be not a valid json code.';
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$continue = true;
|
$continue = true;
|
||||||
|
|
||||||
if(!isset($plugin_json['name']) || empty(trim($plugin_json['name']))) {
|
if(!isset($plugin_json['name']) || empty(trim($plugin_json['name']))) {
|
||||||
@ -689,7 +690,10 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($continue) {
|
if(!$continue) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!$zip->extractTo(BASE)) { // "Real" Install
|
if(!$zip->extractTo(BASE)) { // "Real" Install
|
||||||
self::$error = 'There was a problem with extracting zip archive to base directory.';
|
self::$error = 'There was a problem with extracting zip archive to base directory.';
|
||||||
$zip->close();
|
$zip->close();
|
||||||
@ -713,13 +717,8 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearCache();
|
clearCache();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function isEnabled($pluginFileName): bool
|
public static function isEnabled($pluginFileName): bool
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ else {
|
|||||||
$file = BASE . $template_path . '/layout_config.ini';
|
$file = BASE . $template_path . '/layout_config.ini';
|
||||||
}
|
}
|
||||||
|
|
||||||
$template_ini = parse_ini_file($file);
|
$template_ini = parse_ini_file($file, true);
|
||||||
unset($file);
|
unset($file);
|
||||||
|
|
||||||
if ($cache->enabled()) {
|
if ($cache->enabled()) {
|
||||||
|
@ -94,8 +94,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
{% if setting('core.highscores_skills_box') or setting('core.highscores_vocation_box') %}
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="15%" valign="top" align="right">
|
<td width="15%" valign="top" align="right">
|
||||||
|
{% if setting('core.highscores_skills_box') %}
|
||||||
<table style="border: 0; width: 100%" cellpadding="4" cellspacing="1">
|
<table style="border: 0; width: 100%" cellpadding="4" cellspacing="1">
|
||||||
<tr bgcolor="{{ config.vdarkborder }}">
|
<tr bgcolor="{{ config.vdarkborder }}">
|
||||||
<td class="white"><B>Choose a skill</B></TD>
|
<td class="white"><B>Choose a skill</B></TD>
|
||||||
@ -109,7 +111,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
{% if config.highscores_vocation_box %}
|
{% endif %}
|
||||||
|
{% if setting('core.highscores_vocation_box') %}
|
||||||
<table border="0" width="100%" cellpadding="4" cellspacing="1">
|
<table border="0" width="100%" cellpadding="4" cellspacing="1">
|
||||||
<tr bgcolor="{{ config.vdarkborder }}">
|
<tr bgcolor="{{ config.vdarkborder }}">
|
||||||
<td class="white"><b>Choose a vocation</b></td>
|
<td class="white"><b>Choose a vocation</b></td>
|
||||||
@ -126,5 +129,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 18px"></td>
|
<td style="width: 18px"></td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user