Move signature config to settings

This commit is contained in:
slawkens
2023-07-20 20:52:08 +02:00
parent 978090c8ae
commit ed7daf9482
6 changed files with 54 additions and 20 deletions

View File

@@ -37,6 +37,10 @@ $deprecatedConfig = [
'team_display_lastlogin' => 'team_lastlogin',
'multiworld',
'forum',
'signature_enabled',
'signature_type',
'signature_cache_time',
'signature_browser_cache',
];
foreach ($deprecatedConfig as $key => $value) {

View File

@@ -340,8 +340,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
}
// signature
$settings = Settings::getInstance();
if($config['signature_enabled']) {
if(setting('core.signature_enabled')) {
$signature_url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . urlencode($player->getName()) . '.png';
}

View File

@@ -804,6 +804,46 @@ Sent by MyAAC,<br/>
'type' => 'category',
'title' => 'Images',
],
[
'type' => 'section',
'title' => 'Signatures'
],
'signature_enabled' => [
'name' => 'Enable Signatures',
'type' => 'boolean',
'desc' => 'Signature is a small picture with character info and server to paste on forums etc. It can be viewed on characters page, when enabled.',
'default' => true,
],
'signature_type' => [
'name' => 'Signature Type',
'type' => 'options',
'options' => ['tibian' => 'tibian', 'mango' => 'mango', 'gesior' => 'gesior'],
'desc' => 'Signature engine to use',
'default' => 'tibian',
'show_if' => [
'signature_enabled', '=', 'true'
],
],
'signature_cache_time' => [
'name' => 'Signature Cache Time',
'type' => 'number',
'min' => 1,
'desc' => 'How long to store cached file (in minutes)',
'default' => 5,
'show_if' => [
'signature_enabled', '=', 'true',
],
],
'signature_browser_cache' => [
'name' => 'Signature Browser Cache Time',
'type' => 'number',
'min' => 1,
'desc' => 'How long to cache by browser (in minutes)',
'default' => 60,
'show_if' => [
'signature_enabled', '=', 'true',
],
],
[
'type' => 'section',
'title' => 'Item Images'

View File

@@ -284,7 +284,7 @@
{{ hook(constant('HOOK_CHARACTERS_BEFORE_SIGNATURE')) }}
{% if config.signature_enabled %}
{% if setting('core.signature_enabled') %}
<!-- SIGNATURE -->
<script type="text/javascript">
function showSignLinks()