mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00

* New admin panel Pages: Options + Config [WIP] * Forgot the plugin example of options * Rename to settings.php * Add Settings Class * New myaac_settings table * Add $limit parameter to $db->select method * Add $member var annotation * Remove useless title_separator from config * Move $menus to menus.php Also fix active link when menu item has subpage * Settings [WIP] New Settings class New Plugins::load() method Move config.php to settings.php MyAAC Settings will have plugin_name = 'core' Add compat_config.php * Change options.php to settings.php * Change name to settings * Add Settings menu * Add Sections + Add setting($key) function Reorganisation * Add email + password fields as type * Update 33.php * add settings migration * php 8 compatibility * add missing hook * Add categories in tabs, move more settings, revert back getPluginSettings Categories and sections are now not numbered Remove example settings plugin * fix typo * Update .gitignore * Add 36th migration for settings table * Execute migrations just after db connect * Update plugins.php * [WIP] Some work on settings Add hidden settings New method: parse, to parse settings from array Move base html to twig template Remove vocation loading from .xml, instead use predefined voc names * Rename * Fix path * [WIP] More work on settings Move more config to settings (mainly mail_* + some other) Remove mail_admin, wasnt used anywhere Add return type to some functions Add Twig settings(key) function Possibility to save setting to db * Add min, max, step to number field option * Re-enable plugin if disabled and already installed * Add Settings menu, including all plugins with settings One change included in previous commit, due to missclick * Nothing important * Better boolean detection * More detailed error message in settings * Lets call it settings.name instead * Add new function: only_if, to hide fields when they are not enabled [WIP] Not fully finished yet * guild_management: show_if * Hide section title on show_if * Fix: check on page load if radio button is checked * Add: show_if - account_mail_verify * nothing important * Rename team_* variables + add to deprecated * Change variable name * Extract Settings:save function * Add settings.callbacks.get * Move forum config to settings * Move status config to settings * Remove whitespaces * More config to settings: account_types, genders, highscores, admin * Move signature config to settings * Move news config to settings * Rename variable * Save config.php in Settings Egg and hen problem solved :) * Test database connection on save settings -> prevents from making website unusable if connection is wrong * Test server_path -> same There is no config.php anymore, just config.local.php, which can be edited manually and also from admin panel * Remove configs from previous commit * Fix create account, if account_create_character_create is enabled * Add more deprecated configs * Add more info into comment * Update 5-database.php * Fix menu highlighting & opening * Update template.php * Enable script option * Reword email settings + move two new settings * add last_kills_limit + move shop * google_analytics_id * add mail_lost_account_interval * Create character blocked words (by @gpedro), just moved to settings * Fix google_analytics * create character name config moved to settings * Fix for install warning - min/max length * New create character checks configurable: block monsters & spells names * fixes * Improve character npc name check * New setting: donate_column + move donate config to settings * Add super fancy No Refresh saving with a toast * Add new possibility: to deny saving setting if condition is not met * Move database settings to separate category * Fix default value displaying * Add database_hash setting * add last_kills_limit to compat config * Move create character blocked names down * Every setting needs to have default * Move rest of config to settings Remove config.php completely Add new settings category: Game Fix account_login_by_email Min textarea size = 2 + adjusted automatically
435 lines
14 KiB
Twig
435 lines
14 KiB
Twig
<script type="text/javascript" src="tools/js/tipped.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="tools/css/tipped.css"/>
|
|
<script>
|
|
$(document).ready(function() {
|
|
Tipped.create('.item_image');
|
|
});
|
|
</script>
|
|
{% set rows = 0 %}
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
|
|
<td><img src="{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0"></td>
|
|
<td>
|
|
{{ hook(constant('HOOK_CHARACTERS_BEFORE_INFORMATIONS')) }}
|
|
{% if canEdit %}
|
|
<a href="{{ constant('ADMIN_URL') }}?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
|
|
<img src="images/edit.png"/>Edit
|
|
</a>
|
|
{% endif %}
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
{% if config.characters.outfit %}
|
|
<div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:{% if player.getLookType() in config.outfit_images_wrong_looktypes %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ outfit }}" alt="player outfit"/></div>
|
|
{% endif %}
|
|
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><b>Character Information</b></td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="20%">Name:</td>
|
|
<td>{{ flag|raw }} <span style="color: {% if player.isOnline() %}green{% else %}red{% endif %}"><b>{{ player.getName() }}</b></span>{{ oldName }}</td>
|
|
</tr>
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Sex:</td>
|
|
<td>{{ sex }}</td>
|
|
</tr>
|
|
|
|
{% if marriage_enabled %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Marital status:</td>
|
|
<td>{{ marital_status }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Profession:</td>
|
|
<td>{{ vocation }}</td>
|
|
</tr>
|
|
|
|
{% if config.characters.level %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Level:</td>
|
|
<td>{{ player.getLevel() }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if config.characters.experience %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Experience:</td>
|
|
<td>{{ player.getExperience() }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if config.characters.magic_level %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Magic Level:</td>
|
|
<td>{{ player.getMagLevel() }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if frags_enabled %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Frags:</td>
|
|
<td>{{ frags_count }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Residence:</td>
|
|
<td>{{ town }}</td>
|
|
</tr>
|
|
|
|
{% if config.characters.balance %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Balance:</td>
|
|
<td>{{ player.getBalance() }} Gold Coins.</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if house.found %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>House:</td>
|
|
<td>
|
|
<table border="0">
|
|
<tr>
|
|
<td>{{ house.name ~ house.town ~ house.add }}</td>
|
|
<td>
|
|
<form action="?subtopic=houses&page=view" method="post">
|
|
<input type="hidden" name="house" value="{{ house.name }}">
|
|
<input type="image" name="View" alt="View" src="{{ template_path }}/images/global/buttons/sbutton_view.gif" border="0" width="120">
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if guild.rank is not null %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Guild membership:</td>
|
|
<td>{{ guild.rank }} of the {{ guild.link|raw }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Last login:</td>
|
|
<td>{% if player.getLastLogin() == 0 %}Never logged in.{% else %}{{ player.getLastLogin()|date("M d Y, H:i:s") }} CEST{% endif %}</td>
|
|
</tr>
|
|
|
|
{% if config.characters.creation_date %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Created:</td>
|
|
<td>{{ player.getCreated()|date("M d Y, H:i:s") }} CEST</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if comment is not null %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td valign="top">Comment:</td>
|
|
<td style="word-break: break-all">{{ comment|raw }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Account Status:</td>
|
|
<td>{% if account.isPremium() %}Premium Account{% else %}Free Account{% endif %}</td>
|
|
</tr>
|
|
</table>
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_INFORMATIONS')) }}
|
|
<br/>
|
|
<table border="0" width="100%">
|
|
<tr>
|
|
{{ hook(constant('HOOK_CHARACTERS_BEFORE_SKILLS')) }}
|
|
|
|
{% if config.characters.skills %}
|
|
<!-- SKILLS -->
|
|
<td width="30%" valign="top">
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><B>Skills</b></td>
|
|
</tr>
|
|
{% set i = 0 %}
|
|
{% for skill in skills %}
|
|
{% set i = i + 1 %}
|
|
<tr bgcolor="{{ getStyle(i) }}">
|
|
<td valign="top">{{ skill.name }}</td>
|
|
<td>{{ skill.value }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</td>
|
|
<!-- SKILLS_END -->
|
|
{% endif %}
|
|
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_SKILLS')) }}
|
|
|
|
{% if quests_enabled %}
|
|
<!-- QUESTS -->
|
|
<td width="40%" valign="top">
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><b>Quests</b></td>
|
|
</tr>
|
|
{% set i = 0 %}
|
|
{% for name, done in quests %}
|
|
{% set i = i + 1 %}
|
|
<tr bgcolor="{{ getStyle(i) }}">
|
|
<td valign="top">{{ name }}</TD>
|
|
<td><img src="images/{% if done %}true{% else %}false{% endif %}.png" border="0"/></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</td>
|
|
<!-- QUESTS_END -->
|
|
{% endif %}
|
|
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_QUESTS')) }}
|
|
|
|
{% if config.characters.equipment %}
|
|
<!-- EQUIPMENT -->
|
|
<td width="100" valign="top">
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder}}">
|
|
<td colspan="2" class="white"><b>Equipment</b></td>
|
|
</tr>
|
|
<tr bgcolor="{{ getStyle(1) }}">
|
|
<td>
|
|
<table width="100" align="center" cellspacing="0" cellpadding="0" style="background: #808080; border:1px solid #808080;">
|
|
<tr>
|
|
<td>
|
|
<table cellspacing="0" style="background: #292929;">
|
|
<tr><td style="border:1px solid #808080;">{{ equipment[2]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[6]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[9]|raw }}</td></tr>
|
|
<tr height="11px"><td>{% if skull is not null %}<img src="images/{{ skull }}.gif">{% endif %}</td></tr>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table cellspacing="0" style="background: #292929;">
|
|
<tr><td style="border:1px solid #808080;">{{ equipment[1]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[4]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[7]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[8]|raw }}</td></tr>
|
|
</table>
|
|
</td>
|
|
<td>
|
|
<table cellspacing="0" style="background: #292929;">
|
|
<tr><td style="border:1px solid #808080;">{{ equipment[3]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[5]|raw }}</td></tr><tr><td style="border:1px solid #808080;">{{ equipment[10]|raw }}</td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<!-- EQUIPMENT_END -->
|
|
{% endif %}
|
|
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_EQUIPMENT')) }}
|
|
</tr>
|
|
</table>
|
|
|
|
{{ hook(constant('HOOK_CHARACTERS_BEFORE_DEATHS')) }}
|
|
|
|
{% if deaths|length > 0 %}
|
|
<!-- DEATHS -->
|
|
<br/>
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><b>Character Deaths</b></td>
|
|
</tr>
|
|
{% set i = 0 %}
|
|
{% for death in deaths %}
|
|
<tr bgcolor="{{ getStyle(i) }}">
|
|
<td width="20%" align="center">{{ death.time|date("j M Y, H:i") }}</td>
|
|
<td>{{ death.description|raw }}</td>
|
|
</tr>
|
|
|
|
{% set i = i + 1 %}
|
|
{% endfor %}
|
|
</table>
|
|
<!-- DEATHS_END -->
|
|
{% endif %}
|
|
{% if frags|length > 0 %}
|
|
<!-- FRAGS -->
|
|
<br/>
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><b>Victims</b></td>
|
|
</tr>
|
|
{% set i = 0 %}
|
|
{% for frag in frags %}
|
|
<tr bgcolor="{{ getStyle(i) }}">
|
|
<td width="20%" align="center">{{ frag.time|date("j M Y, H:i") }}</td>
|
|
<td>{{ frag.description|raw }}({% if frag.unjustified %}<span style="color: red; font-size: 10px">Unjustified</span>{% else %}<span style="color: green; font-size: 10px">Justified</span>{% endif %})</td>
|
|
</tr>
|
|
{% set i = i + 1 %}
|
|
{% endfor %}
|
|
</table>
|
|
<!-- FRAGS_END -->
|
|
{% endif %}
|
|
|
|
{{ hook(constant('HOOK_CHARACTERS_BEFORE_SIGNATURE')) }}
|
|
|
|
{% if setting('core.signature_enabled') %}
|
|
<!-- SIGNATURE -->
|
|
<script type="text/javascript">
|
|
function showSignLinks()
|
|
{
|
|
if(document.getElementById('signLinks').style.display == "none")
|
|
{
|
|
document.getElementById('signLinks').style.display = "inline";
|
|
document.getElementById('signText').innerHTML = "Hide links";
|
|
}
|
|
else
|
|
{
|
|
document.getElementById('signLinks').style.display = "none";
|
|
document.getElementById('signText').innerHTML = "Show links";
|
|
}
|
|
}
|
|
</script>
|
|
<br/>
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="{{ config.vdarkborder }}"><td colspan=2 class="white"><b>Signature</b></td></tr>
|
|
<tr bgcolor="{{ config.lightborder }}"><td align="center" valign="top">
|
|
<img src="{{ signature_url }}" alt="Signature for player {{ player.getName() }}">
|
|
<br/>
|
|
<b><a href="#" onclick="showSignLinks(); return false;" id="signText">Show links</a></b>
|
|
<br/>
|
|
<table id="signLinks" style="display: none;">
|
|
<tr>
|
|
<td>Website:</td>
|
|
<td><input type="text" value="<a href="{{ player_link }}"><img src="{{ signature_url }}"></a>" style="width: 400px;" onclick="this.select()"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Forum:</td>
|
|
<td><input type="text" value="[URL={{ player_link }}][IMG]{{ signature_url }}[/IMG][/URL]" style="width: 400px;" onclick="this.select()"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Direct link:</td>
|
|
<td><input type="text" value="{{ signature_url }}" style="width: 400px;" onclick="this.select()"></td>
|
|
</tr>
|
|
</table>
|
|
</td></tr>
|
|
</table>
|
|
<!-- SIGNATURE_END -->
|
|
{% endif %}
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_SIGNATURE')) }}
|
|
{% if not hidden %}
|
|
{% set rows = 0 %}
|
|
<!-- ACCOUNT_INFORMATION -->
|
|
<br/><br/>
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan="2" class="white"><b>Account Information</b></td>
|
|
</tr>
|
|
|
|
{% set realName = account.getRLName() %}
|
|
{% if realName is not empty %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="20%">Real name:</td>
|
|
<td>{{ realName }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set group = player.getGroup() %}
|
|
{% if group.isLoaded() and group.getId() != 1 %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td>Position:</td>
|
|
<td>{{ group.getName()|capitalize }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set realLocation = account.getLocation() %}
|
|
{% if realLocation is not empty %}
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="20%">Location:</td>
|
|
<td>{{ realLocation }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% set rows = rows + 1 %}
|
|
<tr bgcolor="{{ getStyle(rows) }}">
|
|
<td width="20%">Created:</td>
|
|
<td>{{ account.getCreated()|date("j F Y, g:i a") }}
|
|
{% if bannedUntil matches '/^\\d+$/' or bannedUntil == '-1' %}
|
|
<span style="color: red">[Banished {% if bannedUntil == '-1' %}forever{% else %}until {{ bannedUntil|date('d F Y, h:s') }}{% endif %}]</span>
|
|
{% else %}
|
|
{{ bannedUntil|raw }}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<!-- ACCOUNT_INFORMATION_END -->
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_ACCOUNT')) }}
|
|
<!-- CHARACTERS_LIST -->
|
|
<br/><br/>
|
|
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
|
<tr bgcolor="{{ config.vdarkborder }}">
|
|
<td colspan=4 class="white"><b>Characters</b></td>
|
|
</tr>
|
|
<tr bgcolor="{{ config.darkborder }}">
|
|
<td width="62%"><B>Name</b></td>
|
|
<td width="30%"><B>Level</b></td>
|
|
<td width="8%"><b>Status</b></td>
|
|
<td><b> </b></td>
|
|
</tr>
|
|
{% set i = 0 %}
|
|
{% for player in account_players %}
|
|
{% if not player.isHidden() and (config('characters')['deleted'] or not player.isDeleted()) %}
|
|
{% set i = i + 1 %}
|
|
<tr bgcolor="{{ getStyle(i) }}">
|
|
<td>
|
|
<nobr>{{ i }}. {{ player.getName() }}{% if player.isDeleted() %}<span style="color: red"> [DELETED]</span>{% endif %}</nobr>
|
|
</td>
|
|
|
|
<td>{{ player.getLevel() }} {{ player.getVocationName() }}</td>
|
|
<td>{% if player.isOnline() %}<b><span style="color: green">Online</span></b>{% endif %}</td>
|
|
<td>
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
|
<form action="{{ getLink('characters') }}" method=post>
|
|
<tr>
|
|
<td>
|
|
<input type="hidden" name="name" value="{{ player.getName() }}"/>
|
|
{% set button_name = "View" %}
|
|
{{ include('buttons.base.html.twig') }}
|
|
</td>
|
|
</tr>
|
|
</form>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</table>
|
|
<!-- CHARACTERS_LIST_END -->
|
|
{% endif %}
|
|
{{ hook(constant('HOOK_CHARACTERS_AFTER_CHARACTERS')) }}
|
|
{% if canEdit %}
|
|
<a href="{{ constant('ADMIN_URL') }}?p=players&id={{ player.getId() }}" title="Edit in Admin Panel" target="_blank">
|
|
<img src="images/edit.png"/>Edit
|
|
</a>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<img src="{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br/><br/>{{ search_form|raw }}
|