Add compat Gesior classes

To allow more custom pages be used with myaac
This commit is contained in:
slawkens
2022-09-12 14:16:36 +02:00
parent ddb60fa1e0
commit 0a2cd69a4b
5 changed files with 20 additions and 3 deletions

75
system/compat/base.php Normal file
View File

@@ -0,0 +1,75 @@
<?php
/**
* Deprecated functions (compat)
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2019 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
function check_name($name, &$errors = '') {
if(Validator::characterName($name))
return true;
$errors = Validator::getLastError();
return false;
}
function check_account_id($id, &$errors = '') {
if(Validator::accountId($id))
return true;
$errors = Validator::getLastError();
return false;
}
function check_account_name($name, &$errors = '') {
if(Validator::accountName($name))
return true;
$errors = Validator::getLastError();
return false;
}
function check_name_new_char($name, &$errors = '') {
if(Validator::newCharacterName($name))
return true;
$errors = Validator::getLastError();
return false;
}
function check_rank_name($name, &$errors = '') {
if(Validator::rankName($name))
return true;
$errors = Validator::getLastError();
return false;
}
function check_guild_name($name, &$errors = '') {
if(Validator::guildName($name))
return true;
$errors = Validator::getLastError();
return false;
}
function news_place() {
return tickers();
}
function tableExist($table)
{
global $db;
return $db->hasTable($table);
}
function fieldExist($field, $table)
{
global $db;
return $db->hasColumn($table, $field);
}
?>

15
system/compat/classes.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
/**
* Compat classes (backward support for Gesior AAC)
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2022 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
class Player extends OTS_Player {}
class Guild extends OTS_Guild {}
class GuildRank extends OTS_GuildRank {}
class House extends OTS_House {}

40
system/compat/pages.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
/**
* Compat pages (backward support for Gesior AAC)
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2019 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
switch($page)
{
case 'whoisonline':
$page = 'online';
break;
case 'latestnews':
$page = 'news';
break;
case 'tibiarules':
$page = 'rules';
break;
case 'killstatistics':
$page = 'lastkills';
break;
case 'buypoints':
$page = 'points';
break;
case 'shopsystem':
$page = 'gifts';
break;
default:
break;
}
?>