mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-05 13:49:21 +02:00
Move signature config to settings
This commit is contained in:
parent
978090c8ae
commit
ed7daf9482
11
config.php
11
config.php
@ -47,13 +47,6 @@ $config = array(
|
||||
'database_socket' => '', // set if you want to connect to database through socket (example: /var/run/mysqld/mysqld.sock)
|
||||
'database_persistent' => false, // use database permanent connection (like server), may speed up your site
|
||||
|
||||
// multiworld system (only TFS 0.3)
|
||||
'multiworld' => false, // use multiworld system?
|
||||
'worlds' => array( // list of worlds
|
||||
//'1' => 'Your World Name',
|
||||
//'2' => 'Your Second World Name'
|
||||
),
|
||||
|
||||
'account_mail_block_plus_sign' => true, // block email with '+' signs like test+box@gmail.com (help protect against spamming accounts)
|
||||
'account_change_character_name' => false, // can user change their character name for premium points?
|
||||
'account_change_character_name_points' => 30, // cost of name change
|
||||
@ -119,10 +112,6 @@ $config = array(
|
||||
//'Some Quest' => 123,
|
||||
//'Some Quest Two' => 456,
|
||||
), // quests list (displayed in character view), name => storage
|
||||
'signature_enabled' => true,
|
||||
'signature_type' => 'tibian', // signature engine to use: tibian, mango, gesior
|
||||
'signature_cache_time' => 5, // how long to store cached file (in minutes), default 5 minutes
|
||||
'signature_browser_cache' => 60, // how long to cache by browser (in minutes), default 1 hour
|
||||
|
||||
// news page
|
||||
'news_limit' => 5, // limit of news on the latest news page
|
||||
|
@ -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) {
|
||||
|
@ -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';
|
||||
}
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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()
|
||||
|
@ -21,12 +21,14 @@
|
||||
define('SIGNATURES_IMAGES', SIGNATURES . 'images/');
|
||||
define('SIGNATURES_ITEMS', BASE . 'images/items/');
|
||||
|
||||
if(!$config['signature_enabled'])
|
||||
if(!setting('core.signature_enabled')) {
|
||||
die('Signatures are disabled on this server.');
|
||||
}
|
||||
|
||||
$file = trim(strtolower($config['signature_type'])) . '.php';
|
||||
if(!file_exists($file))
|
||||
die('ERROR: Wrong signature_type in config.');
|
||||
$file = trim(strtolower(setting('core.signature_type'))) . '.php';
|
||||
if(!file_exists($file)) {
|
||||
die('ERROR: Wrong signature_type in Settings.');
|
||||
}
|
||||
|
||||
putenv('GDFONTPATH=' . SIGNATURES_FONTS);
|
||||
|
||||
@ -52,7 +54,7 @@
|
||||
}
|
||||
|
||||
$cached = SIGNATURES_CACHE.$player->getId() . '.png';
|
||||
if(file_exists($cached) && (time() < (filemtime($cached) + (60 * $config['signature_cache_time']))))
|
||||
if(file_exists($cached) && (time() < (filemtime($cached) + (60 * setting('core.signature_cache_time')))))
|
||||
{
|
||||
header( 'Content-type: image/png' );
|
||||
readfile( SIGNATURES_CACHE.$player->getId().'.png' );
|
||||
@ -61,7 +63,7 @@
|
||||
|
||||
require $file;
|
||||
header('Content-type: image/png');
|
||||
$seconds_to_cache = $config['signature_browser_cache'] * 60;
|
||||
$seconds_to_cache = setting('core.signature_browser_cache') * 60;
|
||||
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
|
||||
header('Expires: ' . $ts);
|
||||
header('Pragma: cache');
|
||||
|
Loading…
x
Reference in New Issue
Block a user