mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 12:33:35 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f35a24b35b | ||
![]() |
82b60f78da | ||
![]() |
6e7a82b425 | ||
![]() |
08fce2ade4 | ||
![]() |
94b44a8d37 | ||
![]() |
769c2942a4 | ||
![]() |
d3395e2eaf | ||
![]() |
705831c8b3 | ||
![]() |
e808904f76 |
@@ -11,6 +11,10 @@ RewriteRule ^images/items/([0-9]+)\.gif$ tools/item.php?id=$1
|
||||
RewriteRule ^characters/([A-Za-z0-9-_+']+)$ index.php?subtopic=characters&name=$1
|
||||
RewriteRule ^guilds/([A-Za-z0-9-_+']+)$ index.php?subtopic=guilds&action=show&guild=$1
|
||||
RewriteRule ^forum/board/([0-9]+)$ index.php?subtopic=forum&action=show_board&id=$1
|
||||
RewriteRule ^forum/board/([0-9]+)/([0-9]+)$ index.php?subtopic=forum&action=show_board&id=$1&page=$2
|
||||
RewriteRule ^forum/thread/([0-9]+)$ index.php?subtopic=forum&action=show_thread&id=$1
|
||||
RewriteRule ^forum/thread/([0-9]+)/([0-9]+)$ index.php?subtopic=forum&action=show_thread&id=$1&page=$2
|
||||
RewriteRule ^forum/board/([0-9]+)/([0-9]+)$ index.php?subtopic=forum&action=show_thread&id=$1&page=$2
|
||||
RewriteRule ^account/manage$ index.php?subtopic=accountmanagement
|
||||
RewriteRule ^account/create$ index.php?subtopic=createaccount
|
||||
RewriteRule ^account/lost$ index.php?subtopic=lostaccount
|
||||
|
@@ -7,6 +7,9 @@ Official website: http://my-aac.org
|
||||
|
||||
- PHP 5.1.0 or later
|
||||
- MySQL database
|
||||
- PDO PHP Extension
|
||||
- XML PHP Extension
|
||||
- ZIP PHP Extension
|
||||
- (optional) mod_rewrite to use friendly_urls
|
||||
|
||||
### INSTALLATION AND CONFIGURATION
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="version">Version: <?php echo MYAAC_VERSION; ?> (<a id="update" href="?p=version">Check for updates</a>)<br/>
|
||||
Logged in as: <b><?php echo $account_logged->getName(); ?></b><br/>
|
||||
Logged in as: <b><?php echo (USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()); ?></b><br/>
|
||||
<a href="<?php echo BASE_URL; ?>" target="_blank">Preview</a> <span class="separator">|</span> <a href="?action=logout">Log out<img src="<?php echo BASE_URL; ?>images/icons/logout.png" alt="" title="Log out" /></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@@ -21,13 +21,13 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
session_start();
|
||||
|
||||
define('MYAAC', true);
|
||||
define('MYAAC_VERSION', '0.0.1');
|
||||
define('MYAAC_VERSION', '0.0.3');
|
||||
define('TABLE_PREFIX', 'myaac_');
|
||||
define('START_TIME', microtime(true));
|
||||
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : 'LINUX');
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ $config = array(
|
||||
'site_closed_title' => 'Closed',
|
||||
'site_closed_message' => 'Server is under maintance, please visit later.<br/><br/>',
|
||||
|
||||
'debug_level' => 0, // 0 - disabled, 1 - show load time, 2 - show db query counter, 3 - both
|
||||
'debug_level' => 0, // 0 - disabled, 1 - show load time, 2 - show db query counter, 3 - both, 4 - memory usage, 5 - load time & load time, 6 - queries & memory usage, 7 - all
|
||||
|
||||
'language' => 'en', // default language (currently only 'en' available)
|
||||
'language_allow_change' => false,
|
||||
|
36
install/includes/config.php
Normal file
36
install/includes/config.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$config['server_path'] = $_SESSION['var_server_path'];
|
||||
// take care of trailing slash at the end
|
||||
if($config['server_path'][strlen($config['server_path']) - 1] != '/')
|
||||
$config['server_path'] .= '/';
|
||||
|
||||
if(!file_exists($config['server_path'] . 'config.lua')) {
|
||||
error($locale['step_database_error_config']);
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(!isset($error) || !$error) {
|
||||
$config['lua'] = load_config_lua($config['server_path'] . 'config.lua');
|
||||
if(isset($config['lua']['sqlType'])) // tfs 0.3
|
||||
$config['database_type'] = $config['lua']['sqlType'];
|
||||
else if(isset($config['lua']['mysqlHost'])) // tfs 0.2/1.0
|
||||
$config['database_type'] = 'mysql';
|
||||
else if(isset($config['lua']['database_type'])) // otserv
|
||||
$config['database_type'] = $config['lua']['database_type'];
|
||||
else if(isset($config['lua']['sql_type'])) // otserv
|
||||
$config['database_type'] = $config['lua']['sql_type'];
|
||||
|
||||
$config['database_type'] = strtolower($config['database_type']);
|
||||
if(empty($config['database_type'])) {
|
||||
error($locale['step_database_error_database_empty']);
|
||||
$error = true;
|
||||
}
|
||||
else if($config['database_type'] != 'mysql') {
|
||||
$locale['step_database_error_only_mysql'] = str_replace('$DATABASE_TYPE$', '<b>' . $config['database_type'] . '</b>', $locale['step_database_error_only_mysql']);
|
||||
error($locale['step_database_error_only_mysql']);
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,5 +1,12 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
require(SYSTEM . 'libs/pot/OTS.php');
|
||||
$ots = POT::getInstance();
|
||||
require(SYSTEM . 'database.php');
|
||||
|
||||
if(tableExist('accounts'))
|
||||
define('USE_ACCOUNT_NAME', fieldExist('name', 'accounts'));
|
||||
else
|
||||
define('USE_ACCOUNT_NAME', false);
|
||||
?>
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
function query($query)
|
||||
{
|
||||
global $db, $error;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
if(isset($_POST['lang']))
|
||||
{
|
||||
setcookie('locale', $_POST['lang']);
|
||||
|
@@ -16,7 +16,7 @@ if(isset($_POST['vars']))
|
||||
$_SESSION['var_' . $key] = $value;
|
||||
}
|
||||
|
||||
$steps = array(1 => 'welcome', 2 => 'license', 3 => 'requirements', 4 => 'config', 5 => 'database', 6 => 'finish');
|
||||
$steps = array(1 => 'welcome', 2 => 'license', 3 => 'requirements', 4 => 'config', 5 => 'database', 6 => 'admin', 7 => 'finish');
|
||||
if(!in_array($step, $steps)) // check if step is valid
|
||||
die('ERROR: Unknown step.');
|
||||
|
||||
@@ -33,6 +33,8 @@ if($step == 'database')
|
||||
}
|
||||
}
|
||||
|
||||
$error = false;
|
||||
|
||||
// step include
|
||||
ob_start();
|
||||
require('steps/' . $step . '.php');
|
||||
|
32
install/steps/admin.php
Normal file
32
install/steps/admin.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
?>
|
||||
<form action="<?php echo BASE_URL; ?>install/" method="post" autocomplete="off">
|
||||
<input type="hidden" name="step" id="step" value="finish" />
|
||||
<table>
|
||||
<?php
|
||||
require(BASE . 'install/includes/config.php');
|
||||
if(!$error) {
|
||||
require(BASE . 'install/includes/database.php');
|
||||
|
||||
foreach(array(USE_ACCOUNT_NAME ? 'account' : 'account_id', 'password') as $value)
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
<label for="vars_' . $value . '">
|
||||
<span>' . $locale['step_admin_' . $value] . '</span>
|
||||
</label>
|
||||
<br>
|
||||
<input type="text" name="vars[' . $value . ']" id="vars_' . $value . '"' . (isset($_SESSION['var_' . $value]) ? ' value="' . $_SESSION['var_' . $value] . '"' : '') . '/>
|
||||
</td>
|
||||
<td>
|
||||
<em>' . $locale['step_admin_' . $value . '_desc'] . '</em>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php echo next_buttons(true, $error ? false : true);
|
||||
?>
|
||||
</form>
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$clients = array(
|
||||
710,
|
||||
740,
|
||||
@@ -68,7 +70,7 @@ $clients = array(
|
||||
<input type="hidden" name="step" id="step" value="database" />
|
||||
<table>
|
||||
<?php
|
||||
foreach(array('server_path', 'account', 'password', 'mail_admin', 'mail_address') as $value)
|
||||
foreach(array('server_path', 'mail_admin', 'mail_address') as $value)
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
//ini_set('display_errors', false);
|
||||
ini_set('max_execution_time', 300);
|
||||
$error = false;
|
||||
|
||||
if(!isset($_SESSION['var_server_path'])) {
|
||||
@@ -20,41 +22,16 @@ if(!$error) {
|
||||
$value .= "/";
|
||||
}
|
||||
|
||||
if($key != 'var_account' && $key != 'var_password') {
|
||||
if($key != 'var_account' && $key != 'var_account_id' && $key != 'var_password') {
|
||||
$content .= '$config[\'' . str_replace('var_', '', $key) . '\'] = \'' . $value . '\';';
|
||||
$content .= PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$config['server_path'] = $_SESSION['var_server_path'];
|
||||
// take care of trailing slash at the end
|
||||
if($config['server_path'][strlen($config['server_path']) - 1] != '/')
|
||||
$config['server_path'] .= '/';
|
||||
|
||||
if(!file_exists($config['server_path'] . 'config.lua')) {
|
||||
error($locale['step_database_error_config']);
|
||||
$error = true;
|
||||
}
|
||||
require(BASE . 'install/includes/config.php');
|
||||
|
||||
if(!$error) {
|
||||
$config['lua'] = load_config_lua($config['server_path'] . 'config.lua');
|
||||
if(isset($config['lua']['sqlType'])) // tfs 0.3
|
||||
$config['database_type'] = $config['lua']['sqlType'];
|
||||
else if(isset($config['lua']['mysqlHost'])) // tfs 0.2/1.0
|
||||
$config['database_type'] = 'mysql';
|
||||
else if(isset($config['lua']['database_type'])) // otserv
|
||||
$config['database_type'] = $config['lua']['database_type'];
|
||||
else if(isset($config['lua']['sql_type'])) // otserv
|
||||
$config['database_type'] = $config['lua']['sql_type'];
|
||||
|
||||
$config['database_type'] = strtolower($config['database_type']);
|
||||
if($config['database_type'] != 'mysql') {
|
||||
$locale['step_database_error_only_mysql'] = str_replace('$DATABASE_TYPE$', '<b>' . $config['database_type'] . '</b>', $locale['step_database_error_only_mysql']);
|
||||
error($locale['step_database_error_only_mysql']);
|
||||
$error = true;
|
||||
}
|
||||
else {
|
||||
success($locale['step_database_importing']);
|
||||
require(BASE . 'install/includes/database.php');
|
||||
|
||||
@@ -63,6 +40,16 @@ if(!$error) {
|
||||
error($locale['step_database_error_table']);
|
||||
$error = true;
|
||||
}
|
||||
else if(!tableExist('players')) {
|
||||
$locale['step_database_error_table'] = str_replace('$TABLE$', 'players', $locale['step_database_error_table']);
|
||||
error($locale['step_database_error_table']);
|
||||
$error = true;
|
||||
}
|
||||
else if(!tableExist('guilds')) {
|
||||
$locale['step_database_error_table'] = str_replace('$TABLE$', 'guilds', $locale['step_database_error_table']);
|
||||
error($locale['step_database_error_table']);
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(tableExist(TABLE_PREFIX . 'account_actions')) {
|
||||
$locale['step_database_error_table_exist'] = str_replace('$TABLE$', TABLE_PREFIX . 'account_actions', $locale['step_database_error_table_exist']);
|
||||
@@ -84,6 +71,7 @@ if(!$error) {
|
||||
}
|
||||
}
|
||||
|
||||
if(!$error) {
|
||||
if(fieldExist('key', 'accounts')) {
|
||||
if(query("ALTER TABLE `accounts` MODIFY `key` VARCHAR(64) NOT NULL DEFAULT '';"))
|
||||
success($locale['step_database_modifying_field'] . ' accounts.key...');
|
||||
@@ -127,12 +115,12 @@ if(!$error) {
|
||||
}
|
||||
else if(!fieldExist('web_lastlogin', 'accounts')) {
|
||||
if(query("ALTER TABLE `accounts` ADD `web_lastlogin` INT(11) NOT NULL DEFAULT 0 AFTER `country`;"))
|
||||
success($locale['step_database_adding_field'] . ' accounts.created...');
|
||||
success($locale['step_database_adding_field'] . ' accounts.web_lastlogin...');
|
||||
}
|
||||
|
||||
if(!fieldExist('web_flags', 'accounts')) {
|
||||
if(query("ALTER TABLE `accounts` ADD `web_flags` INT(11) NOT NULL DEFAULT 0 AFTER `web_lastlogin`;"))
|
||||
success($locale['step_database_adding_field'] . ' accounts.country...');
|
||||
success($locale['step_database_adding_field'] . ' accounts.web_flags...');
|
||||
}
|
||||
|
||||
if(!fieldExist('email_hash', 'accounts')) {
|
||||
@@ -199,6 +187,11 @@ if(!$error) {
|
||||
success($locale['step_database_adding_field'] . ' players.created...');
|
||||
}
|
||||
|
||||
if(!fieldExist('deleted', 'players') && !fieldExist('deletion', 'players')) {
|
||||
if(query("ALTER TABLE `players` ADD `deleted` TINYINT(1) NOT NULL DEFAULT 0;"))
|
||||
success($locale['step_database_adding_field'] . ' players.comment...');
|
||||
}
|
||||
|
||||
if(fieldExist('hide_char', 'players')) {
|
||||
if(query("ALTER TABLE `players` CHANGE `hide_char` `hidden` TINYINT(1) NOT NULL DEFAULT 0;")) {
|
||||
$tmp = str_replace('$FIELD$', 'players.hide_char', $locale['step_database_changing_field']);
|
||||
@@ -207,7 +200,7 @@ if(!$error) {
|
||||
}
|
||||
}
|
||||
else if(!fieldExist('hidden', 'players')) {
|
||||
if(query("ALTER TABLE `players` ADD `hidden` VARCHAR( 255 ) TINYINT(1) NOT NULL DEFAULT 0;"))
|
||||
if(query("ALTER TABLE `players` ADD `hidden` TINYINT(1) NOT NULL DEFAULT 0;"))
|
||||
success($locale['step_database_adding_field'] . ' players.hidden...');
|
||||
}
|
||||
|
||||
@@ -215,84 +208,9 @@ if(!$error) {
|
||||
if(query("ALTER TABLE `players` ADD `comment` TEXT NOT NULL DEFAULT '';"))
|
||||
success($locale['step_database_adding_field'] . ' players.comment...');
|
||||
}
|
||||
|
||||
$account = $_SESSION['var_account'];
|
||||
$password = $_SESSION['var_password'];
|
||||
|
||||
$config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
if($config_salt_enabled)
|
||||
{
|
||||
$salt = generateRandomString(10, false, true, true);
|
||||
$password = $salt . $password;
|
||||
}
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
$account_db->load(1);
|
||||
if($account_db->isLoaded()) {
|
||||
$account_db->setName('dummy_account');
|
||||
$account_db->setPassword('for sample characters. ' . generateRandomString(10));
|
||||
$account_db->save();
|
||||
}
|
||||
else {
|
||||
$new_account = $ots->createObject('Account');
|
||||
$new_account->create('dummy_account', 1);
|
||||
$account_db->setPassword('for sample characters. ' . generateRandomString(10));
|
||||
}
|
||||
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
$account_db->find($account);
|
||||
if($account_db->isLoaded()) {
|
||||
if($config_salt_enabled)
|
||||
$account_db->setSalt($salt);
|
||||
|
||||
$account_db->setPassword(encrypt($password));
|
||||
$account_db->setEMail($_SESSION['var_mail_admin']);
|
||||
$account_db->save();
|
||||
$account_db->setCustomField('web_flags', 3);
|
||||
$account_db->setCustomField('country', 'us');
|
||||
|
||||
$_SESSION['account'] = $account_db->getId();
|
||||
}
|
||||
else {
|
||||
$new_account = $ots->createObject('Account');
|
||||
$new_account->create($account);
|
||||
|
||||
if($config_salt_enabled)
|
||||
$new_account->setSalt($salt);
|
||||
|
||||
$new_account->setPassword(encrypt($password));
|
||||
$new_account->setEMail($_SESSION['var_mail_admin']);
|
||||
$new_account->unblock();
|
||||
$new_account->save();
|
||||
$new_account->setCustomField('created', time());
|
||||
$new_account->setCustomField('web_flags', 3);
|
||||
$new_account->setCustomField('country', 'us');
|
||||
$new_account->logAction('Account created.');
|
||||
|
||||
$_SESSION['account'] = $new_account->getId();
|
||||
}
|
||||
|
||||
success($locale['step_database_created_account']);
|
||||
$_SESSION['password'] = encrypt($password);
|
||||
$_SESSION['remember_me'] = true;
|
||||
|
||||
$deleted = 'deleted';
|
||||
if(fieldExist('deletion', 'players'))
|
||||
$deleted = 'deletion';
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Rook Sample') . ' OR `name` = ' . $db->quote('Sorcerer Sample') . ' OR `name` = ' . $db->quote('Druid Sample') . ' OR `name` = ' . $db->quote('Paladin Sample') . ' OR `name` = ' . $db->quote('Knight Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(query("INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `lastlogout`, `blessings`, `balance`, `stamina`, `$deleted`, `created`, `hidden`, `comment`) VALUES
|
||||
(null, 'Rook Sample', 1, 1, 8, 0, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179613, 2453925456, 1, 0, 0, 1255179614, 0, 0, 151200000, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Sorcerer Sample', 1, 1, 8, 1, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179571, 2453925456, 1, 0, 0, 1255179612, 0, 0, 151200000, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Druid Sample', 1, 1, 8, 2, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179655, 2453925456, 1, 0, 0, 1255179658, 0, 0, 151200000, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Paladin Sample', 1, 1, 8, 3, 185, 185, 4200, 118, 114, 38, 57, 129, 0, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179854, 2453925456, 1, 0, 0, 1255179858, 0, 0, 151200000, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Knight Sample', 1, 1, 8, 4, 185, 185, 4200, 118, 114, 38, 57, 131, 0, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179620, 2453925456, 1, 0, 0, 1255179654, 0, 0, 151200000, 1, UNIX_TIMESTAMP(), 1, '');"))
|
||||
success($locale['step_database_imported_players']);
|
||||
}
|
||||
|
||||
if(!$error && !isset($_SESSION['saved'])) {
|
||||
if(!$error && (!isset($_SESSION['saved']))) {
|
||||
$content .= '$config[\'installed\'] = true;';
|
||||
$content .= PHP_EOL;
|
||||
if(strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) {
|
||||
@@ -315,7 +233,8 @@ if(!$error) {
|
||||
$content .= PHP_EOL;
|
||||
$content .= '$config[\'client_download_linux\'] = \'http://clients.halfaway.net/linux.php?tibia=\'. $config[\'client\'];';
|
||||
$content .= PHP_EOL;
|
||||
|
||||
$content .= '// place for your configuration directives, so you can later easily update myaac';
|
||||
$content .= PHP_EOL;
|
||||
$content .= "?>";
|
||||
$file = fopen(BASE . 'config.local.php', 'a+');
|
||||
if($file) {
|
||||
@@ -331,12 +250,11 @@ if(!$error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form action="<?php echo BASE_URL; ?>install/" method="post">
|
||||
<input type="hidden" name="step" id="step" value="finish" />
|
||||
<input type="hidden" name="step" id="step" value="admin" />
|
||||
<?php echo next_buttons(true, $error ? false : true);
|
||||
?>
|
||||
</form>
|
@@ -1,20 +1,152 @@
|
||||
<?php
|
||||
$locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(ADMIN_URL, $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']);
|
||||
$locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(BASE_URL, $locale['step_finish_homepage'], true), $locale['step_finish_desc']);
|
||||
$locale['step_finish_desc'] = str_replace('$LINK$', generateLink('http://my-aac.org', 'http://my-aac.org', true), $locale['step_finish_desc']);
|
||||
?>
|
||||
<p class="success"><?php echo $locale['step_finish_desc']; ?></p>
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
<?php
|
||||
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
||||
echo '<p class="warning">' . $locale['already_installed'] . '</p>';
|
||||
}
|
||||
else {
|
||||
require(SYSTEM . 'init.php');
|
||||
//require(BASE . 'install/includes/config.php');
|
||||
if(!$error) {
|
||||
//require(BASE . 'install/includes/database.php');
|
||||
|
||||
if(!isset($_SESSION['installed'])) {
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$account = isset($_SESSION['var_account']) ? $_SESSION['var_account'] : NULL;
|
||||
else
|
||||
$account_id = isset($_SESSION['var_account_id']) ? $_SESSION['var_account_id'] : NULL;
|
||||
|
||||
$password = $_SESSION['var_password'];
|
||||
|
||||
$config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
if($config_salt_enabled)
|
||||
{
|
||||
$salt = generateRandomString(10, false, true, true);
|
||||
$password = $salt . $password;
|
||||
}
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
$account_db->load(1);
|
||||
if($account_db->isLoaded()) {
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$account_db->setName('dummy_account');
|
||||
|
||||
$account_db->setPassword('for sample characters. ' . generateRandomString(10));
|
||||
$account_db->save();
|
||||
}
|
||||
else {
|
||||
$new_account = new OTS_Account();
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$new_account->create('dummy_account', 1);
|
||||
else
|
||||
$new_account->create(NULL, 1);
|
||||
|
||||
$new_account->setPassword('for sample characters. ' . generateRandomString(10));
|
||||
$new_account->save();
|
||||
}
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
if(isset($account))
|
||||
$account_db->find($account);
|
||||
else
|
||||
$account_db->load($account_id);
|
||||
|
||||
$player_db = $ots->createObject('Player');
|
||||
$player_db->find('Admin');
|
||||
$groups = new OTS_Groups_List();
|
||||
if(!$player_db->isLoaded())
|
||||
{
|
||||
$player = $ots->createObject('Player');
|
||||
$player->setName('Admin');
|
||||
|
||||
$player->setGroupId($groups->getHighestId());
|
||||
}
|
||||
|
||||
if($account_db->isLoaded()) {
|
||||
if($config_salt_enabled)
|
||||
$account_db->setSalt($salt);
|
||||
|
||||
$account_db->setPassword(encrypt($password));
|
||||
$account_db->setEMail($_SESSION['var_mail_admin']);
|
||||
$account_db->save();
|
||||
$account_db->setCustomField('web_flags', 3);
|
||||
$account_db->setCustomField('country', 'us');
|
||||
if(fieldExist('group_id', 'accounts'))
|
||||
$account_db->setCustomField('group_id', $groups->getHighestId());
|
||||
|
||||
if(!$player_db->isLoaded())
|
||||
$player->setAccountId($account_db->getId());
|
||||
else
|
||||
$player_db->setAccountId($account_db->getId());
|
||||
|
||||
$_SESSION['account'] = $account_db->getId();
|
||||
}
|
||||
else {
|
||||
$new_account = $ots->createObject('Account');
|
||||
$new_account->create($account);
|
||||
|
||||
if($config_salt_enabled)
|
||||
$new_account->setSalt($salt);
|
||||
|
||||
$new_account->setPassword(encrypt($password));
|
||||
$new_account->setEMail($_SESSION['var_mail_admin']);
|
||||
$new_account->unblock();
|
||||
$new_account->save();
|
||||
$new_account->setCustomField('created', time());
|
||||
$new_account->setCustomField('web_flags', 3);
|
||||
$new_account->setCustomField('country', 'us');
|
||||
if(fieldExist('group_id', 'accounts'))
|
||||
$new_account->setCustomField('group_id', $groups->getHighestId());
|
||||
$new_account->logAction('Account created.');
|
||||
|
||||
if(!$player_db->isLoaded())
|
||||
$player->setAccountId($new_account->getId());
|
||||
else
|
||||
$player_db->setAccountId($new_account->getId());
|
||||
|
||||
$_SESSION['account'] = $new_account->getId();
|
||||
}
|
||||
|
||||
if($player_db->isLoaded())
|
||||
$player_db->save();
|
||||
else
|
||||
$player->save();
|
||||
|
||||
success($locale['step_database_created_account']);
|
||||
$_SESSION['password'] = encrypt($password);
|
||||
$_SESSION['remember_me'] = true;
|
||||
|
||||
$deleted = 'deleted';
|
||||
if(fieldExist('deletion', 'players'))
|
||||
$deleted = 'deletion';
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Rook Sample') . ' OR `name` = ' . $db->quote('Sorcerer Sample') . ' OR `name` = ' . $db->quote('Druid Sample') . ' OR `name` = ' . $db->quote('Paladin Sample') . ' OR `name` = ' . $db->quote('Knight Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(query("INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `lastlogout`, `balance`, `$deleted`, `created`, `hidden`, `comment`) VALUES
|
||||
(null, 'Rook Sample', 1, 1, 8, 0, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179613, 2453925456, 1, 1255179614, 0, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Sorcerer Sample', 1, 1, 8, 1, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179571, 2453925456, 1, 1255179612, 0, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Druid Sample', 1, 1, 8, 2, 185, 185, 4200, 118, 114, 38, 57, 130, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179655, 2453925456, 1, 1255179658, 0, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Paladin Sample', 1, 1, 8, 3, 185, 185, 4200, 118, 114, 38, 57, 129, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179854, 2453925456, 1, 1255179858, 0, 1, UNIX_TIMESTAMP(), 1, ''),
|
||||
(null, 'Knight Sample', 1, 1, 8, 4, 185, 185, 4200, 118, 114, 38, 57, 131, 0, 35, 35, 0, 100, 11, 2200, 1298, 7, '', 470, 1, 1255179620, 2453925456, 1, 1255179654, 0, 1, UNIX_TIMESTAMP(), 1, '');"))
|
||||
success($locale['step_database_imported_players']);
|
||||
}
|
||||
|
||||
$locale['step_finish_desc'] = str_replace('$ADMIN_PANEL$', generateLink(ADMIN_URL, $locale['step_finish_admin_panel'], true), $locale['step_finish_desc']);
|
||||
$locale['step_finish_desc'] = str_replace('$HOMEPAGE$', generateLink(BASE_URL, $locale['step_finish_homepage'], true), $locale['step_finish_desc']);
|
||||
$locale['step_finish_desc'] = str_replace('$LINK$', generateLink('http://my-aac.org', 'http://my-aac.org', true), $locale['step_finish_desc']);
|
||||
?>
|
||||
<p class="success"><?php echo $locale['step_finish_desc']; ?></p>
|
||||
<?php
|
||||
|
||||
if(!isset($_SESSION['installed'])) {
|
||||
file_get_contents('http://my-aac.org/report_install.php?v=' . MYAAC_VERSION);
|
||||
$_SESSION['installed'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($_SESSION as $key => $value) {
|
||||
foreach($_SESSION as $key => $value) {
|
||||
if(strpos($key, 'var_') !== false)
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
unset($_SESSION['saved']);
|
||||
}
|
||||
}
|
||||
unset($_SESSION['saved']);
|
||||
?>
|
@@ -1,3 +1,6 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
?>
|
||||
<form action="<?php echo BASE_URL; ?>install/" method="post">
|
||||
<input type="hidden" name="step" id="step" value="requirements" />
|
||||
<textarea rows="10" cols="80" readonly="1"><?php echo file_get_contents(BASE . 'LICENSE'); ?></textarea>
|
||||
|
@@ -1,16 +1,18 @@
|
||||
<?php
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
/*
|
||||
*
|
||||
* @param string $name
|
||||
* @param boolean $ok
|
||||
* @param mixed $version
|
||||
* @param mixed $info
|
||||
*/
|
||||
function version_check($name, $ok, $version = '', $warning = false)
|
||||
function version_check($name, $ok, $info = '', $warning = false)
|
||||
{
|
||||
global $failed;
|
||||
echo '<p class="' . ($ok ? 'success' : ($warning ? 'warning' : 'error')) . '">' . $name;
|
||||
if(!empty($version))
|
||||
echo ': <b>' . $version . '</b>';
|
||||
if(!empty($info))
|
||||
echo ': <b>' . $info . '</b>';
|
||||
|
||||
echo '</p>';
|
||||
if(!$ok && !$warning)
|
||||
@@ -33,8 +35,9 @@ version_check('register_long_arrays', !$ini_register_globals, $ini_register_glob
|
||||
$ini_safe_mode = ini_get_bool('safe_mode');
|
||||
version_check('safe_mode', !$ini_safe_mode, $ini_safe_mode ? $locale['on'] : $locale['off'], true);
|
||||
|
||||
version_check('PDO extension loaded', extension_loaded('pdo'), '', false);
|
||||
version_check('zip extension loaded', extension_loaded('zip'), '', false);
|
||||
version_check(str_replace('$EXTENSION$', 'PDO', $locale['step_requirements_extension']) , extension_loaded('pdo'), extension_loaded('pdo') ? $locale['loaded'] : $locale['not_loaded']);
|
||||
version_check(str_replace('$EXTENSION$', 'XML', $locale['step_requirements_extension']), extension_loaded('xml'), extension_loaded('xml') ? $locale['loaded'] : $locale['not_loaded']);
|
||||
version_check(str_replace('$EXTENSION$', 'ZIP', $locale['step_requirements_extension']), extension_loaded('zip'), extension_loaded('zip') ? $locale['loaded'] : $locale['not_loaded']);
|
||||
|
||||
if($failed)
|
||||
{
|
||||
|
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
if(isset($config['installed']) && $config['installed'])
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
||||
echo '<p class="warning">' . $locale['already_installed'] . '</p>';
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
unset($_SESSION['saved']);
|
||||
?>
|
||||
<form action="<?php echo BASE_URL; ?>install/" method="post">
|
||||
<input type="hidden" name="step" id="step" value="license" />
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$config['database_name'] = $config['lua']['sqlDatabase'];
|
||||
|
||||
$config['database_encryption'] = $config['lua']['encryptionType'];
|
||||
if(!isset($encryptionType)/* || empty($encryptionType)*/) // before 0.3.6
|
||||
if(!isset($config['database_encryption']) || empty($config['database_encryption'])) // before 0.3.6
|
||||
$config['database_encryption'] = $config['lua']['passwordType'];
|
||||
}
|
||||
else if(isset($config['lua']['mysqlHost'])) // tfs 0.2/1.0
|
||||
@@ -65,12 +65,16 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
);
|
||||
}
|
||||
catch(PDOException $error) {
|
||||
if(isset($cache) && $cache->enabled()) {
|
||||
$cache->delete('config_lua');
|
||||
}
|
||||
die('ERROR: Cannot connect to MySQL database.<br/>' .
|
||||
'Possible reasons:' .
|
||||
'<ul>' .
|
||||
'<li>MySQL is not configured propertly in <i>config.lua</i>.</li>' .
|
||||
'<li>MySQL server is not running.</li>' .
|
||||
'</ul>');
|
||||
'</ul>' . $error);
|
||||
|
||||
}
|
||||
$db = POT::getInstance()->getDBHandle();
|
||||
?>
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -45,6 +45,32 @@ function getPageLink($page, $action = null)
|
||||
}
|
||||
function internalLayoutLink($page, $action = null) {return getPageLink($page, $action);}
|
||||
|
||||
function getForumThreadLink($thread_id, $page = NULL)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$url = '';
|
||||
if($config['friendly_urls'])
|
||||
$url = BASE_URL . 'forum/thread/' . (int)$thread_id . (isset($page) ? '/' . $page : '');
|
||||
else
|
||||
$url = BASE_URL . '?subtopic=forum&action=show_thread&id=' . (int)$thread_id . (isset($page) ? '&page=' . $page : '');
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function getForumBoardLink($board_id, $page = NULL)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$url = '';
|
||||
if($config['friendly_urls'])
|
||||
$url = BASE_URL . 'forum/board/' . (int)$board_id . (isset($page) ? '/' . $page : '');
|
||||
else
|
||||
$url = BASE_URL . '?subtopic=forum&action=show_board&id=' . (int)$board_id . (isset($page) ? '&page=' . $page : '');
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function getPlayerLink($name, $generate = true)
|
||||
{
|
||||
global $ots, $config;
|
||||
@@ -355,6 +381,8 @@ function delete_guild($id)
|
||||
foreach($rank_list as $rank_in_guild) {
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
|
||||
else if(tableExist('guild_members'))
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_members`.`rank_id` as `rank_id` FROM `players`, `guild_members` WHERE `guild_members`.`rank_id` = ' . $rank_in_guild->getId() . ' AND `players`.`id` = `guild_members`.`player_id` ORDER BY `name`;');
|
||||
else
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_membership`.`rank_id` as `rank_id` FROM `players`, `guild_membership` WHERE `guild_membership`.`rank_id` = ' . $rank_in_guild->getId() . ' AND `players`.`id` = `guild_membership`.`player_id` ORDER BY `name`;');
|
||||
|
||||
@@ -416,6 +444,43 @@ function check_name($name, &$error = '')
|
||||
return preg_match("/[A-z ']{1,25}/", $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate account id
|
||||
* Id lenght must be 6-10 chars
|
||||
*
|
||||
* @param string $name Account name to check
|
||||
* @param string $error Error description will be placed here
|
||||
* @return bool Is account name valid?
|
||||
*/
|
||||
function check_account_id($id, &$error = '')
|
||||
{
|
||||
if(!isset($id[0]))
|
||||
{
|
||||
$error = 'Please enter an account.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!check_number($id)) {
|
||||
$error = 'Invalid account name format. Use only numbers 0-9.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$length = strlen($id);
|
||||
if($length < 6)
|
||||
{
|
||||
$error = 'Account is too short (min. 6 chars).';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($length > 10)
|
||||
{
|
||||
$error = 'Account is too long (max. 10 chars).';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate account name
|
||||
* Name lenght must be 3-32 chars
|
||||
@@ -455,7 +520,7 @@ function check_account_name($name, &$error = '')
|
||||
}
|
||||
|
||||
//is it valid nick for new char?
|
||||
function check_name_new_char($name)
|
||||
function check_name_new_char($name, &$error = '')
|
||||
{
|
||||
global $db, $config;
|
||||
|
||||
@@ -464,92 +529,127 @@ function check_name_new_char($name)
|
||||
$first_words_blocked = array('admin ', 'administrator ', 'gm ', 'cm ', 'god ','tutor ', "'", '-');
|
||||
foreach($first_words_blocked as $word)
|
||||
{
|
||||
if($word == substr($name_lower, 0, strlen($word)))
|
||||
if($word == substr($name_lower, 0, strlen($word))) {
|
||||
$error = 'Your name contains blocked words.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-") {
|
||||
$error = 'Your name contains illegal characters.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-")
|
||||
if(substr($name_lower, 1, 1) == ' ') {
|
||||
$error = 'Your name contains illegal space.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(substr($name_lower, 1, 1) == ' ')
|
||||
if(substr($name_lower, -2, 1) == " ") {
|
||||
$error = 'Your name contains illegal space.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(substr($name_lower, -2, 1) == " ")
|
||||
return false;
|
||||
|
||||
if(strtolower($config['lua']['serverName']) == $name_lower)
|
||||
if(strtolower($config['lua']['serverName']) == $name_lower) {
|
||||
$error = 'Your name cannot be same as server name.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$names_blocked = array('admin', 'administrator', 'gm', 'cm', 'god', 'tutor');
|
||||
foreach($names_blocked as $word)
|
||||
{
|
||||
if($word == $name_lower)
|
||||
if($word == $name_lower) {
|
||||
$error = 'Your name contains blocked words.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$name_length = strlen($name_lower);
|
||||
for($i = 0; $i < $name_length; $i++)
|
||||
{
|
||||
if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ')
|
||||
return false;
|
||||
}
|
||||
|
||||
$words_blocked = array('admin', 'administrator', 'gamemaster', 'game master', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor');
|
||||
foreach($words_blocked as $word)
|
||||
{
|
||||
if(!(strpos($name_lower, $word) === false))
|
||||
if(!(strpos($name_lower, $word) === false)) {
|
||||
$error = 'Your name contains illegal words.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$name_length = strlen($name_lower);
|
||||
for($i = 0; $i < $name_length; $i++)
|
||||
{
|
||||
if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2]) {
|
||||
$error = 'Your name is invalid.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for($i = 0; $i < $name_length; $i++)
|
||||
{
|
||||
if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2])
|
||||
if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ') {
|
||||
$error = 'Your name contains too many spaces.';
|
||||
return false;
|
||||
}
|
||||
|
||||
for($i = 0; $i < $name_length; $i++)
|
||||
{
|
||||
if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ')
|
||||
return false;
|
||||
}
|
||||
|
||||
if(isset($config['monsters']))
|
||||
{
|
||||
if(in_array($name_lower, $config['monsters']))
|
||||
if(in_array($name_lower, $config['monsters'])) {
|
||||
$error = 'Your name cannot contains monster name.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$monsters = $db->query(
|
||||
'SELECT ' . $db->fieldName('name') .
|
||||
' FROM ' . $db->tableName(TABLE_PREFIX . 'monsters') .
|
||||
' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($name_lower));
|
||||
if($monsters->rowCount() > 0)
|
||||
if($monsters->rowCount() > 0) {
|
||||
$error = 'Your name cannot contains monster name.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$spells_name = $db->query(
|
||||
'SELECT ' . $db->fieldName('name') .
|
||||
' FROM ' . $db->tableName(TABLE_PREFIX . 'spells') .
|
||||
' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($name_lower));
|
||||
if($spells_name->rowCount() > 0)
|
||||
if($spells_name->rowCount() > 0) {
|
||||
$error = 'Your name cannot contains spell name.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$spells_words = $db->query(
|
||||
'SELECT ' . $db->fieldName('words') .
|
||||
' FROM ' . $db->tableName(TABLE_PREFIX . 'spells') .
|
||||
' WHERE ' . $db->fieldName('words') . ' = ' . $db->quote($name_lower));
|
||||
if($spells_words->rowCount() > 0)
|
||||
return false;
|
||||
|
||||
if(isset($config['npc']))
|
||||
{
|
||||
if(in_array($name_lower, $config['npc']))
|
||||
if($spells_words->rowCount() > 0) {
|
||||
$error = 'Your name cannot contains spell name.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length)
|
||||
if(isset($config['npc']))
|
||||
{
|
||||
if(in_array($name_lower, $config['npc'])) {
|
||||
$error = 'Your name cannot contains NPC name.';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return preg_match("/[A-z ']{3,28}/", $name);
|
||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) {
|
||||
$error = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($name_length < 3 || $name_length > 28) {
|
||||
$error = 'Your name cannot be shorter than 3 characters and longer than 28 characters.';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!preg_match("/[A-z ']{3,28}/", $name)) {
|
||||
$error = 'Your name containst illegal characters.';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function check_rank_name($name)
|
||||
@@ -778,7 +878,7 @@ function template_form()
|
||||
else
|
||||
{
|
||||
$templates = get_templates();
|
||||
$cache->set('templates', serialize($templates), 120);
|
||||
$cache->set('templates', serialize($templates), 30);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -815,7 +915,7 @@ function getCreatureName($killer, $showStatus = false, $extendedInfo = false)
|
||||
if(!$showStatus)
|
||||
return $str.'<b>'.$player->getName().'</b></a>';
|
||||
|
||||
$str .= '<font color="'.($player->isOnline() ? 'green' : 'red').'">'.$player->getName().'</font></b></a>';
|
||||
$str .= '<font color="'.($player->isOnline() ? 'green' : 'red').'">' . $player->getName() . '</font></b></a>';
|
||||
if($extendedInfo) {
|
||||
$str .= '<br><small>'.$player->getLevel().' '.$config['vocations'][$player->getVocation()].'</small>';
|
||||
}
|
||||
@@ -1106,7 +1206,7 @@ function load_config_lua($filename)
|
||||
// TODO: new parser that will also load dofile() includes
|
||||
|
||||
// strip lua comments to prevent parsing errors
|
||||
fwrite($file, preg_replace('/(-)(-) (.*)/', '', file_get_contents($config_file)));
|
||||
fwrite($file, preg_replace('/(-)(-)(.*)/', '', file_get_contents($config_file)));
|
||||
fclose($file);
|
||||
|
||||
$result = array_merge(parse_ini_file($tempFile, true), isset($config['lua']) ? $config['lua'] : array());
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -72,6 +72,10 @@ unset($tmp);
|
||||
if(isset($config['lua']['servername']))
|
||||
$config['lua']['serverName'] = $config['lua']['servername'];
|
||||
|
||||
|
||||
if(isset($config['lua']['houserentperiod']))
|
||||
$config['lua']['houseRentPeriod'] = $config['lua']['houserentperiod'];
|
||||
|
||||
// localize data/ directory
|
||||
if(isset($config['lua']['dataDirectory'][0]))
|
||||
{
|
||||
@@ -91,6 +95,15 @@ else if(isset($config['lua']['data_directory'][0]))
|
||||
if($tmp[strlen($tmp) - 1] != '/') // do not forget about trailing slash
|
||||
$tmp .= '/';
|
||||
}
|
||||
else if(isset($config['lua']['datadir'][0]))
|
||||
{
|
||||
$tmp = $config['lua']['datadir'];
|
||||
if($tmp[0] != '/')
|
||||
$tmp = $config['server_path'] . $tmp;
|
||||
|
||||
if($tmp[strlen($tmp) - 1] != '/') // do not forget about trailing slash
|
||||
$tmp .= '/';
|
||||
}
|
||||
else
|
||||
$tmp = $config['server_path'] . 'data/';
|
||||
|
||||
@@ -102,6 +115,7 @@ require_once(SYSTEM . 'libs/pot/OTS.php');
|
||||
$ots = POT::getInstance();
|
||||
require_once(SYSTEM . 'database.php');
|
||||
|
||||
define('USE_ACCOUNT_NAME', fieldExist('name', 'accounts'));
|
||||
// load vocation names
|
||||
$tmp = '';
|
||||
if($cache->enabled() && $cache->fetch('vocations', $tmp)) {
|
||||
@@ -121,10 +135,10 @@ else {
|
||||
$config['vocations'] = array();
|
||||
foreach($vocations->getElementsByTagName('vocation') as $vocation) {
|
||||
$id = $vocation->getAttribute('id');
|
||||
if($id == $vocation->getAttribute('fromvoc'))
|
||||
//if($id == $vocation->getAttribute('fromvoc'))
|
||||
$config['vocations'][$id] = $vocation->getAttribute('name');
|
||||
else
|
||||
$config['vocations'][$id + 4] = $vocation->getAttribute('name');
|
||||
//else
|
||||
// $config['vocations'][$id] = $vocation->getAttribute('name');
|
||||
}
|
||||
|
||||
if($cache->enabled()) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @author Mark Samman (Talaturen) <marksamman@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @author Mark Samman (Talaturen) <marksamman@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -42,6 +42,10 @@ class Cache_APC
|
||||
return ($var = apc_fetch($this->prefix . $key)) !== false;
|
||||
}
|
||||
|
||||
public function delete($key) {
|
||||
apc_delete($key);
|
||||
}
|
||||
|
||||
public function enabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @author Mark Samman (Talaturen) <marksamman@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -41,6 +41,10 @@ class Cache_eAccelerator
|
||||
return ($var = eaccelerator_get($this->prefix . $key)) !== null;
|
||||
}
|
||||
|
||||
public function delete($key) {
|
||||
eaccelerator_rm($key);
|
||||
}
|
||||
|
||||
public function enabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -51,6 +51,13 @@ class Cache_File
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delete($key)
|
||||
{
|
||||
$file = $this->_name($key);
|
||||
if(file_exists($file))
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
public function enabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @author Mark Samman (Talaturen) <marksamman@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -47,6 +47,10 @@ class Cache_XCache
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delete($key) {
|
||||
xcache_unset($key);
|
||||
}
|
||||
|
||||
public function enabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -134,10 +134,13 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
* @throws PDOException On PDO operation error.
|
||||
* @deprecated 0.1.5 Use createNamed().
|
||||
*/
|
||||
public function create($name, $id = NULL)
|
||||
public function create($name = NULL, $id = NULL)
|
||||
{
|
||||
// saves blank account info
|
||||
$this->db->query('INSERT INTO `accounts` (' . (isset($id) ? '`id`,' : '') . '`name`, `password`, `email`, `created`) VALUES (' . (isset($id) ? $id . ',' : '') . $this->db->quote($name) . ', \'\', \'\',' . time() . ')');
|
||||
$this->db->query('INSERT INTO `accounts` (' . (isset($id) ? '`id`,' : '') . (isset($name) ? '`name`,' : '') . '`password`, `email`, `created`) VALUES (' . (isset($id) ? $id . ',' : '') . (isset($name) ? $this->db->quote($name) . ',' : '') . ' \'\', \'\',' . time() . ')');
|
||||
|
||||
if(isset($name))
|
||||
$this->data['name'] = $name;
|
||||
|
||||
$this->data['id'] = $this->db->lastInsertId();
|
||||
return $this->data['id'];
|
||||
@@ -167,7 +170,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
public function load($id)
|
||||
{
|
||||
// SELECT query on database
|
||||
$this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('salt') . ', ' . $this->db->fieldName('email') . ', ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('web_flags') . ', ' . $this->db->fieldName('premdays') . ', ' . $this->db->fieldName('lastday') . ', ' . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
|
||||
$this->data = $this->db->query('SELECT `id`, ' . (fieldExist('name', 'accounts') ? '`name`,' : '') . '`password`, `email`, ' . $this->db->fieldName('blocked') . ', ' . $this->db->fieldName('rlname') . ', ' . $this->db->fieldName('location') . ', ' . $this->db->fieldName('web_flags') . ', ' . (fieldExist('premdays', 'accounts') ? $this->db->fieldName('premdays') . ',' : '') . (fieldExist('lastday', 'accounts') ? $this->db->fieldName('lastday') . ',' : (fieldExist('premend', 'accounts') ? $this->db->fieldName('premend') . ' as `lastday`,' : '')) . $this->db->fieldName('created') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,6 +187,9 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
*/
|
||||
public function find($name)
|
||||
{
|
||||
if(check_number($name))
|
||||
$this->load((int)$name);
|
||||
|
||||
// finds player's ID
|
||||
$id = $this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('accounts') . ' WHERE ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($name) )->fetch();
|
||||
|
||||
@@ -246,14 +252,12 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
throw new E_OTS_NotLoaded();
|
||||
}
|
||||
|
||||
$lastday = 'lastday';
|
||||
if(fieldExist('premend', 'accounts'))
|
||||
$lastday = 'premend';
|
||||
|
||||
// UPDATE query on database
|
||||
<<<<<<< .mine
|
||||
$this->db->query('UPDATE `accounts` SET `name` = ' . $this->db->quote($this->data['name']) . ', `password` = ' . $this->db->quote($this->data['password']) . ', `email` = ' . $this->db->quote($this->data['email']) . ', `blocked` = ' . (int) $this->data['blocked'] . ', `rlname` = ' . $this->db->quote($this->data['rlname']) . ', `location` = ' . $this->db->quote($this->data['location']) . ', `web_flags` = ' . (int) $this->data['web_flags'] . ', `premdays` = ' . (int) $this->data['premdays'] . ', `lastday` = ' . (int) $this->data['lastday'] . ' WHERE `id` = ' . $this->data['id']);
|
||||
||||||| .r19
|
||||
$this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('web_flags') . ' = ' . (int) $this->data['web_flags'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
|
||||
=======
|
||||
$this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName('password') . ' = ' . $this->db->quote($this->data['password']) . ', ' . $this->db->fieldName('salt') . ' = ' . $this->db->quote($this->data['salt']) . ', ' . $this->db->fieldName('email') . ' = ' . $this->db->quote($this->data['email']) . ', ' . $this->db->fieldName('blocked') . ' = ' . (int) $this->data['blocked'] . ', ' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . ', ' . $this->db->fieldName('location') . ' = ' . $this->db->quote($this->data['location']) . ', ' . $this->db->fieldName('web_flags') . ' = ' . (int) $this->data['web_flags'] . ', ' . $this->db->fieldName('premdays') . ' = ' . (int) $this->data['premdays'] . ', ' . $this->db->fieldName('lastday') . ' = ' . (int) $this->data['lastday'] . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
|
||||
>>>>>>> .r40
|
||||
$this->db->query('UPDATE `accounts` SET ' . (fieldExist('name', 'accounts') ? '`name` = ' . $this->db->quote($this->data['name']) . ',' : '') . '`password` = ' . $this->db->quote($this->data['password']) . ', `email` = ' . $this->db->quote($this->data['email']) . ', `blocked` = ' . (int) $this->data['blocked'] . ', `rlname` = ' . $this->db->quote($this->data['rlname']) . ', `location` = ' . $this->db->quote($this->data['location']) . ', `web_flags` = ' . (int) $this->data['web_flags'] . ', ' . (fieldExist('premdays', 'accounts') ? '`premdays` = ' . (int) $this->data['premdays'] . ',' : '') . '`' . $lastday . '` = ' . (int) $this->data['lastday'] . ' WHERE `id` = ' . $this->data['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,12 +313,13 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
|
||||
public function getPremDays()
|
||||
{
|
||||
if( !isset($this->data['premdays']) || !isset($this->data['lastday']) )
|
||||
if( !isset($this->data['lastday']) )
|
||||
{
|
||||
throw new E_OTS_NotLoaded();
|
||||
}
|
||||
|
||||
return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));
|
||||
return round(($this->data['lastday'] - time()) / (24 * 60 * 60), 3);
|
||||
//return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));
|
||||
}
|
||||
|
||||
public function getLastLogin()
|
||||
@@ -331,7 +336,8 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
{
|
||||
global $config;
|
||||
if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return true;
|
||||
return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0);
|
||||
return $this->data['lastday'] > time();
|
||||
//return ($this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])) > 0);
|
||||
}
|
||||
|
||||
public function getCreated()
|
||||
@@ -449,16 +455,6 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
$this->data['password'] = (string) $password;
|
||||
}
|
||||
|
||||
public function getSalt()
|
||||
{
|
||||
if( !isset($this->data['salt']) )
|
||||
{
|
||||
throw new E_OTS_NotLoaded();
|
||||
}
|
||||
|
||||
return $this->data['salt'];
|
||||
}
|
||||
|
||||
public function setSalt($salt)
|
||||
{
|
||||
$this->data['salt'] = (string) $salt;
|
||||
@@ -801,21 +797,21 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
*/
|
||||
public function getAccess()
|
||||
{
|
||||
global $groups;
|
||||
if(!isset($groups))
|
||||
$groups = new OTS_Groups_List();
|
||||
|
||||
// by default
|
||||
$access = 0;
|
||||
if(fieldExist('group_id', 'accounts')) {
|
||||
$query = $this->db->query('SELECT `group_id` FROM `accounts` WHERE `id` = ' . (int) $this->getId())->fetch();
|
||||
// if anything was found
|
||||
if(isset($query['group_id']))
|
||||
$access = $query['group_id'];
|
||||
|
||||
return $access;
|
||||
$group = $groups->getGroup($query['group_id']);
|
||||
if(!$group) return 0;
|
||||
return $group->getAccess();
|
||||
}
|
||||
|
||||
global $groups;
|
||||
if(!isset($groups))
|
||||
$groups = new OTS_Groups_List();
|
||||
|
||||
// finds groups of all characters
|
||||
foreach( $this->getPlayersList() as $player)
|
||||
{
|
||||
@@ -831,6 +827,35 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
return $access;
|
||||
}
|
||||
|
||||
public function getGroupId()
|
||||
{
|
||||
global $groups;
|
||||
if(!isset($groups))
|
||||
$groups = new OTS_Groups_List();
|
||||
|
||||
$group_id = 0;
|
||||
if(fieldExist('group_id', 'accounts')) {
|
||||
$query = $this->db->query('SELECT `group_id` FROM `accounts` WHERE `id` = ' . (int) $this->getId())->fetch();
|
||||
// if anything was found
|
||||
if(isset($query['group_id']))
|
||||
return $query['group_id'];
|
||||
}
|
||||
|
||||
// finds groups of all characters
|
||||
foreach( $this->getPlayersList() as $player)
|
||||
{
|
||||
$group = $player->getGroup();
|
||||
|
||||
// checks if group's access level is higher then previouls found highest
|
||||
if( $group->getId() > $group_id)
|
||||
{
|
||||
$group_id = $group->getId();
|
||||
}
|
||||
}
|
||||
|
||||
return $group_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks highest access level of account in given guild.
|
||||
*
|
||||
@@ -860,7 +885,15 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
|
||||
public function logAction($action)
|
||||
{
|
||||
return $this->db->query('INSERT INTO ' . $this->db->tableName(TABLE_PREFIX . 'account_actions') . ' (' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('ip') . ', ' . $this->db->fieldName('date') . ', ' . $this->db->fieldName('action') . ') VALUES (' . $this->db->quote($this->getId()).', INET_ATON(' . $this->db->quote($_SERVER['REMOTE_ADDR']) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')');
|
||||
$ip = '127.0.0.1';
|
||||
if(isset($_SERVER['REMOTE_ADDR']) && !empty(($_SERVER['REMOTE_ADDR'])))
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
else if(isset($_SERVER['HTTP_CLIENT_IP']) && !empty(($_SERVER['HTTP_CLIENT_IP'])))
|
||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty(($_SERVER['HTTP_X_FORWARDED_FOR'])))
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
|
||||
return $this->db->query('INSERT INTO ' . $this->db->tableName(TABLE_PREFIX . 'account_actions') . ' (' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('ip') . ', ' . $this->db->fieldName('date') . ', ' . $this->db->fieldName('action') . ') VALUES (' . $this->db->quote($this->getId()).', INET_ATON(' . $this->db->quote($ip) . '), UNIX_TIMESTAMP(NOW()), ' . $this->db->quote($action).')');
|
||||
}
|
||||
|
||||
public function getActionsLog($limit1, $limit2)
|
||||
|
@@ -92,17 +92,8 @@ class OTS_DB_MySQL extends OTS_Base_DB
|
||||
$this->prefix = $params['prefix'];
|
||||
}
|
||||
|
||||
// PDO constructor
|
||||
try
|
||||
{
|
||||
parent::__construct('mysql:' . implode(';', $dns), $user, $password);
|
||||
}
|
||||
catch(PDOException $error)
|
||||
{
|
||||
echo 'Can\'t connect to MySQL database.';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Query-quoted field name.
|
||||
|
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**#@+
|
||||
* @version 0.0.4
|
||||
* @since 0.0.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package POT
|
||||
* @version 0.1.3
|
||||
* @author Wrzasq <wrzasq@gmail.com>
|
||||
* @copyright 2007 - 2008 (C) by Wrzasq
|
||||
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3
|
||||
*/
|
||||
|
||||
/**
|
||||
* ODBC connection interface.
|
||||
*
|
||||
* <p>
|
||||
* At all everything that you really need to read from this class documentation is list of parameters for driver's constructor.
|
||||
* </p>
|
||||
*
|
||||
* @package POT
|
||||
* @version 0.1.3
|
||||
*/
|
||||
class OTS_DB_ODBC extends OTS_Base_DB
|
||||
{
|
||||
/**
|
||||
* Creates database connection.
|
||||
*
|
||||
* <p>
|
||||
* Connects to ODBC data source on given arguments.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* List of parameters for this drivers:
|
||||
* </p>
|
||||
*
|
||||
* <ul>
|
||||
* <li><var>host</var> - database host.</li>
|
||||
* <li><var>port</var> - ODBC driver.</li>
|
||||
* <li><var>database</var> - database name.</li>
|
||||
* <li><var>user</var> - user login.</li>
|
||||
* <li><var>password</var> - user password.</li>
|
||||
* <li><var>source</var> - ODBC data source.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* Note: Since 0.1.3 version <var>source</var> parameter was added.
|
||||
* </p>
|
||||
*
|
||||
* @version 0.1.3
|
||||
* @param array $params Connection parameters.
|
||||
* @throws PDOException On PDO operation error.
|
||||
*/
|
||||
public function __construct($params)
|
||||
{
|
||||
$user = null;
|
||||
$password = null;
|
||||
$dns = array();
|
||||
|
||||
if( isset($params['host']) )
|
||||
{
|
||||
$dns[] = 'HOSTNAME={' . $params['host'] . '}';
|
||||
}
|
||||
|
||||
if( isset($params['port']) )
|
||||
{
|
||||
$dns[] = 'DRIVER={' . $params['port'] . '}';
|
||||
}
|
||||
|
||||
if( isset($params['database']) )
|
||||
{
|
||||
$dns[] = 'DATABASE={' . $params['database'] . '}';
|
||||
}
|
||||
|
||||
if( isset($params['user']) )
|
||||
{
|
||||
$user = $params['user'];
|
||||
$dns[] = 'UID={' . $user . '}';
|
||||
}
|
||||
|
||||
if( isset($params['password']) )
|
||||
{
|
||||
$password = $params['password'];
|
||||
$dns[] = 'PWD={' . $user . '}';
|
||||
}
|
||||
|
||||
if( isset($params['prefix']) )
|
||||
{
|
||||
$this->prefix = $params['prefix'];
|
||||
}
|
||||
|
||||
// composes DNS
|
||||
$dns = implode(';', $dns);
|
||||
|
||||
// source parameter overwrites all other params
|
||||
if( isset($params['source']) )
|
||||
{
|
||||
$dns = $params['source'];
|
||||
}
|
||||
|
||||
// PDO constructor
|
||||
parent::__construct('odbc:' . $dns, $user, $password);
|
||||
}
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**#@+
|
||||
* @version 0.0.4
|
||||
* @since 0.0.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package POT
|
||||
* @version 0.1.3
|
||||
* @author Wrzasq <wrzasq@gmail.com>
|
||||
* @copyright 2007 (C) by Wrzasq
|
||||
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3
|
||||
*/
|
||||
|
||||
/**
|
||||
* PostgreSQL connection interface.
|
||||
*
|
||||
* <p>
|
||||
* At all everything that you really need to read from this class documentation is list of parameters for driver's constructor.
|
||||
* </p>
|
||||
*
|
||||
* @package POT
|
||||
* @version 0.1.3
|
||||
*/
|
||||
class OTS_DB_PostgreSQL extends OTS_Base_DB
|
||||
{
|
||||
/**
|
||||
* Creates database connection.
|
||||
*
|
||||
* <p>
|
||||
* Connects to PgSQL (PostgreSQL) database on given arguments.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* List of parameters for this drivers:
|
||||
* </p>
|
||||
*
|
||||
* <ul>
|
||||
* <li><var>host</var> - database server.</li>
|
||||
* <li><var>port</var> - port (optional, also it is possible to use host:port in <var>host</var> parameter).</li>
|
||||
* <li><var>database</var> - database name.</li>
|
||||
* <li><var>user</var> - user login.</li>
|
||||
* <li><var>password</var> - user password.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @version 0.0.6
|
||||
* @param array $params Connection parameters.
|
||||
* @throws PDOException On PDO operation error.
|
||||
*/
|
||||
public function __construct($params)
|
||||
{
|
||||
$user = null;
|
||||
$password = null;
|
||||
$dns = array();
|
||||
|
||||
// host:port support
|
||||
if( strpos(':', $params['host']) !== false)
|
||||
{
|
||||
$host = explode(':', $params['host'], 2);
|
||||
|
||||
$params['host'] = $host[0];
|
||||
$params['port'] = $host[1];
|
||||
}
|
||||
|
||||
if( isset($params['host']) )
|
||||
{
|
||||
$dns[] = 'host=' . $params['host'];
|
||||
}
|
||||
|
||||
if( isset($params['port']) )
|
||||
{
|
||||
$dns[] = 'port=' . $params['port'];
|
||||
}
|
||||
|
||||
if( isset($params['database']) )
|
||||
{
|
||||
$dns[] = 'dbname=' . $params['database'];
|
||||
}
|
||||
|
||||
if( isset($params['user']) )
|
||||
{
|
||||
$user = $params['user'];
|
||||
}
|
||||
|
||||
if( isset($params['password']) )
|
||||
{
|
||||
$password = $params['password'];
|
||||
}
|
||||
|
||||
if( isset($params['prefix']) )
|
||||
{
|
||||
$this->prefix = $params['prefix'];
|
||||
}
|
||||
|
||||
// PDO constructor
|
||||
parent::__construct('pgsql:' . implode(' ', $dns), $user, $password);
|
||||
}
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
@@ -490,6 +490,9 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
// creates filter
|
||||
$filter = new OTS_SQLFilter();
|
||||
$filter->compareField('group_id', (int) $this->data['id']);
|
||||
if(fieldExist('deletion', 'players'))
|
||||
$filter->compareField('deletion', 0);
|
||||
else
|
||||
$filter->compareField('deleted', 0);
|
||||
|
||||
// creates list object
|
||||
|
@@ -31,9 +31,9 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
*/
|
||||
public function __construct($file = '')
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if(tableExist('groups')) { // read groups from database
|
||||
global $db;
|
||||
|
||||
foreach($db->query('SELECT `id`, `name`, `access` FROM `groups`;') as $group)
|
||||
{
|
||||
$info = array();
|
||||
@@ -52,6 +52,8 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
$file = $config['data_path'] . 'XML/groups.xml';
|
||||
}
|
||||
|
||||
global $cache;
|
||||
|
||||
$data = array();
|
||||
if($cache->enabled())
|
||||
{
|
||||
@@ -135,6 +137,17 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
throw new OutOfBoundsException();
|
||||
}
|
||||
|
||||
public function getHighestId()
|
||||
{
|
||||
$group_id = 0;
|
||||
foreach($this->groups as $id => $group) {
|
||||
if($id > $group_id)
|
||||
$group_id = $id;
|
||||
}
|
||||
|
||||
return $group_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string representation of object.
|
||||
*
|
||||
|
@@ -117,16 +117,11 @@ class OTS_Player extends OTS_Row_DAO
|
||||
{
|
||||
$loss = '';
|
||||
if(fieldExist('loss_experience', 'players')) {
|
||||
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`';
|
||||
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `loss_containers`';
|
||||
}
|
||||
|
||||
$guild_info = '';
|
||||
if(fieldExist('guildnick', 'players')) {
|
||||
$guild_info = ', `guildnick`, `rank_id`';
|
||||
}
|
||||
|
||||
$guild_info = '';
|
||||
if(fieldExist('guildnick', 'players')) {
|
||||
if(!tableExist('guild_members') && fieldExist('guildnick', 'players')) {
|
||||
$guild_info = ', `guildnick`, `rank_id`';
|
||||
}
|
||||
|
||||
@@ -141,7 +136,13 @@ class OTS_Player extends OTS_Row_DAO
|
||||
}
|
||||
|
||||
// SELECT query on database
|
||||
$this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull`' . $guild_info . ', `town_id`' . $loss . ', `balance`, `blessings`, `stamina`' . (fieldExist('world_id', 'players') ? ', `world_id`' : '') . (fieldExist('online', 'players') ? ', `online`, `' : '') . ', `' . (fieldExist('deletion', 'players') ? 'deletion' : 'deleted') . '`' . (fieldExist('promotion', 'players') ? ', `promotion`' : '') . (fieldExist('marriage', 'players') ? ', `marriage`' : '') . ', `comment`, `created`, `hidden` FROM `players` WHERE `id` = ' . (int) $id)->fetch();
|
||||
$this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . (fieldExist('lookaddons', 'players') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull`' . $guild_info . ', `town_id`' . $loss . ', `balance`' . (fieldExist('blessings', 'players') ? ', `blessings`' : '') . (fieldExist('direction', 'players') ? ', `direction`' : '') . (fieldExist('stamina', 'players') ? ', `stamina`' : '') . (fieldExist('world_id', 'players') ? ', `world_id`' : '') . (fieldExist('online', 'players') ? ', `online`' : '') . ', `' . (fieldExist('deletion', 'players') ? 'deletion' : 'deleted') . '`' . (fieldExist('promotion', 'players') ? ', `promotion`' : '') . (fieldExist('marriage', 'players') ? ', `marriage`' : '') . ', `comment`, `created`, `hidden` FROM `players` WHERE `id` = ' . (int)$id)->fetch();
|
||||
|
||||
if(!isset($this->data['guildnick']) || $this->data['guildnick'])
|
||||
$this->data['guildnick'] = '';
|
||||
|
||||
if(!isset($this->data['rank_id']) || $this->data['rank_id'] == NULL)
|
||||
$this->data['rank_id'] = 0;
|
||||
|
||||
if(isset($this->data['promotion'])) {
|
||||
if((int)$this->data['promotion'] > 0)
|
||||
@@ -239,16 +240,49 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$skull_time = 'skull_time';
|
||||
}
|
||||
|
||||
if(!isset($this->data['loss_experience']))
|
||||
$this->data['loss_experience'] = 100;
|
||||
|
||||
if(!isset($this->data['loss_mana']))
|
||||
$this->data['loss_mana'] = 100;
|
||||
|
||||
if(!isset($this->data['loss_skills']))
|
||||
$this->data['loss_skills'] = 100;
|
||||
|
||||
if(!isset($this->data['loss_items']))
|
||||
$this->data['loss_items'] = 10;
|
||||
|
||||
if(!isset($this->data['loss_containers']))
|
||||
$this->data['loss_containers'] = 100;
|
||||
|
||||
if(!isset($this->data['guildnick']))
|
||||
$this->data['guildnick'] = '';
|
||||
|
||||
if(!isset($this->data['rank_id']))
|
||||
$this->data['rank_id'] = 0;
|
||||
|
||||
if(!isset($this->data['promotion']))
|
||||
$this->data['promotion'] = 0;
|
||||
|
||||
if(!isset($this->data['direction']))
|
||||
$this->data['direction'] = 0;
|
||||
|
||||
if(!isset($this->data['conditions']))
|
||||
$this->data['conditions'] = '';
|
||||
|
||||
if(!isset($this->data['town_id']))
|
||||
$this->data['town_id'] = 1;
|
||||
|
||||
// updates existing player
|
||||
if( isset($this->data['id']) )
|
||||
{
|
||||
$loss = '';
|
||||
if(fieldExist('loss_experience', 'players')) {
|
||||
$loss = ', `loss_experience` = ' . $this->data['loss_experience'] . ', `loss_mana` = ' . $this->data['loss_mana'] . ', `loss_skills` = ' . $this->data['loss_skills'] . ', `loss_items` = ' . $this->data['loss_items'];
|
||||
$loss = ', `loss_experience` = ' . $this->data['loss_experience'] . ', `loss_mana` = ' . $this->data['loss_mana'] . ', `loss_skills` = ' . $this->data['loss_skills'] . ', `loss_items` = ' . $this->data['loss_items'] . ', `loss_containers` = ' . $this->data['loss_containers'];
|
||||
}
|
||||
|
||||
$guild_info = '';
|
||||
if(fieldExist('guildnick', 'players')) {
|
||||
if(!tableExist('guild_members') && fieldExist('guildnick', 'players')) {
|
||||
$guild_info = ', `guildnick` = ' . $this->db->quote($this->data['guildnick']) . ', ' . $this->db->fieldName('rank_id') . ' = ' . $this->data['rank_id'];
|
||||
}
|
||||
|
||||
@@ -257,8 +291,23 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$direction = ', `direction` = ' . $this->db->quote($this->data['direction']);
|
||||
}
|
||||
|
||||
$blessings = '';
|
||||
if(fieldExist('blessings', 'players')) {
|
||||
$blessings = ', `blessings` = ' . $this->db->quote($this->data['blessings']);
|
||||
}
|
||||
|
||||
$stamina = '';
|
||||
if(fieldExist('stamina', 'players')) {
|
||||
$stamina = ', `stamina` = ' . $this->db->quote($this->data['stamina']);
|
||||
}
|
||||
|
||||
$lookaddons = '';
|
||||
if(fieldExist('lookaddons', 'players')) {
|
||||
$lookaddons = ', `lookaddons` = ' . $this->db->quote($this->data['lookaddons']);
|
||||
}
|
||||
|
||||
// UPDATE query on database
|
||||
$this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . ', ' . $this->db->fieldName('lookaddons') . ' = ' . $this->data['lookaddons'] . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->data['lastip'] . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . ', ' . $this->db->fieldName('blessings') . ' = ' . $this->data['blessings'] . ', ' . $this->db->fieldName('stamina') . ' = ' . $this->data['stamina'] . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
|
||||
$this->db->query('UPDATE ' . $this->db->tableName('players') . ' SET ' . $this->db->fieldName('name') . ' = ' . $this->db->quote($this->data['name']) . ', ' . $this->db->fieldName('account_id') . ' = ' . $this->data['account_id'] . ', ' . $this->db->fieldName('group_id') . ' = ' . $this->data['group_id'] . ', ' . $this->db->fieldName('sex') . ' = ' . $this->data['sex'] . ', ' . $this->db->fieldName('vocation') . ' = ' . $this->data['vocation'] . ', ' . $this->db->fieldName('experience') . ' = ' . $this->data['experience'] . ', ' . $this->db->fieldName('level') . ' = ' . $this->data['level'] . ', ' . $this->db->fieldName('maglevel') . ' = ' . $this->data['maglevel'] . ', ' . $this->db->fieldName('health') . ' = ' . $this->data['health'] . ', ' . $this->db->fieldName('healthmax') . ' = ' . $this->data['healthmax'] . ', ' . $this->db->fieldName('mana') . ' = ' . $this->data['mana'] . ', ' . $this->db->fieldName('manamax') . ' = ' . $this->data['manamax'] . ', ' . $this->db->fieldName('manaspent') . ' = ' . $this->data['manaspent'] . ', ' . $this->db->fieldName('soul') . ' = ' . $this->data['soul'] . ', ' . $this->db->fieldName('lookbody') . ' = ' . $this->data['lookbody'] . ', ' . $this->db->fieldName('lookfeet') . ' = ' . $this->data['lookfeet'] . ', ' . $this->db->fieldName('lookhead') . ' = ' . $this->data['lookhead'] . ', ' . $this->db->fieldName('looklegs') . ' = ' . $this->data['looklegs'] . ', ' . $this->db->fieldName('looktype') . ' = ' . $this->data['looktype'] . $lookaddons . ', ' . $this->db->fieldName('posx') . ' = ' . $this->data['posx'] . ', ' . $this->db->fieldName('posy') . ' = ' . $this->data['posy'] . ', ' . $this->db->fieldName('posz') . ' = ' . $this->data['posz'] . ', ' . $this->db->fieldName('cap') . ' = ' . $this->data['cap'] . ', ' . $this->db->fieldName('lastlogin') . ' = ' . $this->data['lastlogin'] . ', ' . $this->db->fieldName('lastlogout') . ' = ' . $this->data['lastlogout'] . ', ' . $this->db->fieldName('lastip') . ' = ' . $this->data['lastip'] . ', ' . $this->db->fieldName('save') . ' = ' . (int) $this->data['save'] . ', ' . $this->db->fieldName('conditions') . ' = ' . $this->db->quote($this->data['conditions']) . ', `' . $skull_time . '` = ' . $this->data['skulltime'] . ', `' . $skull_type . '` = ' . (int) $this->data['skull'] . $guild_info . ', ' . $this->db->fieldName('town_id') . ' = ' . $this->data['town_id'] . $loss . ', ' . $this->db->fieldName('balance') . ' = ' . $this->data['balance'] . $blessings . $stamina . $direction . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
|
||||
}
|
||||
// creates new player
|
||||
else
|
||||
@@ -266,13 +315,13 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$loss = '';
|
||||
$loss_data = '';
|
||||
if(fieldExist('loss_experience', 'players')) {
|
||||
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`';
|
||||
$loss_data = ', ' . $this->data['loss_experience'] . ', ' . $this->data['loss_mana'] . ', ' . $this->data['loss_skills'] . ', ' . $this->data['loss_items'];
|
||||
$loss = ', `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `loss_containers`';
|
||||
$loss_data = ', ' . $this->data['loss_experience'] . ', ' . $this->data['loss_mana'] . ', ' . $this->data['loss_skills'] . ', ' . $this->data['loss_items'] . ', ' . $this->data['loss_containers'];
|
||||
}
|
||||
|
||||
$guild_info = '';
|
||||
$guild_info_data = '';
|
||||
if(fieldExist('guildnick', 'players')) {
|
||||
if(!tableExist('guild_members') && fieldExist('guildnick', 'players')) {
|
||||
$guild_info = ', `guildnick`, `rank_id`';
|
||||
$guild_info_data = ', ' . $this->db->quote($this->data['guildnick']) . ', ' . $this->data['rank_id'];
|
||||
}
|
||||
@@ -287,12 +336,33 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$direction = '';
|
||||
$direction_data = '';
|
||||
if(fieldExist('direction', 'players')) {
|
||||
$direction = ', `balance`';
|
||||
$direction_data = ', ' . $this->data['balance'];
|
||||
$direction = ', `direction`';
|
||||
$direction_data = ', ' . $this->data['direction'];
|
||||
}
|
||||
|
||||
$blessings = '';
|
||||
$blessings_data = '';
|
||||
if(fieldExist('blessings', 'players')) {
|
||||
$blessings = ', `blessings`';
|
||||
$blessings_data = ', ' . $this->data['blessings'];
|
||||
}
|
||||
|
||||
$stamina = '';
|
||||
$stamina_data = '';
|
||||
if(fieldExist('stamina', 'players')) {
|
||||
$stamina = ', `stamina`';
|
||||
$stamina_data = ', ' . $this->data['stamina'];
|
||||
}
|
||||
|
||||
$lookaddons = '';
|
||||
$lookaddons_data = '';
|
||||
if(fieldExist('lookaddons', 'players')) {
|
||||
$lookaddons = ', `lookaddons`';
|
||||
$lookaddons_data = ', ' . $this->data['lookaddons'];
|
||||
}
|
||||
|
||||
// INSERT query on database
|
||||
$this->db->query('INSERT INTO ' . $this->db->tableName('players') . ' (' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('group_id') . ', ' . $this->db->fieldName('sex') . ', ' . $this->db->fieldName('vocation') . ', ' . $this->db->fieldName('experience') . ', ' . $this->db->fieldName('level') . ', ' . $this->db->fieldName('maglevel') . ', ' . $this->db->fieldName('health') . ', ' . $this->db->fieldName('healthmax') . ', ' . $this->db->fieldName('mana') . ', ' . $this->db->fieldName('manamax') . ', ' . $this->db->fieldName('manaspent') . ', ' . $this->db->fieldName('soul') . ', ' . $this->db->fieldName('lookbody') . ', ' . $this->db->fieldName('lookfeet') . ', ' . $this->db->fieldName('lookhead') . ', ' . $this->db->fieldName('looklegs') . ', ' . $this->db->fieldName('looktype') . ', ' . $this->db->fieldName('lookaddons') . ', ' . $this->db->fieldName('posx') . ', ' . $this->db->fieldName('posy') . ', ' . $this->db->fieldName('posz') . ', ' . $this->db->fieldName('cap') . ', `lastlogin`, `lastlogout`, ' . $this->db->fieldName('lastip') . ', ' . $this->db->fieldName('save') . ', ' . $this->db->fieldName('conditions') . ', `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', ' . $this->db->fieldName('town_id') . $loss . ', `balance`, `blessings`, `stamina`' . $direction . ', ' . $this->db->fieldName('created') . $promotion . ') VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . ', ' . $this->data['lookaddons'] . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . ', ' . $this->data['balance'] . ', ' . $this->data['blessings'] . ', ' . $this->data['stamina'] . $direction_data . ', ' . time() . $promotion_data . ')');
|
||||
$this->db->query('INSERT INTO ' . $this->db->tableName('players') . ' (' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('account_id') . ', ' . $this->db->fieldName('group_id') . ', ' . $this->db->fieldName('sex') . ', ' . $this->db->fieldName('vocation') . ', ' . $this->db->fieldName('experience') . ', ' . $this->db->fieldName('level') . ', ' . $this->db->fieldName('maglevel') . ', ' . $this->db->fieldName('health') . ', ' . $this->db->fieldName('healthmax') . ', ' . $this->db->fieldName('mana') . ', ' . $this->db->fieldName('manamax') . ', ' . $this->db->fieldName('manaspent') . ', ' . $this->db->fieldName('soul') . ', ' . $this->db->fieldName('lookbody') . ', ' . $this->db->fieldName('lookfeet') . ', ' . $this->db->fieldName('lookhead') . ', ' . $this->db->fieldName('looklegs') . ', ' . $this->db->fieldName('looktype') . $lookaddons . ', ' . $this->db->fieldName('posx') . ', ' . $this->db->fieldName('posy') . ', ' . $this->db->fieldName('posz') . ', ' . $this->db->fieldName('cap') . ', `lastlogin`, `lastlogout`, ' . $this->db->fieldName('lastip') . ', ' . $this->db->fieldName('save') . ', ' . $this->db->fieldName('conditions') . ', `' . $skull_time . '`, `' . $skull_type . '`' . $guild_info . ', ' . $this->db->fieldName('town_id') . $loss . ', `balance`' . $blessings . $stamina . $direction . ', ' . $this->db->fieldName('created') . $promotion . ') VALUES (' . $this->db->quote($this->data['name']) . ', ' . $this->data['account_id'] . ', ' . $this->data['group_id'] . ', ' . $this->data['sex'] . ', ' . $this->data['vocation'] . ', ' . $this->data['experience'] . ', ' . $this->data['level'] . ', ' . $this->data['maglevel'] . ', ' . $this->data['health'] . ', ' . $this->data['healthmax'] . ', ' . $this->data['mana'] . ', ' . $this->data['manamax'] . ', ' . $this->data['manaspent'] . ', ' . $this->data['soul'] . ', ' . $this->data['lookbody'] . ', ' . $this->data['lookfeet'] . ', ' . $this->data['lookhead'] . ', ' . $this->data['looklegs'] . ', ' . $this->data['looktype'] . $lookaddons_data . ', ' . $this->data['posx'] . ', ' . $this->data['posy'] . ', ' . $this->data['posz'] . ', ' . $this->data['cap'] . ', ' . $this->data['lastlogin'] . ', ' . $this->data['lastlogout'] . ', ' . $this->data['lastip'] . ', ' . (int) $this->data['save'] . ', ' . $this->db->quote($this->data['conditions']) . ', ' . $this->data['skulltime'] . ', ' . (int) $this->data['skull'] . $guild_info_data . ', ' . $this->data['town_id'] . $loss_data . ', ' . $this->data['balance'] . $blessings_data . $stamina_data . $direction_data . ', ' . time() . $promotion_data . ')');
|
||||
// ID of new group
|
||||
$this->data['id'] = $this->db->lastInsertId();
|
||||
}
|
||||
@@ -454,6 +524,11 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$this->data['account_id'] = $account->getId();
|
||||
}
|
||||
|
||||
public function setAccountId($account_id)
|
||||
{
|
||||
$this->data['account_id'] = (int)$account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns group of this player.
|
||||
*
|
||||
@@ -1672,7 +1747,11 @@ class OTS_Player extends OTS_Row_DAO
|
||||
*/
|
||||
public function loadRank()
|
||||
{
|
||||
$ranks = $this->db->query('SELECT `rank_id`, `nick` FROM `guild_membership` WHERE `player_id` = ' . $this->db->quote($this->getID()))->fetch();
|
||||
$table = 'guild_membership';
|
||||
if(tableExist('guild_members'))
|
||||
$table = 'guild_members';
|
||||
|
||||
$ranks = $this->db->query('SELECT `rank_id`, `nick` FROM `' . $table . '` WHERE `player_id` = ' . $this->db->quote($this->getID()))->fetch();
|
||||
if($ranks)
|
||||
{
|
||||
$this->data['rank_id'] = new OTS_GuildRank($ranks['rank_id']);
|
||||
@@ -1707,6 +1786,8 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$this->data['guildnick'] = (string) $guildnick;
|
||||
if(fieldExist('guildnick', 'players'))
|
||||
$this->db->query('UPDATE `players` SET `guildnick` = ' . $this->db->quote($this->data['guildnick']) . ' WHERE `id` = ' . $this->getId());
|
||||
else if(tableExist('guild_members'))
|
||||
$this->db->query('UPDATE `guild_members` SET `nick` = ' . $this->db->quote($this->data['guildnick']) . ' WHERE `player_id` = ' . $this->getId());
|
||||
else
|
||||
$this->db->query('UPDATE `guild_membership` SET `nick` = ' . $this->db->quote($this->data['guildnick']) . ' WHERE `player_id` = ' . $this->getId());
|
||||
}
|
||||
@@ -1746,7 +1827,11 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$query = $this->db->query('SELECT `rank_id` FROM `players` WHERE `id`= ' . $this->data['id'] . ';')->fetch();
|
||||
$rank_id = $query['rank_id'];
|
||||
} else {
|
||||
$query = $this->db->query('SELECT `rank_id` FROM `guild_membership` WHERE `player_id`= ' . $this->data['id'] . ' LIMIT 1;');
|
||||
$table = 'guild_membership';
|
||||
if(tableExist('guild_members'))
|
||||
$table = 'guild_members';
|
||||
|
||||
$query = $this->db->query('SELECT `rank_id` FROM `' . $table . '` WHERE `player_id`= ' . $this->data['id'] . ' LIMIT 1;');
|
||||
if($query->rowCount() == 1) {
|
||||
$query = $query->fetch();
|
||||
$rank_id = $query['rank_id'];
|
||||
@@ -1768,8 +1853,17 @@ class OTS_Player extends OTS_Row_DAO
|
||||
{
|
||||
if( isset($rank_id) && isset($guild)) {
|
||||
if($rank_id == 0) {
|
||||
if(tableExist('guild_membership')) {
|
||||
$this->db->query('DELETE FROM `guild_membership` WHERE `player_id` = ' . $this->getId());
|
||||
}
|
||||
else if(tableExist('guild_members')) {
|
||||
$this->db->query('DELETE FROM `guild_members` WHERE `player_id` = ' . $this->getId());
|
||||
}
|
||||
else {
|
||||
$this->data['rank_id'] = 0;
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(tableExist('guild_membership')) {
|
||||
$query = $this->db->query('SELECT `player_id` FROM `guild_membership` WHERE `player_id` = ' . $this->getId() . ' LIMIT 1;');
|
||||
@@ -1779,6 +1873,14 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$this->db->query('INSERT INTO `guild_membership` (`player_id`, `guild_id`, `rank_id`, `nick`) VALUES (' . $this->db->quote($this->getId()) . ', ' . $this->db->quote($guild) . ', ' . $this->db->quote($rank_id) . ', ' . $this->db->quote('') . ')');
|
||||
}
|
||||
}
|
||||
else if(tableExist('guild_members')) {
|
||||
$query = $this->db->query('SELECT `player_id` FROM `guild_members` WHERE `player_id` = ' . $this->getId() . ' LIMIT 1;');
|
||||
if($query->rowCount() == 1)
|
||||
$this->db->query('UPDATE `guild_members` SET `rank_id` = ' . (int)$rank_id . ' WHERE `player_id` = ' . $this->getId());
|
||||
else {
|
||||
$this->db->query('INSERT INTO `guild_members` (`player_id`, `rank_id`, `nick`) VALUES (' . $this->db->quote($this->getId()) . ', ' . $this->db->quote($rank_id) . ', ' . $this->db->quote('') . ')');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->data['rank_id'] = (int) $rank_id;
|
||||
$this->save();
|
||||
@@ -1975,6 +2077,20 @@ class OTS_Player extends OTS_Row_DAO
|
||||
$this->data['loss_items'] = (int) $loss_items;
|
||||
}
|
||||
|
||||
public function getLossContainers()
|
||||
{
|
||||
if( !isset($this->data['loss_containers']) )
|
||||
{
|
||||
throw new E_OTS_NotLoaded();
|
||||
}
|
||||
|
||||
return $this->data['loss_items'];
|
||||
}
|
||||
public function setLossContainers($loss_containers)
|
||||
{
|
||||
$this->data['loss_containers'] = (int) $loss_containers;
|
||||
}
|
||||
|
||||
public function getBlessings()
|
||||
{
|
||||
if( !isset($this->data['blessings']) )
|
||||
@@ -3086,6 +3202,9 @@ class OTS_Player extends OTS_Row_DAO
|
||||
case 'lossItems':
|
||||
return $this->getLossItems();
|
||||
|
||||
case 'lossContainers':
|
||||
return $this->getLossContainers();
|
||||
|
||||
case 'balance':
|
||||
return $this->getBalance();
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -14,6 +14,9 @@ $locale['next'] = 'Next';
|
||||
$locale['on'] = 'On';
|
||||
$locale['off'] = 'Off';
|
||||
|
||||
$locale['loaded'] = 'Loaded';
|
||||
$locale['not_loaded'] = 'Not loaded';
|
||||
|
||||
$locale['please_fill_all'] = 'Please fill all inputs!';
|
||||
$locale['already_installed'] = 'MyAAC has been already installed. Please delete <b>install/<b/> directory.';
|
||||
|
||||
@@ -32,16 +35,13 @@ $locale['step_requirements_title'] = 'Requirements check';
|
||||
$locale['step_requirements_php_version'] = 'PHP Version';
|
||||
$locale['step_requirements_write_perms'] = 'Write permissions';
|
||||
$locale['step_requirements_failed'] = 'Installation will be disabled until these requirements will be passed.</b><br/>For more informations see <b>README</b> file.';
|
||||
$locale['step_requirements_extension'] = '$EXTENSION$ PHP extension';
|
||||
|
||||
// config
|
||||
$locale['step_config'] = 'Configuration';
|
||||
$locale['step_config_title'] = 'Basic configuration';
|
||||
$locale['step_config_server_path'] = 'Server path';
|
||||
$locale['step_config_server_path_desc'] = 'Path to your TFS main directory, where you have config.lua located.';
|
||||
$locale['step_config_account'] = 'Admin account name';
|
||||
$locale['step_config_account_desc'] = 'Name of your admin account, which will be used to login to website and server.';
|
||||
$locale['step_config_password'] = 'Admin account password';
|
||||
$locale['step_config_password_desc'] = 'Password to your admin account.';
|
||||
|
||||
$locale['step_config_mail_admin'] = 'Admin E-Mail';
|
||||
$locale['step_config_mail_admin_desc'] = 'Address where emails from contact form will be delivered, for example <i>admin@gmail.com</i>';
|
||||
@@ -58,8 +58,9 @@ $locale['step_database_title'] = 'Import MySQL schema';
|
||||
$locale['step_database_importing'] = 'Your database is MySQL. Importing schema now...';
|
||||
$locale['step_database_error_path'] = 'Please specify server path.';
|
||||
$locale['step_database_error_config'] = 'Cannot find config file. Is your server path correct? Go back and check again.';
|
||||
$locale['step_database_error_database_empty'] = 'Cannot determine database type from config.lua. Your OTS is unsupported by this AAC.';
|
||||
$locale['step_database_error_only_mysql'] = 'This AAC supports only MySQL. From your config file it seems that your OTS is using: $DATABASE_TYPE$ database. Please change your database to MySQL and then follow the installation again.';
|
||||
$locale['step_database_error_table'] = 'Table $TABLE$ doesn\'t exist. Please import your OTS database first.';
|
||||
$locale['step_database_error_table'] = 'Table $TABLE$ doesn\'t exist. Please import your OTS database schema first.';
|
||||
$locale['step_database_error_table_exist'] = 'Table $TABLE$ already exist. Seems AAC is already installed. Skipping importing MySQL schema..';
|
||||
$locale['step_database_error_schema'] = 'Error while importing schema:';
|
||||
$locale['step_database_success_schema'] = 'Succesfully installed $PREFIX$ tables.';
|
||||
@@ -70,6 +71,16 @@ $locale['step_database_changing_field'] = 'Changing $FIELD$ to $FIELD_NEW$...';
|
||||
$locale['step_database_imported_players'] = 'Imported player samples...';
|
||||
$locale['step_database_created_account'] = 'Created admin account...';
|
||||
|
||||
// admin account
|
||||
$locale['step_admin'] = 'Admin Account';
|
||||
$locale['step_admin_title'] = 'Create Admin Account';
|
||||
$locale['step_admin_account'] = 'Admin account name';
|
||||
$locale['step_admin_account_desc'] = 'Name of your admin account, which will be used to login to website and server.';
|
||||
$locale['step_admin_account_id'] = 'Admin account id';
|
||||
$locale['step_admin_account_id_desc'] = 'ID of your admin account, which will be used to login to website and server.';
|
||||
$locale['step_admin_password'] = 'Admin account password';
|
||||
$locale['step_admin_password_desc'] = 'Password to your admin account.';
|
||||
|
||||
// finish
|
||||
$locale['step_finish_admin_panel'] = 'Admin Panel';
|
||||
$locale['step_finish_homepage'] = 'homepage';
|
||||
|
@@ -14,6 +14,9 @@ $locale['next'] = 'Następny';
|
||||
$locale['on'] = 'Włączone';
|
||||
$locale['off'] = 'Wyłączone';
|
||||
|
||||
$locale['loaded'] = 'Załadowane';
|
||||
$locale['not_loaded'] = 'Nie załadowane';
|
||||
|
||||
$locale['please_fill_all'] = 'Proszę wypełnić wszystkie pola!';
|
||||
$locale['already_installed'] = 'MyAAC został już zainstalowany. Proszę usunąć katalog <b>install/</b>.';
|
||||
|
||||
@@ -32,6 +35,7 @@ $locale['step_requirements_title'] = 'Sprawdzanie wymagań';
|
||||
$locale['step_requirements_php_version'] = 'Wersja PHP';
|
||||
$locale['step_requirements_write_perms'] = 'Uprawnienia do zapisu';
|
||||
$locale['step_requirements_failed'] = 'Instalacja zostanie zablokowana dopóki te wymagania nie zostaną spełnione.</b><br/>Po więcej informacji zasięgnij do pliku <b>README</b>.';
|
||||
$locale['step_requirements_extension'] = 'Rozszerzenie PHP - $EXTENSION$';
|
||||
|
||||
// config
|
||||
$locale['step_config'] = 'Konfiguracja';
|
||||
@@ -59,7 +63,7 @@ $locale['step_database_importing'] = 'Twoja baza to MySQL. Importowanie schematu
|
||||
$locale['step_database_error_path'] = 'Proszę podać ścieżkę do serwera.';
|
||||
$locale['step_database_error_config'] = 'Nie można znaleźć pliku config. Jest Twoja ścieżka do katalogu serwera poprawna? Wróć się i sprawdź ponownie.';
|
||||
$locale['step_database_error_only_mysql'] = 'Ten AAC wspiera tylko bazy danych MySQL. Z Twojego pliku config wynika, że Twój serwera używa bazy: $DATABASE_TYPE$. Proszę zmienić typ bazy na MySQL i ponownie przystąpić do instalacji.';
|
||||
$locale['step_database_error_table'] = 'Tabela $TABLE$ nie istnieje. Proszę najpierw zaimportować bazę danych serwera OTS.';
|
||||
$locale['step_database_error_table'] = 'Tabela $TABLE$ nie istnieje. Proszę najpierw zaimportować schemat bazy danych serwera OTS.';
|
||||
$locale['step_database_error_table_exist'] = 'Tabela $TABLE$ już istnieje. Wygląda na to, że AAC został już zainstalowany. Schemat MySQL nie zostanie zaimportowany..';
|
||||
$locale['step_database_error_schema'] = 'Błąd podczas importowania struktury bazy danych:';
|
||||
$locale['step_database_success_schema'] = 'Pomyślnie zainstalowano tabele $PREFIX$.';
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -58,7 +58,10 @@ else
|
||||
}
|
||||
|
||||
$account_logged = $ots->createObject('Account');
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$account_logged->find($login_account);
|
||||
else
|
||||
$account_logged->load($login_account);
|
||||
|
||||
$config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
if($account_logged->isLoaded() && encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password) == $account_logged->getPassword()
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -80,7 +80,7 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors[0]) ? ' class="red"' : ''); ?>>Account Name:</span>
|
||||
<span<?php echo (isset($errors[0]) ? ' class="red"' : ''); ?>>Account <?php echo (USE_ACCOUNT_NAME ? 'Name' : 'Number'); ?>:</span>
|
||||
</td>
|
||||
<td style="width:100%;" ><input type="password" name="account_login" id="account-name-input" size="30" maxlength="30" ></td>
|
||||
</tr>
|
||||
@@ -132,7 +132,7 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
|
||||
|
||||
if(isset($_REQUEST['redirect']))
|
||||
{
|
||||
$redirect = urldecode(trim($_REQUEST['redirect']));
|
||||
$redirect = urldecode($_REQUEST['redirect']);
|
||||
?>
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
@@ -833,8 +833,9 @@ function checkName()
|
||||
|
||||
if(empty($newchar_errors))
|
||||
{
|
||||
if(!check_name_new_char($newchar_name))
|
||||
$newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
|
||||
$error = '';
|
||||
if(!check_name_new_char($newchar_name, $error))
|
||||
$newchar_errors[] = $error;
|
||||
if($newchar_sex != 1 && $newchar_sex != "0")
|
||||
$newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
|
||||
if(!in_array($newchar_town, $config['character_towns']))
|
||||
@@ -886,10 +887,18 @@ function checkName()
|
||||
if(fieldExist('promotion', 'players'))
|
||||
$player->setPromotion($char_to_copy->getPromotion());
|
||||
|
||||
if(fieldExist('direction', 'players'))
|
||||
$player->setDirection($char_to_copy->getDirection());
|
||||
|
||||
$player->setConditions($char_to_copy->getConditions());
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
$rank = $char_to_copy->getRank();
|
||||
if($rank->isLoaded()) {
|
||||
$player->setRank($char_to_copy->getRank());
|
||||
}
|
||||
|
||||
if(fieldExist('lookaddons', 'players'))
|
||||
$player->setLookAddons($char_to_copy->getLookAddons());
|
||||
|
||||
$player->setTownId($newchar_town);
|
||||
$player->setExperience($char_to_copy->getExperience());
|
||||
$player->setLevel($char_to_copy->getLevel());
|
||||
@@ -900,8 +909,6 @@ function checkName()
|
||||
$player->setManaMax($char_to_copy->getManaMax());
|
||||
$player->setManaSpent($char_to_copy->getManaSpent());
|
||||
$player->setSoul($char_to_copy->getSoul());
|
||||
if(fieldExist('direction', 'players'))
|
||||
$player->setDirection($char_to_copy->getDirection());
|
||||
|
||||
$player->setLookBody($char_to_copy->getLookBody());
|
||||
$player->setLookFeet($char_to_copy->getLookFeet());
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,14 +5,14 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Changelog';
|
||||
|
||||
$_page = $_GET['page'];
|
||||
$id = $_GET['id'];
|
||||
$_page = isset($_GET['page']) ? $_GET['page'] : 0;
|
||||
$id = isset($_GET['id']) ? $_GET['id'] : 0;
|
||||
$limit = 30;
|
||||
$offset = $_page * $limit;
|
||||
?>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -227,6 +227,8 @@ if(check_name($name))
|
||||
$town_field = 'town';
|
||||
if(fieldExist('town_id', 'houses'))
|
||||
$town_field = 'town_id';
|
||||
else if(fieldExist('townid', 'houses'))
|
||||
$town_field = 'townid';
|
||||
|
||||
$house = $db->query('SELECT `id`, `paid`, `name`, `' . $town_field . '` FROM `houses` WHERE `owner` = '.$player->getId())->fetch();
|
||||
if(isset($house['id']))
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -24,17 +24,28 @@ if($logged)
|
||||
$step = isset($_POST['step']) ? $_POST['step'] : '';
|
||||
if($step == 'save')
|
||||
{
|
||||
$account_name = $_POST['account_name'];
|
||||
if(USE_ACCOUNT_NAME) {
|
||||
$account_name = $_POST['account'];
|
||||
$account_name_up = strtoupper($account_name);
|
||||
}
|
||||
else
|
||||
$account_id = $_POST['account'];
|
||||
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
$password2 = $_POST['password2'];
|
||||
|
||||
// account
|
||||
if(isset($account_id)) {
|
||||
if(!check_number($account_id))
|
||||
$errors['account'] = 'Invalid account number format. Please use only numbers 0-9.';
|
||||
}
|
||||
else {
|
||||
if(empty($account_name))
|
||||
$errors['account_name'] = 'Please enter your account name!';
|
||||
$errors['account'] = 'Please enter your account name!';
|
||||
elseif(!check_account_name($account_name_up))
|
||||
$errors['account_name'] = 'Invalid account name format. Please use only A-Z and numbers 0-9.';
|
||||
$errors['account'] = 'Invalid account name format. Please use only A-Z and numbers 0-9.';
|
||||
}
|
||||
|
||||
// email
|
||||
if(empty($email))
|
||||
@@ -81,7 +92,7 @@ if($step == 'save')
|
||||
}
|
||||
|
||||
// check if account name is not equal to password
|
||||
if($account_name_up == strtoupper($password))
|
||||
if(USE_ACCOUNT_NAME && $account_name_up == strtoupper($password))
|
||||
{
|
||||
$errors['password'] = 'Password may not be the same as account name.';
|
||||
}
|
||||
@@ -97,9 +108,17 @@ if($step == 'save')
|
||||
}
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$account_db->find($account_name);
|
||||
if($account_db->isLoaded())
|
||||
$errors['account_name'] = 'Account with this name already exist.';
|
||||
else
|
||||
$account_db->load($account_id);
|
||||
|
||||
if($account_db->isLoaded()) {
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$errors['account'] = 'Account with this name already exist.';
|
||||
else
|
||||
$errors['account'] = 'Account with this id already exist.';
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($_POST['accept_rules']) || $_POST['accept_rules'] != 'true')
|
||||
@@ -108,7 +127,10 @@ if($step == 'save')
|
||||
if(empty($errors))
|
||||
{
|
||||
$new_account = $ots->createObject('Account');
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$new_account->create($account_name);
|
||||
else
|
||||
$new_account->create(NULL, $account_id);
|
||||
|
||||
$config_salt_enabled = fieldExist('salt', 'accounts');
|
||||
if($config_salt_enabled)
|
||||
@@ -138,6 +160,7 @@ if($step == 'save')
|
||||
$new_account->setCustomField('premium_points', $config['account_premium_points']);
|
||||
}
|
||||
|
||||
$tmp_account = (USE_ACCOUNT_NAME ? $account_name : $account_id);
|
||||
if($config['mail_enabled'] && $config['account_mail_verify'])
|
||||
{
|
||||
$hash = md5(generateRandomString(16, true, true) . $email);
|
||||
@@ -145,12 +168,13 @@ if($step == 'save')
|
||||
|
||||
$verify_url = BASE_URL . '?p=account&action=confirm_email&v=' . $hash;
|
||||
$server_name = $config['lua']['serverName'];
|
||||
|
||||
$body_plain = "Hello!
|
||||
|
||||
Thank you for registering on $server_name!
|
||||
|
||||
Here are the details of your account:
|
||||
Name: $account_name
|
||||
Account" . (USE_ACCOUNT_NAME ? ' Name' : '') . ": $tmp_account
|
||||
Password: ************ (hidden for security reasons)
|
||||
|
||||
To verify your email address please click the link below:
|
||||
@@ -162,7 +186,7 @@ If you haven't registered on $server_name please ignore this email.";
|
||||
Thank you for registering on ' . $config['lua']['serverName'] . '!<br/>
|
||||
<br/>
|
||||
Here are the details of your account:<br/>
|
||||
Name: ' . $account_name . '<br/>
|
||||
Account' . (USE_ACCOUNT_NAME ? ' Name' : '') . ': ' . $tmp_account . '<br/>
|
||||
Password: ************ (hidden for security reasons)<br/>
|
||||
<br/>
|
||||
To verify your email address please click the link below:<br/>
|
||||
@@ -177,11 +201,11 @@ If you haven\'t registered on ' . $config['lua']['serverName'] . ' please ignore
|
||||
<tr><td bgcolor="<?php echo $config['vdarkborder']; ?>" class="white"><b>Account Created</b></td></tr>
|
||||
<tr><td bgcolor="<?php echo $config['darkborder']; ?>'">
|
||||
<table border="0" cellpadding="1"><tr><td>
|
||||
<br/>Your account name is <b><?php echo $account_name; ?></b>.
|
||||
<br/>Your account<?php (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> is <b><?php echo $tmp_account; ?></b>.
|
||||
|
||||
You will need the account name and your password to play on <?php echo $config['lua']['serverName']; ?>.
|
||||
Please keep your account name and password in a safe place and
|
||||
never give your account name or password to anybody.<br/><br/>
|
||||
You will need the account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> and your password to play on <?php echo $config['lua']['serverName']; ?>.
|
||||
Please keep your account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> and password in a safe place and
|
||||
never give your account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> or password to anybody.<br/><br/>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
@@ -197,23 +221,23 @@ If you haven\'t registered on ' . $config['lua']['serverName'] . ' please ignore
|
||||
<TR><TD BGCOLOR="'.$config['vdarkborder'].'" class="white"><B>Account Created</B></TD></TR>
|
||||
<TR><TD BGCOLOR="'.$config['darkborder'].'">
|
||||
<TABLE BORDER=0 CELLPADDING=1><TR><TD>
|
||||
<br/>Your account name is <b>'.$account_name.'</b><br/>You will need the account name and your password to play on '.$config['lua']['serverName'].'.
|
||||
Please keep your account name and password in a safe place and
|
||||
never give your account name or password to anybody.<br/><br/>';
|
||||
<br/>Your account ' . (USE_ACCOUNT_NAME ? 'name' : 'number') . ' is <b>'.$tmp_account.'</b><br/>You will need the account ' . (USE_ACCOUNT_NAME ? 'name' : 'number') . ' and your password to play on '.$config['lua']['serverName'].'.
|
||||
Please keep your account ' . (USE_ACCOUNT_NAME ? 'name' : 'number') . ' and password in a safe place and
|
||||
never give your account ' . (USE_ACCOUNT_NAME ? 'name' : 'number') . ' or password to anybody.<br/><br/>';
|
||||
|
||||
if($config['mail_enabled'] && $config['account_welcome_mail'])
|
||||
{
|
||||
$mailBody = '
|
||||
<h3>Dear player,</h3>
|
||||
<p>Thanks for your registration at <a href=" ' . BASE_URL . '"><b>'.$config['lua']['serverName'].'</b></a></p>
|
||||
<p>Thanks for your registration at <a href=" ' . BASE_URL . '"><b>' . $config['lua']['serverName'] . '</b></a></p>
|
||||
<br/><br/>
|
||||
Your login details:
|
||||
<p>Account name: <b>' . $account_name . '</b></p>
|
||||
<p>Account' . (USE_ACCOUNT_NAME ? ' name' : '') . ': <b>' . $tmp_account . '</b></p>
|
||||
<p>Password: <b>' . str_repeat('*', strlen(trim($password))) . '</b> (hidden for security reasons)</p>
|
||||
<p>Kind Regards,</p>';
|
||||
|
||||
if(_mail($email, 'Your account on ' . $config['lua']['serverName'], $mailBody))
|
||||
echo '<br /><small>These informations were send on email address <b>'.$email.'</b>.';
|
||||
echo '<br /><small>These informations were send on email address <b>' . $email . '</b>.';
|
||||
else
|
||||
echo '<br /><p class="error">An error occorred while sending email (<b>' . $email . '</b>)! Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
||||
}
|
||||
@@ -241,9 +265,9 @@ function checkAccount()
|
||||
eventId = 0;
|
||||
}
|
||||
|
||||
if(document.getElementById("account_name").value == "")
|
||||
if(document.getElementById("account_input").value == "")
|
||||
{
|
||||
document.getElementById("acc_name_check").innerHTML = '<b><font color="red">Please enter account name.</font></b>';
|
||||
document.getElementById("acc_check").innerHTML = '<b><font color="red">Please enter account<?php echo (USE_ACCOUNT_NAME ? ' name' : ''); ?>.</font></b>';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,10 +284,10 @@ function checkAccount()
|
||||
}
|
||||
}
|
||||
|
||||
account = document.getElementById("account_name").value;
|
||||
account = document.getElementById("account_input").value;
|
||||
$.get("tools/validate.php", { account: account, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("acc_name_check").innerHTML = data;
|
||||
document.getElementById("acc_check").innerHTML = data;
|
||||
lastSend = timeNow;
|
||||
});
|
||||
}
|
||||
@@ -296,7 +320,6 @@ function checkEmail()
|
||||
}
|
||||
|
||||
email = document.getElementById("email").value;
|
||||
account = document.getElementById("account_name").value;
|
||||
$.get("tools/validate.php", { email: email, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("email_check").innerHTML = data;
|
||||
@@ -338,8 +361,8 @@ function validate_form(thisform)
|
||||
{
|
||||
with (thisform)
|
||||
{
|
||||
if (validate_required(account_name,"Please enter name of new account!")==false)
|
||||
{account_name.focus();return false;}
|
||||
if (validate_required(account_input,"Please enter name of new account!")==false)
|
||||
{account_input.focus();return false;}
|
||||
if (validate_required(email,"Please enter your e-mail!")==false)
|
||||
{email.focus();return false;}
|
||||
if (validate_email(email,"Invalid e-mail format!")==false)
|
||||
@@ -362,11 +385,11 @@ function validate_form(thisform)
|
||||
output_errors($errors);
|
||||
?>
|
||||
To play on <?php echo $config['lua']['serverName']; ?> you need an account.
|
||||
All you have to do to create your new account is to enter an account name, password<?php
|
||||
All you have to do to create your new account is to enter an account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?>, password<?php
|
||||
if($config['recaptcha_enabled']) echo ', confirm reCAPTCHA';
|
||||
if($config['account_country']) echo ', country';
|
||||
?> and your email address.
|
||||
Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.<br/><br/>
|
||||
Also you have to agree to the terms presented below. If you have done so, your account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.<br/><br/>
|
||||
<form action="?subtopic=createaccount" method="post" >
|
||||
<div class="TableContainer" >
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
@@ -389,14 +412,14 @@ Also you have to agree to the terms presented below. If you have done so, your a
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['account_name'][0]) ? ' class="red"' : ''); ?>>Account Name:</span>
|
||||
<span<?php echo (isset($errors['account'][0]) ? ' class="red"' : ''); ?>>Account <?php echo (USE_ACCOUNT_NAME ? 'Name' : 'Number'); ?>:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="account_name" id="account_name" onkeyup="checkAccount();" id="account-name-input" size="30" maxlength="30" value="<?php echo (isset($_POST['account_name']) ? $_POST['account_name'] : ''); ?>" />
|
||||
<small id="acc_name_check"></small>
|
||||
<input type="text" name="account" id="account_input" onkeyup="checkAccount();" size="30" maxlength="<?php echo (USE_ACCOUNT_NAME ? '30' : '10'); ?>" value="<?php echo (isset($_POST['account']) ? $_POST['account'] : ''); ?>" />
|
||||
<small id="acc_check"></small>
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('account_name'); ?>
|
||||
<?php write_if_error('account'); ?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['email'][0]) ? ' class="red"' : ''); ?>>Email Address:</span>
|
||||
@@ -522,7 +545,7 @@ Also you have to agree to the terms presented below. If you have done so, your a
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#account-name-input').focus();
|
||||
$('#account_input').focus();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
$title = 'Downloads';
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -16,12 +16,14 @@ if(!isset($config['lua']['experienceStages']) || !getBoolean($config['lua']['exp
|
||||
{
|
||||
$enabled = false;
|
||||
|
||||
if(file_exists($config['data_path'] . 'XML/stages.xml')) {
|
||||
$stages = new DOMDocument();
|
||||
$stages->load($config['data_path'] . 'XML/stages.xml');
|
||||
foreach($stages->getElementsByTagName('config') as $node) {
|
||||
if($node->getAttribute('enabled'))
|
||||
$enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$enabled) {
|
||||
$rate_exp = 'not set';
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -138,7 +138,7 @@ if(empty($action))
|
||||
foreach($sections as $id => $section)
|
||||
{
|
||||
$last_post = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`section` = ".(int) $id." AND `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 1")->fetch();
|
||||
echo '<tr bgcolor="'.getStyle(++$number_of_rows).'"><td><a href="?subtopic=forum&action=show_board&id='.$id.'">'.$section['name'].'</a><br /><small>'.$section['description'].'</small></td><td>'.(int) (isset($counters[$id]['posts']) ? $counters[$id]['posts'] : 0).'</td><td>'.(int) (isset($counters[$id]['threads']) ? $counters[$id]['threads'] : 0).'</td><td>';
|
||||
echo '<tr bgcolor="'.getStyle(++$number_of_rows).'"><td><a href="' . getForumBoardLink($id) . '">'.$section['name'].'</a><br /><small>'.$section['description'].'</small></td><td>'.(int) (isset($counters[$id]['posts']) ? $counters[$id]['posts'] : 0).'</td><td>'.(int) (isset($counters[$id]['threads']) ? $counters[$id]['threads'] : 0).'</td><td>';
|
||||
if(isset($last_post['name']))
|
||||
echo date('d.m.y H:i:s', $last_post['post_date']).'<br />by ' . getPlayerLink($last_post['name']);
|
||||
else
|
||||
@@ -158,11 +158,11 @@ if($action == 'show_board')
|
||||
for($i = 0; $i < $threads_count['threads_count'] / $config['forum_threads_per_page']; $i++)
|
||||
{
|
||||
if($i != $_page)
|
||||
$links_to_pages .= '<a href="?subtopic=forum&action=show_board&id='.$section_id.'&page='.$i.'">'.($i + 1).'</a> ';
|
||||
$links_to_pages .= '<a href="' . getForumBoardLink($section_id, $i) . '">'.($i + 1).'</a> ';
|
||||
else
|
||||
$links_to_pages .= '<b>'.($i + 1).' </b>';
|
||||
}
|
||||
echo '<a href="?subtopic=forum">Boards</a> >> <b>'.$sections[$section_id]['name'].'</b>';
|
||||
echo '<a href="' . getPageLink('forum') . '">Boards</a> >> <b>'.$sections[$section_id]['name'].'</b>';
|
||||
if(!$sections[$section_id]['closed'] || Forum::isModerator())
|
||||
{
|
||||
echo '<br /><br />
|
||||
@@ -182,7 +182,7 @@ if($action == 'show_board')
|
||||
echo '<a href="?subtopic=forum&action=move_thread&id='.$thread['id'].'"\')"><span style="color:darkgreen">[MOVE]</span></a>';
|
||||
echo '<a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove thread > '.$thread['post_topic'].' <?\')"><font color="red">[REMOVE]</font></a> ';
|
||||
}
|
||||
echo '<a href="?subtopic=forum&action=show_thread&id='.$thread['id'].'">'.htmlspecialchars($thread['post_topic']).'</a><br /><small>'.htmlspecialchars(substr($thread['post_text'], 0, 50)).'...</small></td><td>' . getPlayerLink($thread['name']) . '</td><td>'.(int) $thread['replies'].'</td><td>'.(int) $thread['views'].'</td><td>';
|
||||
echo '<a href="' . getForumThreadLink($thread['id']) . '">'.htmlspecialchars($thread['post_topic']).'</a><br /><small>'.htmlspecialchars(substr($thread['post_text'], 0, 50)).'...</small></td><td>' . getPlayerLink($thread['name']) . '</td><td>'.(int) $thread['replies'].'</td><td>'.(int) $thread['views'].'</td><td>';
|
||||
if($thread['last_post'] > 0)
|
||||
{
|
||||
$last_post = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['id']." AND `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` ORDER BY `post_date` DESC LIMIT 1")->fetch();
|
||||
@@ -214,14 +214,14 @@ if($action == 'show_thread')
|
||||
for($i = 0; $i < $posts_count['posts_count'] / $config['forum_threads_per_page']; $i++)
|
||||
{
|
||||
if($i != $_page)
|
||||
$links_to_pages .= '<a href="?subtopic=forum&action=show_thread&id='.$thread_id.'&page='.$i.'">'.($i + 1).'</a> ';
|
||||
$links_to_pages .= '<a href="' . getForumThreadLink($thread_id, $i) . '">'.($i + 1).'</a> ';
|
||||
else
|
||||
$links_to_pages .= '<b>'.($i + 1).' </b>';
|
||||
}
|
||||
$threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `players`.`account_id`, `players`.`vocation`" . (fieldExist('promotion', 'players') ? ", `players`.`promotion`" : "") . ", `players`.`level`, `" . TABLE_PREFIX . "forum`.`id`,`" . TABLE_PREFIX . "forum`.`first_post`, `" . TABLE_PREFIX . "forum`.`section`,`" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_date`, `" . TABLE_PREFIX . "forum`.`post_smile`, `" . TABLE_PREFIX . "forum`.`author_aid`, `" . TABLE_PREFIX . "forum`.`author_guid`, `" . TABLE_PREFIX . "forum`.`last_edit_aid`, `" . TABLE_PREFIX . "forum`.`edit_date` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." ORDER BY `" . TABLE_PREFIX . "forum`.`post_date` LIMIT ".$config['forum_posts_per_page']." OFFSET ".($_page * $config['forum_posts_per_page']))->fetchAll();
|
||||
if(isset($threads[0]['name']))
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `views`=`views`+1 WHERE `id` = ".(int) $thread_id);
|
||||
echo '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id='.$threads[0]['section'].'">'.$sections[$threads[0]['section']]['name'].'</a> >> <b>'.$thread_name['post_topic'].'</b>';
|
||||
echo '<a href="' . getPageLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($threads[0]['section']) . '">'.$sections[$threads[0]['section']]['name'].'</a> >> <b>'.$thread_name['post_topic'].'</b>';
|
||||
echo '<br /><br /><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"><img src="images/forum/post.gif" border="0" /></a><br /><br />Page: '.$links_to_pages.'<br /><table width="100%"><tr bgcolor="'.$config['lightborder'].'" width="100%"><td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1"><br />by ' . getPlayerLink($thread_name['name']) . '</font></td></tr><tr bgcolor="'.$config['vdarkborder'].'"><td width="200"><font color="white" size="1"><b>Author</b></font></td><td> </td></tr>';
|
||||
$player = $ots->createObject('Player');
|
||||
foreach($threads as $thread)
|
||||
@@ -296,14 +296,14 @@ if($action == 'remove_post')
|
||||
if($post['id'] == $post['first_post'])
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PREFIX . "forum` WHERE `first_post` = ".$post['id']);
|
||||
header('Location: ?subtopic=forum&action=show_board&id='.$post['section']);
|
||||
header('Location: ' . getForumBoardLink($post['section']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_page = $db->query("SELECT COUNT(`" . TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`id` < ".$id." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $post['first_post'])->fetch();
|
||||
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
||||
$db->query("DELETE FROM `" . TABLE_PREFIX . "forum` WHERE `id` = ".$post['id']);
|
||||
header('Location: ?subtopic=forum&action=show_thread&id='.$post['first_post'].'&page='.(int) $_page);
|
||||
header('Location: ' . getForumThreadLink($post['first_post'], (int) $_page));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -319,7 +319,7 @@ if($action == 'new_post')
|
||||
$players_from_account = $db->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
|
||||
$thread_id = (int) $_REQUEST['thread_id'];
|
||||
$thread = $db->query("SELECT `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`id`, `" . TABLE_PREFIX . "forum`.`section` FROM `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`id` = ".(int) $thread_id." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." LIMIT 1")->fetch();
|
||||
echo '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id='.$thread['section'].'">'.$sections[$thread['section']]['name'].'</a> >> <a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">'.$thread['post_topic'].'</a> >> <b>Post new reply</b><br /><h3>'.$thread['post_topic'].'</h3>';
|
||||
echo '<a href="' . getPageLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.$sections[$thread['section']]['name'].'</a> >> <a href="' . getForumThreadLink($thread_id) . '">'.$thread['post_topic'].'</a> >> <b>Post new reply</b><br /><h3>'.$thread['post_topic'].'</h3>';
|
||||
if(isset($thread['id']))
|
||||
{
|
||||
$quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL;
|
||||
@@ -374,8 +374,8 @@ if($action == 'new_post')
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `replies`=`replies`+1, `last_post`=".time()." WHERE `id` = ".(int) $thread_id);
|
||||
$post_page = $db->query("SELECT COUNT(`" . TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`post_date` <= ".time()." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['id'])->fetch();
|
||||
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
||||
header('Location: ?subtopic=forum&action=show_thread&id='.$thread_id.'&page='.$_page);
|
||||
echo '<br />Thank you for posting.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">GO BACK TO LAST THREAD</a>';
|
||||
header('Location: ' . getForumThreadLink($thread_id, $_page));
|
||||
echo '<br />Thank you for posting.<br /><a href="' . getForumThreadLink($thread_id, $_page) . '">GO BACK TO LAST THREAD</a>';
|
||||
}
|
||||
}
|
||||
if(!$saved)
|
||||
@@ -435,7 +435,7 @@ if($action == 'edit_post')
|
||||
if(isset($thread['id']))
|
||||
{
|
||||
$first_post = $db->query("SELECT `" . TABLE_PREFIX . "forum`.`author_guid`, `" . TABLE_PREFIX . "forum`.`author_aid`, `" . TABLE_PREFIX . "forum`.`first_post`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_smile`, `" . TABLE_PREFIX . "forum`.`id`, `" . TABLE_PREFIX . "forum`.`section` FROM `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`id` = ".(int) $thread['first_post']." LIMIT 1")->fetch();
|
||||
echo '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id='.$thread['section'].'">'.$sections[$thread['section']]['name'].'</a> >> <a href="?subtopic=forum&action=show_thread&id='.$thread['first_post'].'">'.$first_post['post_topic'].'</a> >> <b>Edit post</b>';
|
||||
echo '<a href="' . getPageLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.$sections[$thread['section']]['name'].'</a> >> <a href="' . getForumThreadLink($thread['first_post']) . '">'.$first_post['post_topic'].'</a> >> <b>Edit post</b>';
|
||||
if($account_logged->getId() == $thread['author_aid'] || Forum::isModerator())
|
||||
{
|
||||
$players_from_account = $db->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
|
||||
@@ -483,8 +483,8 @@ if($action == 'edit_post')
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `author_guid` = ".(int) $char_id.", `post_text` = ".$db->quote($text).", `post_topic` = ".$db->quote($post_topic).", `post_smile` = ".(int) $smile.", `last_edit_aid` = ".(int) $account_logged->getId().",`edit_date` = ".time()." WHERE `id` = ".(int) $thread['id']);
|
||||
$post_page = $db->query("SELECT COUNT(`" . TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`post_date` <= ".$thread['post_date']." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['first_post'])->fetch();
|
||||
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
||||
header('Location: ?subtopic=forum&action=show_thread&id='.$thread['first_post'].'&page='.$_page);
|
||||
echo '<br />Thank you for editing post.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread['first_post'].'">GO BACK TO LAST THREAD</a>';
|
||||
header('Location: ' . getForumThreadLink($thread['first_post'], $_page));
|
||||
echo '<br />Thank you for editing post.<br /><a href="' . getForumThreadLink($thread['first_post'], $_page) . '">GO BACK TO LAST THREAD</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -531,7 +531,7 @@ if($action == 'new_topic')
|
||||
{
|
||||
$players_from_account = $db->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
|
||||
$section_id = (int) $_REQUEST['section_id'];
|
||||
echo '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id='.$section_id.'">'.$sections[$section_id]['name'].'</a> >> <b>Post new thread</b><br />';
|
||||
echo '<a href="' . getPageLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($section_id) . '">'.$sections[$section_id]['name'].'</a> >> <b>Post new thread</b><br />';
|
||||
if(isset($sections[$section_id]['name']))
|
||||
{
|
||||
if($sections[$section_id]['closed'] && !Forum::isModerator())
|
||||
@@ -590,8 +590,8 @@ if($action == 'new_topic')
|
||||
$db->query("INSERT INTO `" . TABLE_PREFIX . "forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('null', '0', '".time()."', '".(int) $section_id."', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$db->quote($text).", ".$db->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."')");
|
||||
$thread_id = $db->lastInsertId();
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);
|
||||
header('Location: ?subtopic=forum&action=show_thread&id='.$thread_id);
|
||||
echo '<br />Thank you for posting.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">GO BACK TO LAST THREAD</a>';
|
||||
header('Location: ' . getForumThreadLink($thread_id));
|
||||
echo '<br />Thank you for posting.<br /><a href="' . getForumThreadLink($thread_id) . '">GO BACK TO LAST THREAD</a>';
|
||||
}
|
||||
}
|
||||
if(!$saved)
|
||||
@@ -648,7 +648,7 @@ if($action == 'move_thread')
|
||||
<br/><strong>Select the new board: </strong><SELECT NAME=sektion>';
|
||||
foreach($sections as $id => $section) { echo '<OPTION value="'.$id.'">'.$section['name'].'</OPTION>'; } echo '</SELECT>
|
||||
<INPUT TYPE="submit" VALUE="Move Thread"></FORM>
|
||||
<form action="?subtopic=forum&action=show_board&id='.$post['section'].'" method="POST">
|
||||
<form action="' . getForumBoardLink($post['section']) . '" method="POST">
|
||||
<input type="submit" value="Cancel"></form></td></tr></table></td></tr></table>';
|
||||
}
|
||||
}
|
||||
@@ -672,7 +672,7 @@ if($action == 'moved_thread')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `section` = ".$board." WHERE `id` = ".$post['id']."") or die(mysql_error());
|
||||
$nPost = $db->query( 'SELECT `section` FROM `' . TABLE_PREFIX . 'forum` WHERE `id` = \''.$id.'\' LIMIT 1;' )->fetch();
|
||||
header('Location: ?subtopic=forum&action=show_board&id='.$nPost['section']);
|
||||
header('Location: ' . getForumBoardLink($nPost['section']));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -6,12 +6,17 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Guilds';
|
||||
|
||||
if(tableExist('guild_members'))
|
||||
define('GUILD_MEMBERS_TABLE', 'guild_members');
|
||||
else
|
||||
define('GUILD_MEMBERS_TABLE', 'guild_membership');
|
||||
|
||||
if($action == 'login')
|
||||
{
|
||||
if(check_guild_name($_REQUEST['guild']))
|
||||
@@ -98,10 +103,16 @@ if($action == '')
|
||||
}
|
||||
else
|
||||
echo '<TR BGCOLOR='.$config['lightborder'].'><TD ALIGN="CENTER">-</TD><TD><IMG SRC="images/guilds/' . 'default.gif" WIDTH=64 HEIGHT=64></TD>
|
||||
<TD valign="top" align="center"><B>Create guild</B><BR/>Actually there is no guild on server. Create first! Press button "Create Guild".</TD>
|
||||
<TD colspan="4"><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
|
||||
<TD valign="top" align="center"><B>Create guild</B><BR/>Actually there is no guild on server.' . ($logged ? ' Create first! Press button "Create Guild".' : '') . '</TD>
|
||||
<TD colspan="4">';
|
||||
if($logged)
|
||||
echo '
|
||||
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
|
||||
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
|
||||
</TD></TR></FORM></TABLE></TD></TR>';
|
||||
</TD></TR></FORM></TABLE>';
|
||||
|
||||
echo '
|
||||
</TD></TR>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -130,10 +141,14 @@ if($action == '')
|
||||
}
|
||||
else
|
||||
echo '<TR BGCOLOR='.$config['lightborder'].'><TD><IMG SRC="images/guilds/' . 'default.gif" WIDTH=64 HEIGHT=64></TD>
|
||||
<TD valign="top"><B>Create guild</B><BR/>Actually there is no guild on server. Create first! Press button "Create Guild".</TD>
|
||||
<TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
|
||||
<TD valign="top"><B>Create guild</B><BR/>Actually there is no guild on server.' . ($logged ? ' Create first! Press button "Create Guild".' : '') . '</TD>
|
||||
<TD>';
|
||||
if($logged)
|
||||
echo '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=createguild" METHOD=post><TR><TD>
|
||||
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
|
||||
</TD></TR></FORM></TABLE></TD></TR>';
|
||||
</TD></TR></FORM></TABLE>';
|
||||
echo '
|
||||
</TD></TR>';
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +161,7 @@ if($action == '')
|
||||
<BR /><a href="?subtopic=guilds&action=cleanup_players">Cleanup players</a> - can\'t join guild/be invited? Can\'t create guild? Try cleanup players.
|
||||
<BR /><a href="?subtopic=guilds&action=cleanup_guilds">Cleanup guilds</a> - made guild, you are a leader, but you are not on players list? Cleanup guilds!';
|
||||
else
|
||||
echo 'Before you can create guild you must login.<br><TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=accountmanagement&redirect=' . BASE_URL . urlencode(getPageLink('guilds')) . '" METHOD=post><TR><TD>
|
||||
echo 'Before you can create guild you must login.<br><TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=accountmanagement&redirect=' . getPageLink('guilds') . '" METHOD=post><TR><TD>
|
||||
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18>
|
||||
</TD></TR></FORM></TABLE></TD><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD></TR></TABLE>';
|
||||
}
|
||||
@@ -258,10 +273,10 @@ if($action == 'show')
|
||||
$showed_players = 1;
|
||||
foreach($rank_list as $rank)
|
||||
{
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
if(tableExist(GUILD_MEMBERS_TABLE))
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
|
||||
else if(fieldExist('rank_id', 'players'))
|
||||
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
|
||||
else
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_membership`.`rank_id` as `rank_id` FROM `players`, `guild_membership` WHERE `guild_membership`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `guild_membership`.`player_id` ORDER BY `name`;');
|
||||
|
||||
$players_with_rank_number = $players_with_rank->rowCount();
|
||||
if($players_with_rank_number > 0)
|
||||
@@ -491,7 +506,7 @@ if($action == 'changerank')
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
|
||||
else
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_membership`.`rank_id` as `rank_id` FROM `players`, `guild_membership` WHERE `guild_membership`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `guild_membership`.`player_id` ORDER BY `name`;');
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
|
||||
|
||||
$players_with_rank_number = $players_with_rank->rowCount();
|
||||
if(count($players_with_rank) > 0)
|
||||
@@ -573,7 +588,7 @@ if($action == 'changerank')
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
|
||||
else
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_membership`.`rank_id` as `rank_id` FROM `players`, `guild_membership` WHERE `guild_membership`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `guild_membership`.`player_id` ORDER BY `name`;');
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
|
||||
|
||||
$players_with_rank_number = $players_with_rank->rowCount();
|
||||
if(count($players_with_rank) > 0)
|
||||
@@ -1598,7 +1613,7 @@ else
|
||||
if(fieldExist('rank_id', 'players'))
|
||||
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
|
||||
else
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `guild_membership`.`rank_id` as `rank_id` FROM `players`, `guild_membership` WHERE `guild_membership`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `guild_membership`.`player_id` ORDER BY `name`;');
|
||||
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
|
||||
|
||||
$players_with_rank_number = $players_with_rank->rowCount();
|
||||
if($players_with_rank_number > 0) {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -180,7 +180,7 @@ $type = '';
|
||||
|
||||
echo '</TR>';
|
||||
|
||||
$players_info = $db->query("SELECT `houses`.`id` AS `houseid` , `players`.`name` AS `ownername` , `accounts`.`premdays` AS `premdays` , `accounts`.`lastday` AS `lastlogin` FROM `houses` , `players` , `accounts` WHERE `players`.`id` = `houses`.`owner` AND `accounts`.`id` = `players`.`account_id`");
|
||||
$players_info = $db->query("SELECT `houses`.`id` AS `houseid` , `players`.`name` AS `ownername` FROM `houses` , `players` , `accounts` WHERE `players`.`id` = `houses`.`owner` AND `accounts`.`id` = `players`.`account_id`");
|
||||
$players = array();
|
||||
foreach($players_info->fetchAll() as $player)
|
||||
$players[$player['houseid']] = array('name' => $player['ownername']);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -16,7 +16,7 @@ $players_deaths_count = 0;
|
||||
$players_rows = '';
|
||||
if(tableExist('player_killers')) // tfs 0.3
|
||||
{
|
||||
$players_deaths = $db->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`, `players`.`world_id` FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0, ' . $config['last_kills_limit']);
|
||||
$players_deaths = $db->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`' . (fieldExist('world_id', 'players') ? ', `players`.`world_id`' : '') . ' FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0, ' . $config['last_kills_limit']);
|
||||
if(!empty($players_deaths))
|
||||
{
|
||||
foreach($players_deaths as $death)
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -48,7 +48,7 @@ if(isset($_GET['archive']))
|
||||
$author = $query['name'];
|
||||
}
|
||||
|
||||
echo news_parse($news['title'], $news['body'], $news['date'], $categories[$news['category']]['icon_id'], $config['news_author'] ? $author : '', $news['comments']);
|
||||
echo news_parse($news['title'], $news['body'], $news['date'], $categories[$news['category']]['icon_id'], $config['news_author'] ? $author : '', $news['comments'] != 0 ? getForumThreadLink($news['comments']) : NULL);
|
||||
}
|
||||
else
|
||||
echo 'This news doesn\'t exist or is hidden.<br>';
|
||||
@@ -444,7 +444,7 @@ if(!$news_cached)
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo news_parse($news['title'], $news['body'] . $admin_options, $news['date'], $categories[$news['category']]['icon_id'], $config['news_author'] ? $author : '', $news['comments']);
|
||||
echo news_parse($news['title'], $news['body'] . $admin_options, $news['date'], $categories[$news['category']]['icon_id'], $config['news_author'] ? $author : '', $news['comments'] != 0 ? getForumThreadLink($news['comments']) : NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
$_GET['archive'] = true;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -21,13 +21,16 @@ if($config['account_country'])
|
||||
<td class="white"><b>Server Status</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
$promotion = '';
|
||||
if(fieldExist('promotion', 'players'))
|
||||
$promotion = '`promotion`,';
|
||||
$order = isset($_GET['order']) ? $_GET['order'] : 'name';
|
||||
if(!in_array($order, array('country', 'name', 'level', 'vocation')))
|
||||
$order = $db->fieldName('name');
|
||||
else if($order == 'country')
|
||||
$order = $db->tableName('accounts') . '.' . $db->fieldName('country');
|
||||
else if($order == 'vocation')
|
||||
$order = 'promotion, vocation ASC';
|
||||
$order = $promotion . 'vocation ASC';
|
||||
|
||||
$skull_type = 'skull';
|
||||
if(fieldExist('skull_type', 'players')) {
|
||||
@@ -43,7 +46,7 @@ $vocs = array(0, 0, 0, 0, 0);
|
||||
if(tableExist('players_online')) // tfs 1.0
|
||||
$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order);
|
||||
else
|
||||
$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`, `promotion`, `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players` WHERE `players`.`online` > 0 AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order);
|
||||
$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`, ' . $promotion . ' `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players` WHERE `players`.`online` > 0 AND `accounts`.`id` = `players`.`account_id` ORDER BY ' . $order);
|
||||
|
||||
$players = 0;
|
||||
$data = '';
|
||||
@@ -116,11 +119,11 @@ if(!$players): ?>
|
||||
' ORDER BY ' . $db->fieldName('record') . ' DESC LIMIT 1');
|
||||
$timestamp = true;
|
||||
}
|
||||
else{ // tfs 1.0
|
||||
else if(tableExist('server_config')) { // tfs 1.0
|
||||
$query = $db->query('SELECT `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record'));
|
||||
}
|
||||
|
||||
if($query->rowCount() > 0)
|
||||
if(isset($query) && $query->rowCount() > 0)
|
||||
{
|
||||
$result = $query->fetch();
|
||||
echo 'The maximum on this game world was ' . $result['record'] . ' players' . ($timestamp ? ' on ' . date("M d Y, H:i:s", $result['timestamp']) . '.' : '.');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,17 +6,22 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Server info';
|
||||
|
||||
if(isset($config['lua']['experience_stages']))
|
||||
$config['lua']['experienceStages'] = $config['lua']['experience_stages'];
|
||||
?>
|
||||
|
||||
<center>
|
||||
<h1><?php echo $config['lua']['serverName']; ?></h1>
|
||||
<h3>
|
||||
<?php if(isset($config['lua']['experienceStages']) && getBoolean($config['lua']['experienceStages'])): ?>
|
||||
Experience stages: <a href="<?php echo getPageLink('experienceStages'); ?>">Look here</a><br/>
|
||||
<?php endif; ?>
|
||||
Commands: <a href="<?php echo getPageLink('commands'); ?>">Look here</a><br/>
|
||||
Team: <a href="<?php echo getPageLink('team'); ?>">Look here</a><br/>
|
||||
</h3>
|
||||
@@ -34,9 +39,15 @@ $title = 'Server info';
|
||||
if(isset($config['lua']['globalSaveEnabled']) && getBoolean($config['lua']['globalSaveEnabled']))
|
||||
echo '<li>Global save: <b>' . $config['lua']['globalSaveHour'] . ':00</b></li>';
|
||||
|
||||
if(isset($config['lua']['min_pvp_level'])){
|
||||
$config['lua']['protectionLevel'] = $config['lua']['min_pvp_level'];
|
||||
}
|
||||
|
||||
if(isset($config['lua']['protectionLevel'])):
|
||||
?>
|
||||
<li>World type: <b>PVP <i>(Protection level: ><?php echo $config['lua']['protectionLevel']; ?>)</i></b></li>
|
||||
<?php
|
||||
endif;
|
||||
$rent = trim(strtolower($config['lua']['houseRentPeriod']));
|
||||
if($rent != 'yearly' && $rent != 'monthly' && $rent != 'weekly' && $rent != 'daily')
|
||||
$rent = 'never';
|
||||
@@ -48,14 +59,31 @@ $title = 'Server info';
|
||||
if($cleanOld > 0)
|
||||
echo '<li>Houses with inactive owners are cleaned after 30 days.</li>';
|
||||
}
|
||||
|
||||
if(isset($config['lua']['rate_mag']))
|
||||
$config['lua']['rateMagic'] = $config['lua']['rate_mag'];
|
||||
if(isset($config['lua']['rate_skill']))
|
||||
$config['lua']['rateSkill'] = $config['lua']['rate_skill'];
|
||||
if(isset($config['lua']['rate_loot']))
|
||||
$config['lua']['rateLoot'] = $config['lua']['rate_loot'];
|
||||
if(isset($config['lua']['rate_spawn']))
|
||||
$config['lua']['rateSpawn'] = $config['lua']['rate_spawn'];
|
||||
?>
|
||||
<br/>
|
||||
|
||||
<h2>Rates</h2>
|
||||
<?php if(isset($config['lua']['rateMagic'])): ?>
|
||||
<li>Magic Level: <b>x<?php echo $config['lua']['rateMagic']; ?></b></li>
|
||||
<?php endif;
|
||||
if(isset($config['lua']['rateSkill'])): ?>
|
||||
<li>Skills: <b>x<?php echo $config['lua']['rateSkill']; ?></b></li>
|
||||
<?php endif;
|
||||
if(isset($config['lua']['rateLoot'])): ?>
|
||||
<li>Loot: <b>x<?php echo $config['lua']['rateLoot']; ?></b></li>
|
||||
<?php endif;
|
||||
if(isset($config['lua']['rateSpawn'])): ?>
|
||||
<li>Spawn: <b>x<?php echo $config['lua']['rateSpawn']; ?></b></li>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$house_level = NULL;
|
||||
if(isset($config['lua']['levelToBuyHouse']))
|
||||
@@ -65,12 +93,15 @@ $title = 'Server info';
|
||||
|
||||
if(isset($house_level)):
|
||||
?>
|
||||
<li>Houses: <b><?php echo $config['lua']['levelToBuyHouse']; ?> level</b></li>
|
||||
<li>Houses: <b><?php echo $house_level; ?> level</b></li>
|
||||
<?php endif; ?>
|
||||
<li>Guilds: <b><?php echo $config['guild_need_level']; ?> level</b> (Create via website)</li>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if(isset($config['lua']['in_fight_duration']))
|
||||
$config['lua']['pzLocked'] = $config['lua']['in_fight_duration'];
|
||||
|
||||
$pzLocked = eval('return ' . $config['lua']['pzLocked'] . ';');
|
||||
$whiteSkullTime = isset($config['lua']['whiteSkullTime']) ? $config['lua']['whiteSkullTime'] : NULL;
|
||||
if(!isset($whiteSkullTime) && isset($config['lua']['unjust_skull_duration']))
|
||||
@@ -138,13 +169,13 @@ $title = 'Server info';
|
||||
<?php
|
||||
endif;
|
||||
if(isset($config['lua']['banishment_length'])): ?>
|
||||
<li>Banishment length: <b><?php echo eval('return ' . $config['lua']['banishment_length'] / (24 * 60 * 60) . ';'); ?> days</b></li>
|
||||
<li>Banishment length: <b><?php echo eval('return (' . $config['lua']['banishment_length'] . ') / (24 * 60 * 60);'); ?> days</b></li>
|
||||
<?php endif;
|
||||
if(isset($config['lua']['final_banishment_length'])): ?>
|
||||
<li>Final banishment length: <b><?php echo eval('return ' . $config['lua']['final_banishment_length'] / (24 * 60 * 60) . ';'); ?> days</b></li>
|
||||
<li>Final banishment length: <b><?php echo eval('return (' . $config['lua']['final_banishment_length'] . ') / (24 * 60 * 60);'); ?> days</b></li>
|
||||
<?php endif;
|
||||
if(isset($config['lua']['ip_banishment_length'])): ?>
|
||||
<li>IP banishment length: <b><?php echo eval('return ' . $config['lua']['ip_banishment_length'] / (24 * 60 * 60) . ';'); ?> days</b></li>
|
||||
<li>IP banishment length: <b><?php echo eval('return (' . $config['lua']['ip_banishment_length'] . ') / (24 * 60 * 60);'); ?> days</b></li>
|
||||
<?php endif; ?>
|
||||
<br/>
|
||||
<h2>Other</h2>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -22,6 +22,7 @@ if(isset($_POST['reload_spells']) && $canEdit)
|
||||
foreach($config_vocations as $voc_id => $voc_name) {
|
||||
$vocations_ids[$voc_name] = $voc_id;
|
||||
}
|
||||
|
||||
$allspells = new OTS_SpellsList($config['data_path'].'spells/spells.xml');
|
||||
//add conjure spells
|
||||
$conjurelist = $allspells->getConjuresList();
|
||||
@@ -89,8 +90,12 @@ if(isset($_POST['reload_spells']) && $canEdit)
|
||||
$nr_of_vocations = count($vocations);
|
||||
$vocations_to_db = "";
|
||||
$voc_nr = 0;
|
||||
foreach($vocations as $vocation_to_add_name) {
|
||||
$vocations_to_db .= $vocation_to_add_name;
|
||||
foreach($vocations as $vocation_to_add) {
|
||||
if(check_number($vocation_to_add)) {
|
||||
$vocations_to_db .= $vocation_to_add;
|
||||
}
|
||||
else
|
||||
$vocations_to_db .= $vocations_ids[$vocation_to_add];
|
||||
$voc_nr++;
|
||||
|
||||
if($voc_nr != $nr_of_vocations) {
|
||||
@@ -234,8 +239,10 @@ else
|
||||
$showed_vocations = 0;
|
||||
foreach($spell_vocations as $spell_vocation)
|
||||
{
|
||||
if(isset($config_vocations[$spell_vocation])) {
|
||||
echo $config_vocations[$spell_vocation];
|
||||
$showed_vocations++;
|
||||
}
|
||||
if($showed_vocations != count($spell_vocations))
|
||||
echo '<br/>';
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -21,9 +21,15 @@ $status['monsters'] = 0;
|
||||
$status_ip = $config['lua']['ip'];
|
||||
if(isset($config['lua']['statusProtocolPort'])) {
|
||||
$config['lua']['loginPort'] = $config['lua']['statusProtocolPort'];
|
||||
$config['lua']['statusPort'] = $config['lua']['statusProtocolPort'];
|
||||
$status_port = $config['lua']['statusProtocolPort'];
|
||||
}
|
||||
else
|
||||
else if(isset($config['lua']['status_port'])) {
|
||||
$config['lua']['loginPort'] = $config['lua']['status_port'];
|
||||
$config['lua']['statusPort'] = $config['lua']['status_port'];
|
||||
$status_port = $config['lua']['status_port'];
|
||||
}
|
||||
|
||||
$status_port = $config['lua']['statusPort'];
|
||||
|
||||
if(isset($config['status_ip'][0]))
|
||||
@@ -64,6 +70,9 @@ if($fetch_from_db)
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($config['lua']['statustimeout']))
|
||||
$config['lua']['statusTimeout'] = $config['lua']['statustimeout'];
|
||||
|
||||
// get status timeout from server config
|
||||
$status_timeout = eval('return ' . $config['lua']['statusTimeout'] . ';') / 1000 + 1;
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -26,14 +26,24 @@ if($config['template_allow_change'])
|
||||
}
|
||||
else if(isset($_SESSION['template']))
|
||||
{
|
||||
if(!preg_match("/[^A-z0-9_\-]/", $_SESSION['template']))
|
||||
if(!preg_match("/[^A-z0-9_\-]/", $_SESSION['template'])) {
|
||||
$template_name = $_SESSION['template'];
|
||||
else
|
||||
}
|
||||
else {
|
||||
$template_name = $config['template'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$template_path = 'templates/' . $template_name;
|
||||
|
||||
if(!file_exists($template_path . '/index.php') &&
|
||||
!file_exists($template_path . '/template.php') &&
|
||||
!file_exists($template_path . '/layout.php'))
|
||||
{
|
||||
$template_name = 'kathrine';
|
||||
$template_path = 'templates/' . $template_name;
|
||||
}
|
||||
|
||||
$file = $template_path . '/config.ini';
|
||||
$exists = file_exists($file);
|
||||
if($exists || ($config['backward_support'] && file_exists($template_path . '/layout_config.ini')))
|
||||
@@ -58,7 +68,7 @@ if($exists || ($config['backward_support'] && file_exists($template_path . '/lay
|
||||
foreach($template_ini as $key => $value)
|
||||
$config[$key] = $value;
|
||||
}
|
||||
else
|
||||
else if(file_exists($template_path . '/config.php'))
|
||||
require($template_path . '/config.php');
|
||||
|
||||
$template = array();
|
||||
@@ -68,7 +78,7 @@ $template['link_account_lost'] = internalLayoutLink(($config['friendly_urls'] ?
|
||||
$template['link_account_logout'] = internalLayoutLink(($config['friendly_urls'] ? 'account' : 'accountmanagement'), 'logout');
|
||||
|
||||
$template['link_news'] = internalLayoutLink('news');
|
||||
$template['link_news_archive'] = internalLayoutLink('news' . ($config['friendly_urls'] ? '' : '') . 'archive');
|
||||
$template['link_news_archive'] = internalLayoutLink('news' . ($config['friendly_urls'] ? '/' : '') . 'archive');
|
||||
$template['link_changelog'] = internalLayoutLink('changelog');
|
||||
$template['link_rules'] = internalLayoutLink('rules');
|
||||
$template['link_downloads'] = internalLayoutLink('downloads');
|
||||
@@ -92,6 +102,7 @@ $template['link_screenshots'] = internalLayoutLink('screenshots');
|
||||
$template['link_movies'] = internalLayoutLink('movies');
|
||||
$template['link_serverInfo'] = internalLayoutLink('serverInfo');
|
||||
$template['link_experienceTable'] = internalLayoutLink('experienceTable');
|
||||
$template['link_faq'] = internalLayoutLink('faq');
|
||||
$template['link_points'] = internalLayoutLink('points');
|
||||
$template['link_gifts'] = internalLayoutLink('gifts');
|
||||
$template['link_gifts_history'] = internalLayoutLink('gifts', 'show_history');
|
||||
|
@@ -3,7 +3,6 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
function news_parse($title, $content, $date, $icon = 0, $author = '', $comments = '')
|
||||
{
|
||||
global $template_path, $config;
|
||||
|
||||
//$tmp = $template_path.'/images/letters/'.$content[0].'.gif';
|
||||
//if(file_exists($tmp)) {
|
||||
// $firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>';
|
||||
|
@@ -51,9 +51,9 @@
|
||||
|
||||
<div id="mainsubmenu">
|
||||
<div id="news-submenu">
|
||||
<a href="<?php echo internalLayoutLink('news'); ?>">Latest News</a>
|
||||
<a href="<?php echo $template['link_news']; ?>">Latest News</a>
|
||||
<span class="separator"></span>
|
||||
<a href="<?php echo internalLayoutLink('news' . ($config['friendly_urls'] ? '' : '') . 'archive')?>">News Archives</a>
|
||||
<a href="<?php echo $template['link_news_archive']; ?>">News Archives</a>
|
||||
</div>
|
||||
|
||||
<div id="account-submenu">
|
||||
@@ -159,7 +159,7 @@
|
||||
<div id="margins">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td><a href="<?php echo internalLayoutLink('news'); ?>"><?php echo $config['lua']['serverName']; ?></a> » <?php echo $title; ?></td>
|
||||
<td><a href="<?php echo $template['link_news']; ?>"><?php echo $config['lua']['serverName']; ?></a> » <?php echo $title; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if($status['online'])
|
||||
|
@@ -75,16 +75,16 @@ if(isset($config['boxes']))
|
||||
function LoginButtonAction()
|
||||
{
|
||||
if(loginStatus == "false") {
|
||||
window.location = "<?php echo internalLayoutLink('accountmanagement'); ?>";
|
||||
window.location = "<?php echo $template['link_account_manage']; ?>";
|
||||
} else {
|
||||
window.location = "<?php echo internalLayoutLink('accountmanagement'); ?>";
|
||||
window.location = "<?php echo $template['link_account_manage']; ?>";
|
||||
}
|
||||
}
|
||||
function LoginstatusTextAction(source) {
|
||||
if(loginStatus == "false") {
|
||||
window.location = "<?php echo internalLayoutLink('createaccount'); ?>";
|
||||
window.location = "<?php echo $template['link_account_create']; ?>";
|
||||
} else {
|
||||
window.location = "<?php echo internalLayoutLink('createaccount'); ?>&action=logout";
|
||||
window.location = "<?php echo $template['link_account_logout']; ?>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ if(isset($config['boxes']))
|
||||
</head>
|
||||
<body onBeforeUnLoad="SaveMenu();" onUnload="SaveMenu();">
|
||||
<?php echo template_place_holder('body_start'); ?>
|
||||
<a name="top" ></a>
|
||||
<div id="top"></div>
|
||||
<div id="ArtworkHelper" style="background-image:url(<?php echo $template_path; ?>/images/header/<?php echo $config['background_image']; ?>);" >
|
||||
<div id="Bodycontainer">
|
||||
<div id="ContentRow">
|
||||
@@ -268,7 +268,7 @@ if(isset($config['boxes']))
|
||||
</div>
|
||||
</span>
|
||||
<div id='news_Submenu' class='Submenu'>
|
||||
<a href='<?php echo internalLayoutLink('news')?>'>
|
||||
<a href='<?php echo $template['link_news']; ?>'>
|
||||
<div id='submenu_news' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_news' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -276,7 +276,7 @@ if(isset($config['boxes']))
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('news' . ($config['friendly_urls'] ? '' : '') . 'archive')?>'>
|
||||
<a href='<?php echo $template['link_news_archive'];?>'>
|
||||
<div id='submenu_newsarchive' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_newsarchive' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -284,7 +284,7 @@ if(isset($config['boxes']))
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<!--a href='<?php echo internalLayoutLink('changelog')?>'>
|
||||
<!--a href='<?php echo $template['link_changelog'];?>'>
|
||||
<div id='submenu_changelog' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_changelog' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -314,7 +314,7 @@ if(isset($config['boxes']))
|
||||
</div>
|
||||
</span>
|
||||
<div id='account_Submenu' class='Submenu'>
|
||||
<a href='<?php echo internalLayoutLink('account' . ($config['friendly_urls'] ? '/manage' : 'management')); ?>'>
|
||||
<a href='<?php echo $template['link_account_manage']; ?>'>
|
||||
<div id='submenu_accountmanagement' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_accountmanagement' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -322,7 +322,7 @@ if(isset($config['boxes']))
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink(($config['friendly_urls'] ? 'account/create' : 'createaccount')); ?>'>
|
||||
<a href='<?php echo $template['link_account_create']; ?>'>
|
||||
<div id='submenu_createaccount' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_createaccount' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -330,7 +330,7 @@ if(isset($config['boxes']))
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink(($config['friendly_urls'] ? 'account/lost' : 'lostaccount')); ?>'>
|
||||
<a href='<?php echo $template['link_account_lost']; ?>'>
|
||||
<div id='submenu_lostaccount' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_lostaccount' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -338,7 +338,7 @@ if(isset($config['boxes']))
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('rules')?>'>
|
||||
<a href='<?php echo $template['link_rules']; ?>'>
|
||||
<div id='submenu_rules' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_rules' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -347,7 +347,7 @@ if(isset($config['boxes']))
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
echo "<a href='" . $template['link_downloads'] . "'>
|
||||
<div id='submenu_downloads' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_downloads' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -377,7 +377,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</span>
|
||||
<div id='community_Submenu' class='Submenu'>
|
||||
<a href='<?php echo internalLayoutLink('characters')?>'>
|
||||
<a href='<?php echo $template['link_characters']; ?>'>
|
||||
<div id='submenu_characters' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_characters' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -386,7 +386,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('online')?>'>
|
||||
<a href='<?php echo $template['link_online']; ?>'>
|
||||
<div id='submenu_online' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_online' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -394,7 +394,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('highscores')?>'>
|
||||
<a href='<?php echo $template['link_highscores']; ?>'>
|
||||
<div id='submenu_highscores' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_highscores' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -403,7 +403,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</a>
|
||||
<?php if(isset($config['powergamers'])): ?>
|
||||
<a href='<?php echo internalLayoutLink('powergamers')?>'>
|
||||
<a href='<?php echo $template['link_powergamers']; ?>'>
|
||||
<div id='submenu_powergamers' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_powergamers' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -412,7 +412,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href='<?php echo internalLayoutLink('lastkills')?>'>
|
||||
<a href='<?php echo $template['link_lastkills']; ?>'>
|
||||
<div id='submenu_lastkills' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_lastkills' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -420,7 +420,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('houses')?>'>
|
||||
<a href='<?php echo $template['link_houses']; ?>'>
|
||||
<div id='submenu_houses' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_houses' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -428,7 +428,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('guilds')?>'>
|
||||
<a href='<?php echo $template['link_guilds']; ?>'>
|
||||
<div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
|
||||
@@ -438,7 +438,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</a>
|
||||
<?php if(isset($config['wars'])): ?>
|
||||
<a href='<?php echo internalLayoutLink('wars')?>'>
|
||||
<a href='<?php echo $template['link_wars']; ?>'>
|
||||
<div id='submenu_wars' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
|
||||
@@ -449,7 +449,7 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if(isset($config['polls'])): ?>
|
||||
<a href='<?php echo internalLayoutLink('polls')?>'>
|
||||
<a href='<?php echo $template['link_polls']; ?>'>
|
||||
<div id='submenu_polls' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
|
||||
@@ -459,7 +459,8 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href='<?php echo internalLayoutLink('bans')?>'>
|
||||
<?php if(tableExist('bans')): ?>
|
||||
<a href='<?php echo $template['link_bans']; ?>'>
|
||||
<div id='submenu_bans' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
|
||||
@@ -468,7 +469,8 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('team')?>'>
|
||||
<?php endif; ?>
|
||||
<a href='<?php echo $template['link_team']; ?>'>
|
||||
<div id='submenu_team' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_team' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -479,15 +481,6 @@ echo "<a href='" . internalLayoutLink('downloads') . "'>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if($config['forum'] != '')
|
||||
{
|
||||
if(strtolower($config['forum']) == 'site')
|
||||
$forum_link = "<a href='" . internalLayoutLink('forum') . "'>";
|
||||
else
|
||||
$forum_link = "<a href='" . $config['forum'] . "' target='_blank'>";
|
||||
?>
|
||||
|
||||
<div id='forum' class='menuitem'>
|
||||
<span onClick="MenuItemAction('forum')">
|
||||
<div class='MenuButton' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background.gif);'>
|
||||
@@ -506,7 +499,7 @@ if($config['forum'] != '')
|
||||
</span>
|
||||
|
||||
<div id='forum_Submenu' class='Submenu'>
|
||||
<?php echo $forum_link; ?>
|
||||
<?php echo $template['link_forum']; ?>
|
||||
<div id='submenu_forum' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_forum' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -516,9 +509,6 @@ if($config['forum'] != '')
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id='library' class='menuitem'>
|
||||
<span onClick="MenuItemAction('library')">
|
||||
<div class='MenuButton' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background.gif);'>
|
||||
@@ -535,7 +525,7 @@ if($config['forum'] != '')
|
||||
</div>
|
||||
</span>
|
||||
<div id='library_Submenu' class='Submenu'>
|
||||
<a href='<?php echo internalLayoutLink('creatures')?>'>
|
||||
<a href='<?php echo $template['link_creatures']; ?>'>
|
||||
<div id='submenu_creatures' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_creatures' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -543,7 +533,7 @@ if($config['forum'] != '')
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('spells')?>'>
|
||||
<a href='<?php echo $template['link_spells']; ?>'>
|
||||
<div id='submenu_spells' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_spells' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -551,7 +541,7 @@ if($config['forum'] != '')
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='<?php echo internalLayoutLink('commands')?>'>
|
||||
<a href='<?php echo $template['link_commands']; ?>'>
|
||||
<div id='submenu_commands' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_commands' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -559,10 +549,7 @@ if($config['forum'] != '')
|
||||
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
if(getBoolean($config['lua']['experienceStages'])):
|
||||
?>
|
||||
<a href='<?php echo internalLayoutLink('experienceStages')?>'>
|
||||
<a href='<?php echo $template['link_experienceStages']; ?>'>
|
||||
<div id='submenu_experiencestages' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_experiencestages' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -571,10 +558,9 @@ if(getBoolean($config['lua']['experienceStages'])):
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if(isset($config['freehouses'])): ?>
|
||||
<a href='<?php echo internalLayoutLink('freehouses')?>'>
|
||||
<a href='<?php echo $template['link_freehouses']; ?>'>
|
||||
<div id='submenu_freehouses' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_freehouses' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -587,7 +573,7 @@ endif;
|
||||
?>
|
||||
|
||||
<?php
|
||||
echo "<a href='" . internalLayoutLink('screenshots') . "'>
|
||||
echo "<a href='" . $template['link_screenshots'] . "'>
|
||||
<div id='submenu_screenshots' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_screenshots' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -596,7 +582,7 @@ echo "<a href='" . internalLayoutLink('screenshots') . "'>
|
||||
</div>
|
||||
</a>";
|
||||
if(isset($config['movies']))
|
||||
echo "<a href='" . internalLayoutLink('movies') . "'>
|
||||
echo "<a href='" . $template['link_movies'] . "'>
|
||||
<div id='submenu_movies' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_movies' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -605,7 +591,7 @@ echo "<a href='" . internalLayoutLink('movies') . "'>
|
||||
</div>
|
||||
</a>";
|
||||
|
||||
echo "<a href='" . internalLayoutLink('serverInfo') . "'>
|
||||
echo "<a href='" . $template['link_serverInfo'] . "'>
|
||||
<div id='submenu_serverinfo' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_serverinfo' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -614,7 +600,7 @@ echo "<a href='" . internalLayoutLink('serverInfo') . "'>
|
||||
</div>
|
||||
</a>";
|
||||
?>
|
||||
<a href='<?php echo internalLayoutLink('experienceTable')?>'>
|
||||
<a href='<?php echo $template['link_experienceTable']; ?>'>
|
||||
<div id='submenu_experiencetable' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_experiencetable' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -644,7 +630,7 @@ echo "<div id='shops' class='menuitem'>
|
||||
</span>
|
||||
</div>
|
||||
<div id='shops_Submenu' class='Submenu'>
|
||||
<a href='" . internalLayoutLink('points') . "'>
|
||||
<a href='" . $template['link_points'] . "'>
|
||||
<div id='submenu_points' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_points' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -652,7 +638,7 @@ echo "<div id='shops' class='menuitem'>
|
||||
<div class='RightChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
</div>
|
||||
</a>
|
||||
<a href='" . internalLayoutLink('gifts') . "'>
|
||||
<a href='" . $template['link_gifts'] . "'>
|
||||
<div id='submenu_gifts' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -661,7 +647,7 @@ echo "<div id='shops' class='menuitem'>
|
||||
</div>
|
||||
</a>";
|
||||
if($logged)
|
||||
echo "<a href='?subtopic=gifts&action=show_history'>
|
||||
echo "<a href='" . $template['link_gifts_history'] . "'>
|
||||
<div id='submenu_gifts' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
|
||||
<div class='LeftChain' style='background-image:url(".$template_path."/images/general/chain.gif);'></div>
|
||||
<div id='ActiveSubmenuItemIcon_gifts' class='ActiveSubmenuItemIcon' style='background-image:url(".$template_path."/images/menu/icon-activesubmenu.gif);'></div>
|
||||
@@ -726,7 +712,7 @@ echo "</div>";
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
if($db->query('SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = ' . $db->quote($config['lua']['sqlDatabase']) . ' AND TABLE_NAME = ' . $db->quote('wodz_exphistory'))->rowCount())
|
||||
if(tableExist('wodz_exphistory'))
|
||||
{
|
||||
$top_enabled = true;
|
||||
function write_top($name, $list, $colspan = 2)
|
||||
@@ -858,7 +844,7 @@ echo "</div>";
|
||||
?>
|
||||
<img id="Monster" src="images/monsters/<?php echo logo_monster() ?>.gif" onClick="window.location = '?subtopic=creatures&creature=<?php echo $config['logo_monster'] ?>';" alt="Monster of the Week" />
|
||||
<img id="PedestalAndOnline" src="<?php echo $template_path; ?>/images/header/pedestal-and-online.gif" alt="Monster Pedestal and Players Online Box"/>
|
||||
<div id="PlayersOnline" onClick="window.location = '<?php echo internalLayoutLink('online')?>'">
|
||||
<div id="PlayersOnline" onClick="window.location = '<?php echo $template['link_online']; ?>'">
|
||||
<?php
|
||||
if($status['online'])
|
||||
echo '<div id="players" style="display: inline;">' . $status['players'] . '</div><br>Players Online';
|
||||
@@ -870,7 +856,7 @@ echo "</div>";
|
||||
<div id="Themeboxes">
|
||||
<?php if(in_array("newcomer", $config['boxes'])): ?>
|
||||
<div id="NewcomerBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/newcomer/newcomerbox.gif);">
|
||||
<a class="ThemeboxButton" href="<?php echo internalLayoutLink('createaccount'); ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton.gif);">
|
||||
<a class="ThemeboxButton" href="<?php echo $template['link_account_create']; ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton.gif);">
|
||||
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton_over.gif);"></div>
|
||||
<div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/buttons/_sbutton_jointibia.gif);"></div>
|
||||
</a>
|
||||
@@ -895,7 +881,7 @@ echo "</div>";
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if(PAGE == 'news' && in_array("poll", $config['boxes'])):
|
||||
$poll = $db->query('SELECT id, question FROM '.$db->tableName('z_polls') . ' WHERE end > ' . time() . ' ORDER BY end LIMIT 1');
|
||||
$poll = $db->query('SELECT id, question FROM '.$db->tableName(TABLE_PREFIX . 'polls') . ' WHERE end > ' . time() . ' ORDER BY end LIMIT 1');
|
||||
if($poll->rowCount() > 0)
|
||||
{
|
||||
$poll = $poll->fetch();
|
||||
@@ -914,7 +900,7 @@ echo "</div>";
|
||||
<br/><br/>
|
||||
<?php
|
||||
if($config['template_allow_change'])
|
||||
echo '<font color="white">Template:</font><br/>' . template_language_form();
|
||||
echo '<font color="white">Template:</font><br/>' . template_form();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -3,11 +3,14 @@ function news_parse($title, $content, $date, $icon = 0, $author = '', $comments
|
||||
{
|
||||
global $template_path;
|
||||
|
||||
if($content[0] != '<')
|
||||
{
|
||||
$tmp = $template_path.'/images/letters/'.$content[0].'.gif';
|
||||
if(file_exists($tmp)) {
|
||||
$firstLetter = '<img src="' . $tmp . '" alt="'.$content[0].'" BORDER=0 ALIGN=bottom>';
|
||||
$content[0] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return '
|
||||
<div class="NewsHeadline">
|
||||
@@ -21,7 +24,7 @@ function news_parse($title, $content, $date, $icon = 0, $author = '', $comments
|
||||
</div>
|
||||
<table style="clear:both" border=0 cellpadding=0 cellspacing=0 width="100%" >
|
||||
<tr>
|
||||
<td style="padding-left:10px;padding-right:10px;" >' . $firstLetter.$content . '</td>
|
||||
<td style="padding-left:10px;padding-right:10px;" >' . (isset($firstLetter) ? $firstLetter : '').$content . '</td>
|
||||
</tr>'
|
||||
. (isset($comments[0]) ? '
|
||||
<tr>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2016 WodzAAC
|
||||
* @version 0.0.1
|
||||
* @version 0.0.3
|
||||
* @link http://myaac.info
|
||||
*/
|
||||
|
||||
@@ -19,23 +19,32 @@ require(SYSTEM . 'init.php');
|
||||
echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>';
|
||||
if(isset($_GET['account']))
|
||||
{
|
||||
$account = trim($_GET['account']);
|
||||
$account = $_GET['account'];
|
||||
$tmp = strtoupper($account);
|
||||
|
||||
$error = '';
|
||||
if(USE_ACCOUNT_NAME)
|
||||
{
|
||||
if(!check_account_name($tmp, $error))
|
||||
error_($error);
|
||||
}
|
||||
else if(!check_account_id($account, $error))
|
||||
error_($error);
|
||||
|
||||
$_account = new OTS_Account();
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$_account->find($tmp);
|
||||
else
|
||||
$_account->load($tmp);
|
||||
|
||||
if($_account->isLoaded())
|
||||
error_('Account with this name already exist.');
|
||||
|
||||
success_('Good account name ( ' . $account . ' ).');
|
||||
success_('Good account' . (USE_ACCOUNT_NAME ? ' name' : '') . ' ( ' . $account . ' ).');
|
||||
}
|
||||
else if(isset($_GET['email']))
|
||||
{
|
||||
$email = trim($_GET['email']);
|
||||
$email = $_GET['email'];
|
||||
if(strlen($email) >= 255)
|
||||
error_('E-mail is too long (max. 255 chars).');
|
||||
|
||||
@@ -54,7 +63,7 @@ else if(isset($_GET['email']))
|
||||
}
|
||||
else if(isset($_GET['name']))
|
||||
{
|
||||
$name = strtolower(stripslashes(trim($_GET['name'])));
|
||||
$name = strtolower(stripslashes($_GET['name']));
|
||||
$error = '';
|
||||
if(!check_name($name, $error))
|
||||
error_($error);
|
||||
|
Reference in New Issue
Block a user