Merge branch 'develop' into feature/new-router

This commit is contained in:
slawkens
2021-12-05 06:11:00 +01:00
109 changed files with 253 additions and 1134 deletions

View File

@@ -83,10 +83,10 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
$startTime = microtime(true);
}
$ret = parent::query(...$args);;
$ret = parent::query(...$args);
if($this->logged) {
$totalTime = microtime(true) - $startTime;
$this->log .= round($totalTime, 4) . ' ms - ' . $query . PHP_EOL;
$this->log .= round($totalTime, 4) . ' ms - ' . $args[0] . PHP_EOL;
}
return $ret;

View File

@@ -41,6 +41,7 @@ $locale['step_requirements_extension'] = '$EXTENSION$ PHP extension';
$locale['step_requirements_warning_images_guilds'] = 'Guild logo upload will not work';
$locale['step_requirements_warning_images_gallery'] = 'Gallery image upload will not work';
$locale['step_requirements_warning_player_signatures'] = 'Player Signatures will not work';
$locale['step_requirements_warning_install_plugins'] = 'It will be not possible to install plugins';
// config
$locale['step_config'] = 'Configuration';

View File

@@ -41,6 +41,7 @@ $locale['step_requirements_extension'] = 'Rozszerzenie PHP - $EXTENSION$';
$locale['step_requirements_warning_images_guilds'] = 'Nie będzie możliwości uploadu obrazków gildii';
$locale['step_requirements_warning_images_gallery'] = 'Nie będzie możliwości uploadu obrazków do galerii';
$locale['step_requirements_warning_player_signatures'] = 'Sygnatury graczy nie będą działać';
$locale['step_requirements_warning_install_plugins'] = 'Nie będzie można instalować rozszerzeń';
// config
$locale['step_config'] = 'Konfiguracja';

View File

@@ -59,6 +59,29 @@ else
$old_name = $player->getName();
$player->setName($name);
$player->save();
if ($db->hasTable('player_deaths') &&
$db->hasColumn('player_deaths', 'mostdamage_is_player') &&
$db->hasColumn('player_deaths', 'killed_by')) {
$namesToChange = $db->query('SELECT `player_id`, `time`, `is_player`, `killed_by`, `mostdamage_is_player`, `mostdamage_by` FROM `player_deaths` WHERE (`is_player` = 1 AND `killed_by` = ' . $db->quote($old_name) . ') OR (`mostdamage_is_player` = 1 AND `mostdamage_by` = ' . $db->quote($old_name) . ');');
if ($namesToChange->rowCount() > 0) {
foreach ($namesToChange->fetchAll(PDO::FETCH_ASSOC) as $row) {
$changeKey = '';
if ($row['is_player'] == '1' && $row['killed_by'] == $old_name) {
$changeKey = 'killed_by';
} else if ($row['mostdamage_is_player'] == '1' && $row['mostdamage_by'] == $old_name) {
$changeKey = 'mostdamage_by';
}
if (!empty($changeKey)) {
$db->update('player_deaths', [$changeKey => $name], ['player_id' => $row['player_id'], 'time' => $row['time']]);
}
}
}
}
$account_logged->setCustomField("premium_points", $points - $config['account_change_character_name_points']);
$account_logged->logAction('Changed name from <b>' . $old_name . '</b> to <b>' . $player->getName() . '</b>.');
$twig->display('success.html.twig', array(

View File

@@ -0,0 +1,123 @@
<style>
html { margin-top: 32px !important; }
* html body { margin-top: 32px !important; }
#ma-admin-bar {
direction: ltr;
color: #ccc;
font-size: 13px;
font-weight: 400;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
line-height: 2.46153846;
height: 32px;
position: fixed;
top: 0;
left: 0;
width: 100%;
min-width: 600px;
z-index: 99999;
background: #23282d;
}
#ma-admin-bar a.ab-item {
color: #eee;
font-weight: normal;
}
#ma-admin-bar ul, #ma-admin-bar ul li {
background: 0 0;
clear: none;
list-style: none;
margin: 0;
padding: 0 15px 0 0;
position: relative;
text-indent: 0;
z-index: 99999;
}
#ma-admin-bar li {
float: left;
}
#ma-admin-bar li:hover {
color: lightskyblue;
}
#ma-admin-bar .ab-top-secondary>li {
float: right;
margin-right: 15px;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #343a40;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: #eee;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {color: lightskyblue;}
.dropdown:hover .dropdown-content {display: block;}
</style>
<div id="ma-admin-bar">
<ul>
<li class="dropdown">
<a href="{{ constant('ADMIN_URL') }}" class="ab-item">
<img alt="MyAAC" src="{{ constant('ADMIN_URL') }}images/logo.png" class="brand-image img-circle elevation-3" style="opacity: .8; height: 26px; width: 26px">
<span class="brand-text">
<b>My</b>AAC
</span>
</a>
</li>
<li class="dropdown">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-house-door" viewBox="0 0 16 16">
<path d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z"></path>
</svg>
<a class="ab-item" href="#"><i class="bi bi-house"></i>{{ config.lua.serverName }}</a>
<div class="dropdown-content">
<a href="{{ getLink('') }}">Visit Site</a>
</div>
</li>
<li class="dropdown">
<a class="ab-item" href="#"><i class="bi bi-house"></i>New</a>
<div class="dropdown-content">
<a href="{{ constant('ADMIN_URL') }}?p=news&action=new">News</a>
<a href="{{ constant('ADMIN_URL') }}?p=pages&action=new">Page</a>
</div>
</li>
<li>
<a class="ab-item" href="{{ constant('ADMIN_URL') }}?p=plugins">
Plugins
</a>
</li>
<li>
<a class="ab-item" href="{{ constant('ADMIN_URL') }}?p=dashboard&clear_cache">
Clear Cache
</a>
</li>
</ul>
<ul class="ab-top-secondary">
<li class="dropdown">
<a class="ab-item" href="#">Hello, {{ username }}</a>
<div class="dropdown-content">
<a href="{{ getLink('account/manage') }}">Manage Account</a>
<a href="{{ constant('ADMIN_URL') }}?action=logout">Logout</a>
</div>
</li>
</ul>
</div>

View File

@@ -1,8 +1,7 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
theme: "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,

View File

@@ -104,7 +104,7 @@
$('#select-type').change(function () {
var value = $('#select-type').val();
if (value == {{ constant('ARTICLE') }}) {
if (value === {{ constant('ARTICLE') }}) {
$('#article-text').show();
$('#article-image').show();
} else {
@@ -116,20 +116,19 @@
</script>
{% endif %}
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
var unsaved = false;
var lastContent = '';
let unsaved = false;
let lastContent = '';
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
setup: function (ed) {
ed.on('NodeChange', function (e) {
if (ed.getContent() != lastContent) {
if (ed.getContent() !== lastContent) {
unsaved = true;
}
});

View File

@@ -64,7 +64,7 @@
</form>
</div>
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="{{ constant('BASE_URL') }}node_modules/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
$(function () {
$('#enable_tinymce').on('change', function (e) {
@@ -86,7 +86,6 @@
function init_tinymce() {
tinymce.init({
selector: "#body",
theme: "modern",
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,

View File

@@ -3,7 +3,30 @@
<td style="width: 17px"></td>
<td>
<div style="text-align:center"><h2>Ranking for {{ skillName }}{% if vocation is not null %} ({{ vocation }}){% endif %} on {{ config.lua.serverName }}</h2></div><br/>
<table border="0" cellpadding="4" cellspacing="1" width="100%"></table>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr>
<td>Filters</td>
<td>
<label for="vocationFilter">Choose a Skill</label>
<select onchange="location = this.value;" aria-label="skillFilter" id="skillFilter">
{% set i = 0 %}
{% for link, name in types %}
<option value="{{ getLink('highscores') }}/{{ link }}{% if vocation is defined %}/{{ vocation }}{% endif %}" class="size_xs">{{ name }}</option>
{% endfor %}
</select>
</td>
<td>
<label for="vocationFilter">Choose a vocation</label>
<select onchange="location = this.value;" aria-label="vocationFilter" id="vocationFilter">
<option value="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</option>
{% set i = 0 %}
{% for i in 1..config.vocations_amount %}
<option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="{{ config.vdarkborder }}">
{% if config.account_country %}