mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 20:43:34 +02:00
Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
35b0795b51 | ||
![]() |
04a7796665 | ||
![]() |
755deae717 | ||
![]() |
6d66dc9043 | ||
![]() |
bbd9cd2101 | ||
![]() |
b6ccde075d | ||
![]() |
e94b9006e6 | ||
![]() |
e9c8159bf3 | ||
![]() |
919f69ef46 | ||
![]() |
4ac2fe27d5 | ||
![]() |
be2daeb4ab | ||
![]() |
7b96ce9b8c | ||
![]() |
801188f957 | ||
![]() |
c546a46847 | ||
![]() |
6527d21794 | ||
![]() |
7fad722927 | ||
![]() |
ab249eb95f | ||
![]() |
bdbd215aad | ||
![]() |
68212a36bb | ||
![]() |
ac3691dc08 | ||
![]() |
3a6aab67d5 | ||
![]() |
2c5b3f4da3 | ||
![]() |
73eca63c4f | ||
![]() |
c504588993 | ||
![]() |
5b14c6d4d4 | ||
![]() |
4685c7b868 | ||
![]() |
0e185c8bcf | ||
![]() |
e230949edd | ||
![]() |
a897b5e98c | ||
![]() |
186d3dbd38 | ||
![]() |
127c04070b | ||
![]() |
6ff65050f5 | ||
![]() |
d605ef4b28 | ||
![]() |
9466b7ce75 | ||
![]() |
7f6eff666e | ||
![]() |
e878b4df48 | ||
![]() |
2c3c1529a7 | ||
![]() |
ecce524c7b | ||
![]() |
5af617b869 | ||
![]() |
3f886c9f7c | ||
![]() |
d50fb7a291 | ||
![]() |
37502c5562 | ||
![]() |
7620ec896b | ||
![]() |
8a87186833 | ||
![]() |
b0f8013762 | ||
![]() |
3a6a1c448a |
38
CHANGELOG
38
CHANGELOG
@@ -1,3 +1,41 @@
|
||||
[0.4.3 - 05.10.2017]
|
||||
- better config loader taken from latest gesior, you can now include files in your config by doing dofile('config.local.lua')
|
||||
- fixed country detection in create account
|
||||
- fixed showing of character deaths and frags
|
||||
- fixed https://otland.net/threads/myaac-v0-0-1.251454/page-13#post-2466303
|
||||
- fixed https://otland.net/threads/myaac-v0-0-1.251454/page-13#post-2466313
|
||||
- fixed rook sample, which will now have level 1, 150 health, 0 mana, and 400 cap.
|
||||
- fixed samples being deleted by tfs 1.0+ cause of 'deletion' field set to 1
|
||||
- pages loaded from database have higher priority than normal .php pages, so they will be loaded first if they exist
|
||||
- moved many pages to twig templates
|
||||
- change download client links from clients.halfaway.net to tibia-clients.com
|
||||
- added bugtracker to kathrine template
|
||||
- added CREDITS file
|
||||
|
||||
[0.4.2 - 14.09.2017]
|
||||
- updated version number
|
||||
|
||||
[0.4.1 - 13.09.2017]
|
||||
- fixed log in to admin panel
|
||||
- fixed File is not .zip plugin upload error
|
||||
|
||||
[0.4.0 - 13.09.2017
|
||||
- added option to add/edit/delete/hide/move forum boards
|
||||
- moved some of HTML-in-PHP code to Twig templates
|
||||
- added bug_report configurable which can enable/disable bug tracker
|
||||
- log errors instead of showing them to users with system directories
|
||||
- fix when $_SERVER['HTTP_ACCEPT_ENCODING'] is not set
|
||||
- when it fails to load config.lua it will output error also to error.log
|
||||
- automatically detect json file in .zip instead of basing on filename (admin panel - plugins)
|
||||
- hopefully fixed the error with "The file you are trying to upload is not a .zip file. Please try again."
|
||||
- fixed wrong name of table in bugtracker
|
||||
- fixed some bugs in bugtracker
|
||||
- added report bug link in templates
|
||||
- fixed some rare error when user is logged in for longer than 15 minutes and tries to login again
|
||||
- fixed some grammar errors
|
||||
- some small improvements
|
||||
- fixed some separators in kathrine template
|
||||
|
||||
[0.3.0 - 28.08.2017]
|
||||
- added administration panel for screenshots management with auto thumbnail generator and image auto-resizing
|
||||
- added Twig template engine and moved some html-in-php code to it
|
||||
|
@@ -25,6 +25,9 @@ require(SYSTEM . 'status.php');
|
||||
require(SYSTEM . 'login.php');
|
||||
require(ADMIN . 'includes/functions.php');
|
||||
|
||||
$twig->addGlobal('config', $config);
|
||||
$twig->addGlobal('status', $status);
|
||||
|
||||
// if we're not logged in - show login box
|
||||
if(!$logged || !admin()) {
|
||||
$page = 'login';
|
||||
|
@@ -21,14 +21,14 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
session_start();
|
||||
|
||||
define('MYAAC', true);
|
||||
define('MYAAC_VERSION', '0.3.0');
|
||||
define('DATABASE_VERSION', 7);
|
||||
define('MYAAC_VERSION', '0.4.3');
|
||||
define('DATABASE_VERSION', 9);
|
||||
define('TABLE_PREFIX', 'myaac_');
|
||||
define('START_TIME', microtime(true));
|
||||
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX'));
|
||||
|
17
config.php
17
config.php
@@ -13,7 +13,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,7 @@ $config = array(
|
||||
|
||||
// gesior backward support (templates & pages)
|
||||
// allows using gesior templates and pages with myaac
|
||||
// might bring some performance when disabled
|
||||
'backward_support' => true,
|
||||
|
||||
// head options (html)
|
||||
@@ -45,7 +46,7 @@ $config = array(
|
||||
// footer
|
||||
'footer' => ''/*'<br/>Your Server © 2016. All rights reserved.'*/,
|
||||
|
||||
'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
|
||||
'debug_level' => 0, // 0 - disabled, 1 - show load time, 2 - show db query counter, 3 - both, 4 - memory usage, 5 - load time & memory usage, 6 - queries & memory usage, 7 - all
|
||||
|
||||
'language' => 'en', // default language (currently only 'en' available)
|
||||
'language_allow_change' => false,
|
||||
@@ -65,7 +66,7 @@ $config = array(
|
||||
'database_password' => '',
|
||||
'database_name' => '',
|
||||
|
||||
// multiworld system
|
||||
// multiworld system (only TFS 0.3)
|
||||
'multiworld' => false, // use multiworld system?
|
||||
'worlds' => array( // list of worlds
|
||||
//'1' => 'Your World Name',
|
||||
@@ -201,13 +202,16 @@ $config = array(
|
||||
),
|
||||
|
||||
// news page
|
||||
'news_limit' => 5, // limit of news on latest news page
|
||||
'news_limit' => 5, // limit of news on the latest news page
|
||||
'news_ticker_limit' => 5, // limit of news in tickers (mini news) (0 to disable)
|
||||
'news_date_format' => 'j.n.Y', // check php manual date() function for more info about this
|
||||
'news_author' => true,
|
||||
'news_author' => true, // show author of the news
|
||||
|
||||
// gifts/shop system
|
||||
'gifts_system' => false,
|
||||
|
||||
// support/system
|
||||
'bug_report' => true,
|
||||
|
||||
// forum
|
||||
'forum' => 'site', // link to the server forum, set to "site" if you want to use build in forum system, otherwise leave empty if you aren't going to use any forum
|
||||
@@ -228,7 +232,8 @@ $config = array(
|
||||
'google_analytics_id' => '', // e.g.: UA-XXXXXXX-X
|
||||
'experiencetable_columns' => 5, // how many columns to display in experience table page. * experiencetable_rows, 5 = 500 (will show up to 500 level)
|
||||
'experiencetable_rows' => 100, // till how many levels in one column
|
||||
|
||||
'date_timezone' => 'Europe/Berlin', // more info at http://php.net/manual/en/timezones.php
|
||||
|
||||
'monsters' => array(),
|
||||
'npc' => array()
|
||||
);
|
||||
|
BIN
images/items/empty.gif
Normal file
BIN
images/items/empty.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
96
index.php
96
index.php
@@ -21,7 +21,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
|
||||
@@ -55,6 +55,9 @@ require_once(SYSTEM . 'login.php');
|
||||
require_once(SYSTEM . 'status.php');
|
||||
require_once(SYSTEM . 'template.php');
|
||||
|
||||
$twig->addGlobal('config', $config);
|
||||
$twig->addGlobal('status', $status);
|
||||
|
||||
// database migrations
|
||||
$tmp = '';
|
||||
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
|
||||
@@ -168,58 +171,59 @@ if($load_it)
|
||||
require(SYSTEM . 'compat_pages.php');
|
||||
|
||||
$ignore = false;
|
||||
$file = SYSTEM . 'pages/' . $page . '.php';
|
||||
if(!@file_exists($file))
|
||||
|
||||
$logged_access = 0;
|
||||
if($logged && $account_logged && $account_logged->isLoaded()) {
|
||||
$logged_access = $account_logged->getAccess();
|
||||
}
|
||||
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT `title`, `body`, `php`' .
|
||||
' FROM `' . TABLE_PREFIX . 'pages`' .
|
||||
' WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1 AND `access` <= ' . $db->quote($logged_access));
|
||||
if($query->rowCount() > 0) // found page
|
||||
{
|
||||
$logged_access = 0;
|
||||
if($logged && $account_logged && $account_logged->isLoaded()) {
|
||||
$logged_access = $account_logged->getAccess();
|
||||
}
|
||||
$ignore = true;
|
||||
$query = $query->fetch();
|
||||
$title = $query['title'];
|
||||
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT `title`, `body`, `php`' .
|
||||
' FROM `' . TABLE_PREFIX . 'pages`' .
|
||||
' WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1 AND `access` <= ' . $db->quote($logged_access));
|
||||
if($query->rowCount() > 0) // found page
|
||||
if($query['php'] == '1') // execute it as php code
|
||||
{
|
||||
$ignore = true;
|
||||
$query = $query->fetch();
|
||||
$title = $query['title'];
|
||||
|
||||
if($query['php'] == '1') // execute it as php code
|
||||
{
|
||||
$tmp = substr($query['body'], 0, 10);
|
||||
if(($pos = strpos($tmp, '<?php')) !== false) {
|
||||
$tmp = preg_replace('/<\?php/', '', $query['body'], 1);
|
||||
}
|
||||
else if(($pos = strpos($tmp, '<?')) !== false) {
|
||||
$tmp = preg_replace('/<\?/', '', $query['body'], 1);
|
||||
}
|
||||
else
|
||||
$tmp = $query['body'];
|
||||
|
||||
$php_errors = array();
|
||||
function error_handler($errno, $errstr) {
|
||||
global $php_errors;
|
||||
$php_errors[] = array('errno' => $errno, 'errstr' => $errstr);
|
||||
}
|
||||
set_error_handler('error_handler');
|
||||
|
||||
ob_start();
|
||||
eval($tmp);
|
||||
$content .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
restore_error_handler();
|
||||
if(isset($php_errors[0]) && superAdmin()) {
|
||||
var_dump($php_errors);
|
||||
}
|
||||
$tmp = substr($query['body'], 0, 10);
|
||||
if(($pos = strpos($tmp, '<?php')) !== false) {
|
||||
$tmp = preg_replace('/<\?php/', '', $query['body'], 1);
|
||||
}
|
||||
else if(($pos = strpos($tmp, '<?')) !== false) {
|
||||
$tmp = preg_replace('/<\?/', '', $query['body'], 1);
|
||||
}
|
||||
else
|
||||
$content .= $query['body']; // plain html
|
||||
$tmp = $query['body'];
|
||||
|
||||
$php_errors = array();
|
||||
function error_handler($errno, $errstr) {
|
||||
global $php_errors;
|
||||
$php_errors[] = array('errno' => $errno, 'errstr' => $errstr);
|
||||
}
|
||||
set_error_handler('error_handler');
|
||||
|
||||
ob_start();
|
||||
eval($tmp);
|
||||
$content .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
restore_error_handler();
|
||||
if(isset($php_errors[0]) && superAdmin()) {
|
||||
var_dump($php_errors);
|
||||
}
|
||||
}
|
||||
else
|
||||
$content .= $query['body']; // plain html
|
||||
}
|
||||
else
|
||||
{
|
||||
$file = SYSTEM . 'pages/' . $page . '.php';
|
||||
if(!@file_exists($file))
|
||||
{
|
||||
$page = '404';
|
||||
$file = SYSTEM . 'pages/404.php';
|
||||
|
@@ -11,15 +11,15 @@ CREATE TABLE `myaac_account_actions`
|
||||
CREATE TABLE `myaac_bugtracker`
|
||||
(
|
||||
`account` VARCHAR(255) NOT NULL,
|
||||
`type` INT(11) NOT NULL,
|
||||
`status` INT(11) NOT NULL,
|
||||
`type` INT(11) NOT NULL DEFAULT 0,
|
||||
`status` INT(11) NOT NULL DEFAULT 0,
|
||||
`text` text NOT NULL,
|
||||
`id` INT(11) NOT NULL,
|
||||
`subject` VARCHAR(255) NOT NULL,
|
||||
`reply` INT(11) NOT NULL,
|
||||
`who` INT(11) NOT NULL,
|
||||
`id` INT(11) NOT NULL DEFAULT 0,
|
||||
`subject` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`reply` INT(11) NOT NULL DEFAULT 0,
|
||||
`who` INT(11) NOT NULL DEFAULT 0,
|
||||
`uid` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`tag` INT(11) NOT NULL,
|
||||
`tag` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`uid`)
|
||||
) ENGINE = MyISAM;
|
||||
|
||||
@@ -67,7 +67,7 @@ CREATE TABLE `myaac_faq`
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = MyISAM;
|
||||
|
||||
CREATE TABLE `myaac_forum_sections`
|
||||
CREATE TABLE `myaac_forum_boards`
|
||||
(
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` VARCHAR(32) NOT NULL,
|
||||
@@ -77,11 +77,11 @@ CREATE TABLE `myaac_forum_sections`
|
||||
`hidden` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = MyISAM;
|
||||
INSERT INTO `myaac_forum_sections` (`id`, `name`, `description`, `closed`) VALUES (NULL, 'News', 'News commenting', 1);
|
||||
INSERT INTO `myaac_forum_sections` (`id`, `name`, `description`) VALUES (NULL, 'Trade', 'Trade offers.');
|
||||
INSERT INTO `myaac_forum_sections` (`id`, `name`, `description`) VALUES (NULL, 'Quests', 'Quest making.');
|
||||
INSERT INTO `myaac_forum_sections` (`id`, `name`, `description`) VALUES (NULL, 'Pictures', 'Your pictures.');
|
||||
INSERT INTO `myaac_forum_sections` (`id`, `name`, `description`) VALUES (NULL, 'Bug Report', 'Report bugs there.');
|
||||
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`, `closed`) VALUES (NULL, 'News', 'News commenting', 0, 1);
|
||||
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`) VALUES (NULL, 'Trade', 'Trade offers.', 1);
|
||||
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`) VALUES (NULL, 'Quests', 'Quest making.', 2);
|
||||
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`) VALUES (NULL, 'Pictures', 'Your pictures.', 3);
|
||||
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`) VALUES (NULL, 'Bug Report', 'Report bugs there.', 4);
|
||||
|
||||
CREATE TABLE `myaac_forum`
|
||||
(
|
||||
|
@@ -230,9 +230,9 @@ if(!$error) {
|
||||
$error = true;
|
||||
}
|
||||
|
||||
$content .= '$config[\'client_download\'] = \'http://clients.halfaway.net/windows.php?tibia=\'. $config[\'client\'];';
|
||||
$content .= '$config[\'client_download\'] = \'http://tibia-clients.com/clients/download/\'. $config[\'client\'] . \'/exe/windows\';';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '$config[\'client_download_linux\'] = \'http://clients.halfaway.net/linux.php?tibia=\'. $config[\'client\'];';
|
||||
$content .= '$config[\'client_download_linux\'] = \'http://tibia-clients.com/clients/download/\'. $config[\'client\'] . \'/tar/linux\';';
|
||||
$content .= PHP_EOL;
|
||||
$content .= '// place for your configuration directives, so you can later easily update myaac';
|
||||
$content .= PHP_EOL;
|
||||
|
@@ -146,31 +146,31 @@ INSERT INTO `myaac_news` (`id`, `type`, `date`, `category`, `title`, `body`, `pl
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Rook Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(!query($insert_into_players . "(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, '');"))
|
||||
if(!query($insert_into_players . "(null, 'Rook Sample', 1, 1, 1, 0, 150, 150, 4200, 118, 114, 38, 57, 130, 0, 0, 0, 0, 100, 11, 2200, 1298, 7, '', 400, 1, 1255179613, 2453925456, 1, 1255179614, 0, 0, UNIX_TIMESTAMP(), 1, '');"))
|
||||
$success = false;
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Sorcerer Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(!query($insert_into_players . "(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, '');"))
|
||||
if(!query($insert_into_players . "(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, 0, UNIX_TIMESTAMP(), 1, '');"))
|
||||
$success = false;
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Druid Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(!query($insert_into_players . "(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, '');"))
|
||||
if(!query($insert_into_players . "(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, 0, UNIX_TIMESTAMP(), 1, '');"))
|
||||
$success = false;
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Paladin Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(!query($insert_into_players . "(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, '');"))
|
||||
if(!query($insert_into_players . "(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, 0, UNIX_TIMESTAMP(), 1, '');"))
|
||||
$success = false;
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote('Knight Sample'));
|
||||
if($query->rowCount() == 0) {
|
||||
if(!query($insert_into_players . "(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, '');"))
|
||||
if(!query($insert_into_players . "(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, 0, UNIX_TIMESTAMP(), 1, '');"))
|
||||
$success = false;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -5,17 +5,26 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
function success($message) {
|
||||
function success($message, $return = false) {
|
||||
if($return)
|
||||
return '<p class="success">' . $message . '</p>';
|
||||
|
||||
echo '<p class="success">' . $message . '</p>';
|
||||
}
|
||||
function warning($message) {
|
||||
function warning($message, $return = false) {
|
||||
if($return)
|
||||
return '<p class="warning">' . $message . '</p>';
|
||||
|
||||
echo '<p class="warning">' . $message . '</p>';
|
||||
}
|
||||
function error($message) {
|
||||
function error($message, $return = false) {
|
||||
if($return)
|
||||
return '<p class="error">' . $message . '</p>';
|
||||
|
||||
echo '<p class="error">' . $message . '</p>';
|
||||
}
|
||||
|
||||
@@ -124,9 +133,7 @@ function getGuildLink($name, $generate = true)
|
||||
if(is_numeric($name))
|
||||
{
|
||||
$guild = $db->query(
|
||||
'SELECT ' . $db->fieldName('name') .
|
||||
' FROM ' . $db->tableName('guilds') .
|
||||
' WHERE ' . $db->fieldName('id') . ' = ' . (int)$name);
|
||||
'SELECT `name` FROM `guilds` WHERE `id` = ' . (int)$name);
|
||||
if($guild->rowCount() > 0)
|
||||
$name = $guild->fetchColumn();
|
||||
}
|
||||
@@ -218,10 +225,11 @@ function generateRandomString($length, $lowCase = true, $upCase = false, $numeri
|
||||
*
|
||||
* @return array Forum sections.
|
||||
*/
|
||||
function getForumSections()
|
||||
function getForumBoards()
|
||||
{
|
||||
global $db;
|
||||
$sections = $db->query('SELECT `id`, `name`, `description`, `closed` FROM ' . TABLE_PREFIX . 'forum_sections WHERE hidden != 1 ORDER BY `ordering`;');
|
||||
global $db, $canEdit;
|
||||
$sections = $db->query('SELECT `id`, `name`, `description`, `closed`' . ($canEdit ? ', `hidden`, `ordering`' : '') . ' FROM `' . TABLE_PREFIX . 'forum_boards` ' . (!$canEdit ? ' WHERE `hidden` != 1' : '') .
|
||||
' ORDER BY `ordering`;');
|
||||
if($sections)
|
||||
return $sections->fetchAll();
|
||||
|
||||
@@ -441,7 +449,7 @@ function check_name($name, &$error = '')
|
||||
return false;
|
||||
}
|
||||
|
||||
return preg_match("/[A-z ']{1,25}/", $name);
|
||||
return preg_match("/[A-z ']/", $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,7 +609,7 @@ function check_name_new_char($name, &$error = '')
|
||||
$player = new OTS_Player();
|
||||
$player->find($name);
|
||||
if($player->isLoaded()) {
|
||||
$error = 'Player with this name already exist.';
|
||||
$error = 'Character with this name already exist.';
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -614,28 +622,19 @@ function check_name_new_char($name, &$error = '')
|
||||
}
|
||||
}
|
||||
|
||||
$monsters = $db->query(
|
||||
'SELECT ' . $db->fieldName('name') .
|
||||
' FROM ' . $db->tableName(TABLE_PREFIX . 'monsters') .
|
||||
' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($name_lower));
|
||||
$monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||
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));
|
||||
$spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower));
|
||||
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));
|
||||
$spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower));
|
||||
if($spells_words->rowCount() > 0) {
|
||||
$error = 'Your name cannot contains spell name.';
|
||||
return false;
|
||||
@@ -751,28 +750,6 @@ function news_place()
|
||||
return $news;
|
||||
}
|
||||
|
||||
function output_errors($errors)
|
||||
{
|
||||
global $template_path;
|
||||
?>
|
||||
<div class="SmallBox" >
|
||||
<div class="MessageContainer" >
|
||||
<div class="BoxFrameHorizontal" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-horizontal.gif);" /></div>
|
||||
<div class="BoxFrameEdgeLeftTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></div>
|
||||
<div class="BoxFrameEdgeRightTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></div>
|
||||
<div class="ErrorMessage" >
|
||||
<div class="BoxFrameVerticalLeft" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" />
|
||||
</div>
|
||||
<div class="BoxFrameVerticalRight" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></div>
|
||||
<div class="AttentionSign" style="background-image:url(<?php echo $template_path; ?>/images/content/attentionsign.gif);" />
|
||||
</div><b>The Following Errors Have Occurred:</b><br/>
|
||||
<?php
|
||||
foreach($errors as $field => $message)
|
||||
echo $message . '<br/>';
|
||||
|
||||
echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Template place holder
|
||||
*
|
||||
@@ -823,11 +800,7 @@ function template_header($is_admin = false)
|
||||
Please turn it on, or be aware that some features on this website will not work correctly.</div>
|
||||
</noscript>
|
||||
';
|
||||
if(admin())
|
||||
$ret .= '<!--script type="text/javascript" src="' . BASE_URL . 'tools/tiny_mce/tiny_mce.js"></script>
|
||||
<script type="text/javascript" src="' . BASE_URL . 'tools/jquery.qtip.js" ></script>
|
||||
<script type="text/javascript" src="' . BASE_URL . 'tools/admin.js"></script-->
|
||||
';
|
||||
|
||||
if($config['recaptcha_enabled'])
|
||||
$ret .= "<script src='https://www.google.com/recaptcha/api.js'></script>";
|
||||
return $ret;
|
||||
@@ -838,13 +811,14 @@ function template_header($is_admin = false)
|
||||
*/
|
||||
function template_footer()
|
||||
{
|
||||
global $visitors, $config, $views_counter;
|
||||
global $config, $views_counter;
|
||||
$ret = '';
|
||||
if(admin())
|
||||
$ret .= generateLink(ADMIN_URL, 'Admin Panel', true);
|
||||
|
||||
if($config['visitors_counter'])
|
||||
{
|
||||
global $visitors;
|
||||
$amount = $visitors->getAmountVisitors();
|
||||
$ret .= '<br/>Currently there ' . ($amount > 1 ? 'are' : 'is') . ' ' . $amount . ' visitor' . ($amount > 1 ? 's' : '') . '.';
|
||||
}
|
||||
@@ -864,21 +838,11 @@ function template_footer()
|
||||
|
||||
function template_ga_code()
|
||||
{
|
||||
global $config;
|
||||
global $config, $twig;
|
||||
if(!isset($config['google_analytics_id'][0]))
|
||||
return '';
|
||||
|
||||
return "
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '" . $config['google_analytics_id'] . "', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>";
|
||||
return $twig->render('google_analytics.html.twig');
|
||||
}
|
||||
|
||||
function template_form()
|
||||
@@ -920,6 +884,8 @@ function getCreatureName($killer, $showStatus = false, $extendedInfo = false)
|
||||
{
|
||||
global $vowels, $ots, $config;
|
||||
$str = "";
|
||||
$players_rows = '';
|
||||
|
||||
if(is_numeric($killer))
|
||||
{
|
||||
$player = $ots->createObject('Player');
|
||||
@@ -1125,12 +1091,9 @@ function get_templates()
|
||||
function getWorldName($id)
|
||||
{
|
||||
global $config;
|
||||
foreach($config['worlds'] as $_id => $details)
|
||||
{
|
||||
if($id == $_id)
|
||||
return $details['name'];
|
||||
}
|
||||
|
||||
if(isset($config['worlds'][$id]))
|
||||
return $config['worlds'][$id];
|
||||
|
||||
return $config['lua']['serverName'];
|
||||
}
|
||||
|
||||
@@ -1202,7 +1165,7 @@ function convert_bytes($size)
|
||||
function log_append($file, $str)
|
||||
{
|
||||
$f = fopen(LOGS . $file, 'a');
|
||||
fwrite($f, $str . PHP_EOL);
|
||||
fwrite($f, '[' . date(DateTime::RFC1123) . '] ' . $str . PHP_EOL);
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
@@ -1214,18 +1177,53 @@ function load_config_lua($filename)
|
||||
if(!@file_exists($config_file))
|
||||
die('ERROR: Cannot find ' . $filename . ' file.');
|
||||
|
||||
$tempFile = @tempnam('/tmp', 'lua');
|
||||
$file = fopen($tempFile, 'w');
|
||||
if(!$file) die('Cannot load server config!');
|
||||
$result = array();
|
||||
$config_string = file_get_contents($filename);
|
||||
$config_string = str_replace("\r\n", "\n", $config_string);
|
||||
$config_string = str_replace("\r", "\n", $config_string);
|
||||
$lines = explode("\n", $config_string);
|
||||
if(count($lines) > 0)
|
||||
foreach($lines as $ln => $line)
|
||||
{
|
||||
$tmp_exp = explode('=', $line, 2);
|
||||
if(strpos($line, 'dofile') !== false)
|
||||
{
|
||||
$delimiter = '"';
|
||||
if(strpos($line, $delimiter) === false)
|
||||
$delimiter = "'";
|
||||
|
||||
$tmp = explode($delimiter, $line);
|
||||
$result = array_merge($result, load_config_lua($config['server_path'] . $tmp[1]));
|
||||
}
|
||||
else if(count($tmp_exp) >= 2)
|
||||
{
|
||||
$key = trim($tmp_exp[0]);
|
||||
if(substr($key, 0, 2) != '--')
|
||||
{
|
||||
$value = trim($tmp_exp[1]);
|
||||
if(is_numeric($value))
|
||||
$result[$key] = (float) $value;
|
||||
elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"')))
|
||||
$result[$key] = (string) substr(substr($value, 1), 0, -1);
|
||||
elseif(in_array($value, array('true', 'false')))
|
||||
$result[$key] = ($value == 'true') ? true : false;
|
||||
else
|
||||
{
|
||||
foreach($result as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
|
||||
$value = str_replace($tmp_key, $tmp_value, $value);
|
||||
$ret = @eval("return $value;");
|
||||
if((string) $ret == '') // = parser error
|
||||
{
|
||||
die('ERROR: Loading config.lua file. Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]');
|
||||
}
|
||||
$result[$key] = $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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)));
|
||||
fclose($file);
|
||||
|
||||
$result = array_merge(parse_ini_file($tempFile, true), isset($config['lua']) ? $config['lua'] : array());
|
||||
@unlink($tempFile);
|
||||
$result = array_merge($result, isset($config['lua']) ? $config['lua'] : array());
|
||||
return $result;
|
||||
}
|
||||
?>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -46,7 +46,7 @@ class Hook
|
||||
$ret = $tmp($params);
|
||||
}*/
|
||||
|
||||
global $db, $config, $template_path, $ots;
|
||||
global $db, $config, $template_path, $ots, $content;
|
||||
if(file_exists(BASE . $this->_file)) {
|
||||
require(BASE . $this->_file);
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -14,12 +14,13 @@ require_once(BASE . 'config.php');
|
||||
if(file_exists(BASE . 'config.local.php')) // user customizations
|
||||
require(BASE . 'config.local.php');
|
||||
|
||||
date_default_timezone_set($config['date_timezone']);
|
||||
// take care of trailing slash at the end
|
||||
if($config['server_path'][strlen($config['server_path']) - 1] != '/')
|
||||
$config['server_path'] .= '/';
|
||||
|
||||
// enable gzip compression if supported by the browser
|
||||
if($config['gzip_output'] && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) && function_exists('ob_gzhandler'))
|
||||
if($config['gzip_output'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && function_exists('ob_gzhandler'))
|
||||
ob_start('ob_gzhandler');
|
||||
|
||||
// cache
|
||||
@@ -30,9 +31,10 @@ $cache = Cache::getInstance($config['cache_engine'], $config['cache_prefix']);
|
||||
require_once LIBS . 'Twig/Autoloader.php';
|
||||
Twig_Autoloader::register();
|
||||
|
||||
$loader = new Twig_Loader_Filesystem(SYSTEM . 'templates');
|
||||
$twig = new Twig_Environment($loader, array(
|
||||
$twig_loader = new Twig_Loader_Filesystem(SYSTEM . 'templates');
|
||||
$twig = new Twig_Environment($twig_loader, array(
|
||||
'cache' => CACHE . 'twig/',
|
||||
'auto_reload' => true
|
||||
));
|
||||
|
||||
$function = new Twig_SimpleFunction('getStyle', function ($i) {
|
||||
@@ -86,10 +88,12 @@ unset($tmp);
|
||||
if(isset($config['lua']['servername']))
|
||||
$config['lua']['serverName'] = $config['lua']['servername'];
|
||||
|
||||
|
||||
if(isset($config['lua']['houserentperiod']))
|
||||
$config['lua']['houseRentPeriod'] = $config['lua']['houserentperiod'];
|
||||
|
||||
if($config['item_images_url'][strlen($config['item_images_url']) - 1] != '/')
|
||||
$config['item_images_url'] .= '/';
|
||||
|
||||
// localize data/ directory
|
||||
if(isset($config['lua']['dataDirectory'][0]))
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -47,7 +47,7 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
*
|
||||
* @param DOMElement $group Group info.
|
||||
*/
|
||||
public function __construct($data)
|
||||
public function __construct($data = array())
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
@@ -51,6 +51,12 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
global $config;
|
||||
$file = $config['data_path'] . 'XML/groups.xml';
|
||||
}
|
||||
|
||||
if(!@file_exists($file)) {
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). It doesnt exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
global $cache;
|
||||
|
||||
@@ -63,7 +69,11 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
else
|
||||
{
|
||||
$groups = new DOMDocument();
|
||||
$groups->load($file);
|
||||
if(!@$groups->load($file)) {
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). Error: ' . print_r(error_get_last(), true));
|
||||
return;
|
||||
}
|
||||
|
||||
// loads groups
|
||||
foreach( $groups->getElementsByTagName('group') as $group)
|
||||
@@ -85,8 +95,12 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
{
|
||||
// loads DOM document
|
||||
$groups = new DOMDocument();
|
||||
$groups->load($file);
|
||||
|
||||
if(!@$groups->load($file)) {
|
||||
error('Error: Cannot load groups.xml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', '[OTS_Groups_List.php] Fatal error: Cannot load groups.xml (' . $file . '). Error: ' . print_r(error_get_last(), true));
|
||||
return;
|
||||
}
|
||||
|
||||
// loads groups
|
||||
foreach($groups->getElementsByTagName('group') as $group)
|
||||
{
|
||||
|
@@ -644,7 +644,8 @@ class OTS_Player extends OTS_Row_DAO
|
||||
if($tmp)
|
||||
return $tmp;
|
||||
|
||||
echo 'error while loading group..';
|
||||
return new OTS_Group();
|
||||
// echo 'error while loading group..';
|
||||
/*
|
||||
$_id = $this->data['group_id'];
|
||||
$tmpGroup = new OTS_Group;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -74,8 +74,8 @@ else
|
||||
$_SESSION['remember_me'] = true;
|
||||
|
||||
$logged = true;
|
||||
|
||||
$logged_flags = $account_logged->getWebFlags();
|
||||
|
||||
if(isset($_POST['admin']) && !admin()) {
|
||||
$errors[] = 'This account has no admin privileges.';
|
||||
unset($_SESSION['account']);
|
||||
@@ -114,25 +114,29 @@ else
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// stay-logged with sessions
|
||||
if(isset($_SESSION['account']))
|
||||
{
|
||||
$account_logged = $ots->createObject('Account');
|
||||
$account_logged = new OTS_Account();
|
||||
$account_logged->load($_SESSION['account']);
|
||||
if($account_logged->isLoaded() && $account_logged->getPassword() == $_SESSION['password']
|
||||
//&& (!isset($_SESSION['admin']) || admin())
|
||||
&& (isset($_SESSION['remember_me']) || $_SESSION['last_visit'] > time() - 15 * 60)) // login for 15 minutes if "remember me" is not used
|
||||
&& (isset($_SESSION['remember_me']) || $_SESSION['last_visit'] > time() - 15 * 60)) { // login for 15 minutes if "remember me" is not used
|
||||
$logged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logged = false;
|
||||
unset($_SESSION['account']);
|
||||
unset($account_logged);
|
||||
}
|
||||
}
|
||||
|
||||
if($logged)
|
||||
|
||||
if($logged) {
|
||||
$logged_flags = $account_logged->getWebFlags();
|
||||
$twig->addGlobal('account_logged', $account_logged);
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['last_visit'] = time();
|
||||
|
18
system/migrations/8.php
Normal file
18
system/migrations/8.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
if(tableExist(TABLE_PREFIX . 'forum_sections'))
|
||||
$db->query('RENAME TABLE `' . TABLE_PREFIX . 'forum_sections` TO `' . TABLE_PREFIX . 'forum_boards`;');
|
||||
|
||||
$query = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'forum_boards` WHERE `ordering` > 0;');
|
||||
if($query->rowCount() == 0) {
|
||||
$boards = array(
|
||||
'News',
|
||||
'Trade',
|
||||
'Quests',
|
||||
'Pictures',
|
||||
'Bug Report'
|
||||
);
|
||||
|
||||
foreach($boards as $id => $board)
|
||||
$db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board));
|
||||
}
|
||||
?>
|
9
system/migrations/9.php
Normal file
9
system/migrations/9.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `type` INT(11) NOT NULL DEFAULT 0;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `status` INT(11) NOT NULL DEFAULT 0;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `id` INT(11) NOT NULL DEFAULT 0;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `subject` VARCHAR(255) NOT NULL DEFAULT '';");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `reply` INT(11) NOT NULL DEFAULT 0;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `who` INT(11) NOT NULL DEFAULT 0;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "bugtracker` MODIFY `tag` INT(11) NOT NULL DEFAULT 0;");
|
||||
?>
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -48,7 +48,7 @@ $tmp = '';
|
||||
if(fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
$closed_message = $tmp;
|
||||
|
||||
echo $twig->render('admin.dashboard.html', array(
|
||||
echo $twig->render('admin.dashboard.html.twig', array(
|
||||
'is_closed' => $is_closed,
|
||||
'closed_message' => $closed_message,
|
||||
'status' => $status
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -20,5 +20,5 @@ if(isset($errors)) {
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('admin.login.html');
|
||||
echo $twig->render('admin.login.html.twig');
|
||||
?>
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -38,7 +38,7 @@ if($preview) {
|
||||
}
|
||||
|
||||
|
||||
echo $twig->render('admin.mailer.html', array(
|
||||
echo $twig->render('admin.mailer.html.twig', array(
|
||||
'mail_subject' => $mail_subject,
|
||||
'mail_content' => $mail_content,
|
||||
'preview_done' => $preview_done
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -28,7 +28,7 @@ else
|
||||
$_content = $notepad_content;
|
||||
}
|
||||
|
||||
echo $twig->render('admin.notepad.html', array('content' => isset($_content) ? $_content : null));
|
||||
echo $twig->render('admin.notepad.html.twig', array('content' => isset($_content) ? $_content : null));
|
||||
|
||||
class Notepad
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -81,7 +81,7 @@ if(!empty($action))
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -13,7 +13,7 @@ $title = 'Plugin manager';
|
||||
|
||||
require(SYSTEM . 'hooks.php');
|
||||
|
||||
echo $twig->render('admin.plugins.form.html');
|
||||
echo $twig->render('admin.plugins.form.html.twig');
|
||||
|
||||
$message = '';
|
||||
if(isset($_FILES["plugin"]["name"]))
|
||||
@@ -24,28 +24,28 @@ if(isset($_FILES["plugin"]["name"]))
|
||||
$type = $file["type"];
|
||||
|
||||
$name = explode(".", $filename);
|
||||
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
|
||||
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed', 'application/octet-stream', 'application/zip-compressed');
|
||||
|
||||
if(isset($file['error'])) {
|
||||
$error = 'Error uploading file';
|
||||
switch( $file['error'] ) {
|
||||
case UPLOAD_ERR_OK:
|
||||
$error = false;
|
||||
break;
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$error .= ' - file too large (limit of '.ini_get('upload_max_filesize').' bytes).';
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$error .= ' - file upload was not completed.';
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$error .= ' - zero-length file uploaded.';
|
||||
break;
|
||||
default:
|
||||
$error .= ' - internal error #' . $file['error'];
|
||||
break;
|
||||
}
|
||||
$error = 'Error uploading file';
|
||||
switch( $file['error'] ) {
|
||||
case UPLOAD_ERR_OK:
|
||||
$error = false;
|
||||
break;
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$error .= ' - file too large (limit of '.ini_get('upload_max_filesize').' bytes).';
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$error .= ' - file upload was not completed.';
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$error .= ' - zero-length file uploaded.';
|
||||
break;
|
||||
default:
|
||||
$error .= ' - internal error #' . $file['error'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($error) && $error != false) {
|
||||
@@ -53,7 +53,7 @@ if(isset($_FILES["plugin"]["name"]))
|
||||
}
|
||||
else {
|
||||
if(is_uploaded_file($file['tmp_name']) ) {
|
||||
if(in_array($type, $accepted_types) && strtolower($name[1]) == 'zip') // check if it is zipped/compressed file
|
||||
if(strtolower($name[1]) == 'zip') // check if it is zipped/compressed file
|
||||
{
|
||||
$targetdir = BASE;
|
||||
$targetzip = BASE . 'plugins/' . $name[0] . '.zip';
|
||||
@@ -62,37 +62,51 @@ if(isset($_FILES["plugin"]["name"]))
|
||||
$zip = new ZipArchive();
|
||||
$x = $zip->open($targetzip); // open the zip file to extract
|
||||
if ($x === true) {
|
||||
if($zip->extractTo($targetdir)) { // place in the directory with same name
|
||||
$string = file_get_contents(BASE . 'plugins/' . $name[0] . '.json');
|
||||
$plugin = json_decode($string, true);
|
||||
if($plugin == NULL) {
|
||||
warning('Cannot load ' . BASE . 'plugins/' . $name[0] . '.json. File might be not valid json code.');
|
||||
}
|
||||
|
||||
if(isset($plugin['install'])) {
|
||||
if(file_exists(BASE . $plugin['install']))
|
||||
require(BASE . $plugin['install']);
|
||||
else
|
||||
warning('Cannot load install script. Your plugin might be not working correctly.');
|
||||
}
|
||||
|
||||
if(isset($plugin['hooks'])) {
|
||||
foreach($plugin['hooks'] as $_name => $info) {
|
||||
if(isset($hook_types[$info['type']])) {
|
||||
$query = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'hooks` WHERE `name` = ' . $db->quote($_name) . ';');
|
||||
if($query->rowCount() == 1) { // found something
|
||||
$query = $query->fetch();
|
||||
$db->query('UPDATE `' . TABLE_PREFIX . 'hooks` SET `type` = ' . $hook_types[$info['type']] . ', `file` = ' . $db->quote($info['file']) . ' WHERE `id` = ' . (int)$query['id'] . ';');
|
||||
}
|
||||
else {
|
||||
$db->query('INSERT INTO `' . TABLE_PREFIX . 'hooks` (`id`, `name`, `type`, `file`) VALUES (NULL, ' . $db->quote($_name) . ', ' . $hook_types[$info['type']] . ', ' . $db->quote($info['file']) . ');');
|
||||
}
|
||||
}
|
||||
else
|
||||
warning('Unknown event type: ' . $info['type']);
|
||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||
$tmp = $zip->getNameIndex($i);
|
||||
if(pathinfo($tmp, PATHINFO_DIRNAME) == 'plugins' && pathinfo($tmp, PATHINFO_EXTENSION) == 'json')
|
||||
$json_file = $tmp;
|
||||
}
|
||||
|
||||
if(!isset($json_file)) {
|
||||
error('Cannot find plugin info .json file. Installation is discontinued.');
|
||||
}
|
||||
else if($zip->extractTo($targetdir)) { // place in the directory with same name
|
||||
$file_name = BASE . $json_file;
|
||||
if(!file_exists($file_name))
|
||||
warning("Cannot load " . $file_name . ". File doesn't exist.");
|
||||
else {
|
||||
$string = file_get_contents($file_name);
|
||||
$plugin = json_decode($string, true);
|
||||
if ($plugin == null) {
|
||||
warning('Cannot load ' . $file_name . '. File might be not valid json code.');
|
||||
}
|
||||
|
||||
if(isset($plugin['install'])) {
|
||||
if(file_exists(BASE . $plugin['install']))
|
||||
require(BASE . $plugin['install']);
|
||||
else
|
||||
warning('Cannot load install script. Your plugin might be not working correctly.');
|
||||
}
|
||||
|
||||
if(isset($plugin['hooks'])) {
|
||||
foreach($plugin['hooks'] as $_name => $info) {
|
||||
if(isset($hook_types[$info['type']])) {
|
||||
$query = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'hooks` WHERE `name` = ' . $db->quote($_name) . ';');
|
||||
if($query->rowCount() == 1) { // found something
|
||||
$query = $query->fetch();
|
||||
$db->query('UPDATE `' . TABLE_PREFIX . 'hooks` SET `type` = ' . $hook_types[$info['type']] . ', `file` = ' . $db->quote($info['file']) . ' WHERE `id` = ' . (int)$query['id'] . ';');
|
||||
}
|
||||
else {
|
||||
$db->query('INSERT INTO `' . TABLE_PREFIX . 'hooks` (`id`, `name`, `type`, `file`) VALUES (NULL, ' . $db->quote($_name) . ', ' . $hook_types[$info['type']] . ', ' . $db->quote($info['file']) . ');');
|
||||
}
|
||||
}
|
||||
else
|
||||
warning('Unknown event type: ' . $info['type']);
|
||||
}
|
||||
}
|
||||
success('<strong>' . $plugin['name'] . '</strong> plugin has been successfully installed.');
|
||||
}
|
||||
success('<strong>' . $plugin['name'] . '</strong> plugin has been successfully installed.');
|
||||
}
|
||||
else {
|
||||
error('There was a problem with extracting zip archive.');
|
||||
@@ -142,7 +156,7 @@ foreach(scandir($path) as $file)
|
||||
);
|
||||
}
|
||||
|
||||
echo $twig->render('admin.plugins.html', array(
|
||||
echo $twig->render('admin.plugins.html.twig', array(
|
||||
'plugins' => $rows
|
||||
));
|
||||
?>
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -29,7 +29,7 @@ $total_houses = $query['how_much'];
|
||||
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
|
||||
echo $twig->render('admin.statistics.html', array(
|
||||
echo $twig->render('admin.statistics.html.twig', array(
|
||||
'total_accounts' => $total_accounts,
|
||||
'total_players' => $total_players,
|
||||
'total_guilds' => $total_guilds,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -29,7 +29,7 @@ function compare($a, $b) {
|
||||
$tmp = $visitors->getVisitors();
|
||||
usort($tmp, 'compare');
|
||||
|
||||
echo $twig->render('admin.visitors.html', array(
|
||||
echo $twig->render('admin.visitors.html.twig', array(
|
||||
'config_visitors_counter_ttl' => $config['visitors_counter_ttl'],
|
||||
'visitors' => $tmp
|
||||
));
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -149,7 +149,7 @@ function getBanReason($reasonId)
|
||||
|
||||
function getBanType($typeId)
|
||||
{
|
||||
switch($reasonId)
|
||||
switch($typeId)
|
||||
{
|
||||
case 1:
|
||||
return "IP Banishment";
|
||||
|
@@ -6,14 +6,19 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Bug tracker';
|
||||
|
||||
if($logged)
|
||||
if(!$logged)
|
||||
{
|
||||
echo 'You are not logged in. <a href="?subtopic=accountmanagement&redirect=' . BASE_URL . urlencode('?subtopic=bugtracker') . '">Log in</a> to post on the bug tracker.<br /><br />';
|
||||
return;
|
||||
}
|
||||
|
||||
$showed = $post = $reply = false;
|
||||
// type (1 = question; 2 = answer)
|
||||
// status (1 = open; 2 = new message; 3 = closed;)
|
||||
|
||||
@@ -22,7 +27,7 @@ if($logged)
|
||||
|
||||
$tags = array(1 => "[MAP]", "[WEBSITE]", "[CLIENT]", "[MONSTER]", "[NPC]", "[OTHER]");
|
||||
|
||||
if(admin() and $_REQUEST['control'] == "true")
|
||||
if(admin() and isset($_REQUEST['control']) && $_REQUEST['control'] == "true")
|
||||
{
|
||||
if(empty($_REQUEST['id']) and empty($_REQUEST['acc']) or !is_numeric($_REQUEST['acc']) or !is_numeric($_REQUEST['id']) )
|
||||
$bug[1] = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'bugtracker').' where `type` = 1 order by `uid` desc');
|
||||
@@ -35,7 +40,7 @@ if($logged)
|
||||
if(!empty($_REQUEST['reply']))
|
||||
$reply=true;
|
||||
|
||||
$account = $ots->createObject('Account');
|
||||
$account = new OTS_Account();
|
||||
$account->load($_REQUEST['acc']);
|
||||
$account->isLoaded();
|
||||
$players = $account->getPlayersList();
|
||||
@@ -182,7 +187,7 @@ if($logged)
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br($bug[2]['text']).'</td></tr>';
|
||||
echo '</TABLE>';
|
||||
|
||||
$answers = $db->query('SELECT * FROM '.$db->tableName('wodzaac_bugtracker').' where `account` = '.$account_logged->getId().' and `id` = '.$id.' and `type` = 2 order by `reply`');
|
||||
$answers = $db->query('SELECT * FROM '.$db->tableName('myaac_bugtracker').' where `account` = '.$account_logged->getId().' and `id` = '.$id.' and `type` = 2 order by `reply`');
|
||||
foreach($answers as $answer)
|
||||
{
|
||||
if($answer['who'] == 1)
|
||||
@@ -205,7 +210,7 @@ if($logged)
|
||||
{
|
||||
$reply = $db->query('SELECT MAX(reply) FROM `' . TABLE_PREFIX . 'bugtracker` where `account` = '.$acc.' and `id` = '.$id.' and `type` = 2')->fetch();
|
||||
$reply = $reply[0] + 1;
|
||||
$iswho = $db->query('SELECT * FROM `wodzaac_bugtracker` where `account` = '.$acc.' and `id` = '.$id.' and `type` = 2 order by `reply` desc limit 1')->fetch();
|
||||
$iswho = $db->query('SELECT * FROM `myaac_bugtracker` where `account` = '.$acc.' and `id` = '.$id.' and `type` = 2 order by `reply` desc limit 1')->fetch();
|
||||
|
||||
if(isset($_POST['finish']))
|
||||
{
|
||||
@@ -224,8 +229,8 @@ if($logged)
|
||||
else
|
||||
{
|
||||
$type = 2;
|
||||
$INSERT = $db->query('INSERT INTO `wodzaac_bugtracker` (`account`,`id`,`text`,`reply`,`type`) VALUES ('.$db->quote($acc).','.$db->quote($id).','.$db->quote($_POST['text']).','.$db->quote($reply).','.$db->quote($type).')');
|
||||
$UPDATE = $db->query('UPDATE `wodzaac_bugtracker` SET `status` = 1 where `account` = '.$acc.' and `id` = '.$id.'');
|
||||
$INSERT = $db->query('INSERT INTO `myaac_bugtracker` (`account`,`id`,`text`,`reply`,`type`) VALUES ('.$db->quote($acc).','.$db->quote($id).','.$db->quote($_POST['text']).','.$db->quote($reply).','.$db->quote($type).')');
|
||||
$UPDATE = $db->query('UPDATE `myaac_bugtracker` SET `status` = 1 where `account` = '.$acc.' and `id` = '.$id.'');
|
||||
header('Location: index.php?subtopic=bugtracker&id='.$id.'');
|
||||
}
|
||||
}
|
||||
@@ -249,7 +254,7 @@ if($logged)
|
||||
|
||||
if(!$post)
|
||||
{
|
||||
if($_REQUEST['add'] != TRUE)
|
||||
if(!isset($_REQUEST['add']) || $_REQUEST['add'] != TRUE)
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD colspan=2 CLASS=white><B>Bug Tracker</B></TD></TR>';
|
||||
foreach($bug[1] as $report)
|
||||
@@ -283,9 +288,9 @@ if($logged)
|
||||
|
||||
echo '<br><a href="index.php?subtopic=bugtracker&add=true"><b>[ADD REPORT]</b></a>';
|
||||
}
|
||||
elseif($_REQUEST['add'] == TRUE)
|
||||
elseif(isset($_REQUEST['add']) && $_REQUEST['add'] == TRUE)
|
||||
{
|
||||
$thread = $db->query('SELECT * FROM `' TABLE_PREFIX . 'bugtracker` where `account` = '.$acc.' and `type` = 1 order by `id` desc')->fetch();
|
||||
$thread = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'bugtracker` where `account` = '.$acc.' and `type` = 1 order by `id` desc')->fetch();
|
||||
$id_next = $db->query('SELECT MAX(id) FROM `' . TABLE_PREFIX . 'bugtracker` where `account` = '.$acc.' and `type` = 1')->fetch();
|
||||
$id_next = $id_next[0] + 1;
|
||||
|
||||
@@ -314,7 +319,7 @@ if($logged)
|
||||
{
|
||||
$type = 1;
|
||||
$status = 1;
|
||||
$INSERT = $db->query('INSERT INTO `' . TABLE_PREFIX . 'bugtracker` (`account`,`id`,`text`,`type`,`subject`,`status`,`tag`) VALUES ('.$db->quote($acc).','.$db->quote($id_next).','.$db->quote($_POST['text']).','.$db->quote($type).','.$db->quote($_POST['subject']).','.$db->quote($status).','.$db->quote($_POST['tags']).')');
|
||||
$INSERT = $db->query('INSERT INTO `' . TABLE_PREFIX . 'bugtracker` (`account`,`id`,`text`,`type`,`subject`, `reply`,`status`,`tag`) VALUES ('.$db->quote($acc).','.$db->quote($id_next).','.$db->quote($_POST['text']).','.$db->quote($type).','.$db->quote($_POST['subject']).', 0,'.$db->quote($status).','.$db->quote($_POST['tags']).')');
|
||||
header('Location: index.php?subtopic=bugtracker&id='.$id_next.'');
|
||||
}
|
||||
|
||||
@@ -335,9 +340,4 @@ if($logged)
|
||||
{
|
||||
echo '<br><br><a href="index.php?subtopic=bugtracker&control=true">[ADMIN PANEL]</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=bugtracker" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Login</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$template_path.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';
|
||||
}
|
||||
?>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -69,15 +69,13 @@ if($canEdit)
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
echo $twig->render('commands.form.html', array(
|
||||
echo $twig->render('commands.form.html.twig', array(
|
||||
'link' => getPageLink('commands', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'action' => $action,
|
||||
'id' => isset($id) ? $id : null,
|
||||
'vdarkborder' => $config['vdarkborder'],
|
||||
'darkborder' => $config['darkborder'],
|
||||
'words' => isset($words) ? $words : null,
|
||||
'description' => isset($description) ? $description : null
|
||||
));
|
||||
@@ -91,7 +89,7 @@ $commands =
|
||||
' ORDER BY `ordering`;');
|
||||
|
||||
$last = $commands->rowCount();
|
||||
echo $twig->render('commands.html', array(
|
||||
echo $twig->render('commands.html.twig', array(
|
||||
'commands' => $commands,
|
||||
'last' => $last,
|
||||
'canEdit' => $canEdit,
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -21,6 +21,7 @@ if($logged)
|
||||
return;
|
||||
}
|
||||
|
||||
$errors = array();
|
||||
$step = isset($_POST['step']) ? $_POST['step'] : '';
|
||||
if($step == 'save')
|
||||
{
|
||||
@@ -37,24 +38,23 @@ if($step == 'save')
|
||||
|
||||
// account
|
||||
if(isset($account_id)) {
|
||||
if(!check_number($account_id))
|
||||
if(empty($account_id))
|
||||
$errors['account'] = 'Please enter your account number!';
|
||||
else if(!check_number($account_id))
|
||||
$errors['account'] = 'Invalid account number format. Please use only numbers 0-9.';
|
||||
}
|
||||
else {
|
||||
if(empty($account_name))
|
||||
$errors['account'] = 'Please enter your account name!';
|
||||
elseif(!check_account_name($account_name_up))
|
||||
else if(!check_account_name($account_name_up))
|
||||
$errors['account'] = 'Invalid account name format. Please use only A-Z and numbers 0-9.';
|
||||
}
|
||||
|
||||
// email
|
||||
if(empty($email))
|
||||
$errors['email'] = 'Please enter your email address!';
|
||||
else
|
||||
{
|
||||
if(!check_mail($email))
|
||||
$errors['email'] = 'E-mail address is not correct.';
|
||||
}
|
||||
else if(!check_mail($email))
|
||||
$errors['email'] = 'Email address is not correct.';
|
||||
|
||||
// country
|
||||
$country = '';
|
||||
@@ -62,7 +62,7 @@ if($step == 'save')
|
||||
{
|
||||
$country = $_POST['country'];
|
||||
if(!isset($country))
|
||||
$errors['country'] = 'Country is not set';
|
||||
$errors['country'] = 'Country is not set.';
|
||||
elseif(!isset($config['countries'][$country]))
|
||||
$errors['country'] = 'Country is invalid.';
|
||||
}
|
||||
@@ -74,10 +74,10 @@ if($step == 'save')
|
||||
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$config['recaptcha_secret_key'].'&response='.$_POST['g-recaptcha-response']);
|
||||
$responseData = json_decode($verifyResponse);
|
||||
if(!$responseData->success)
|
||||
$errors['verification'] = 'Please confirm that your not a robot.';
|
||||
$errors['verification'] = "Please confirm that you're not a robot.";
|
||||
}
|
||||
else
|
||||
$errors['verification'] = 'Please confirm that your not a robot.';
|
||||
$errors['verification'] = "Please confirm that you're not a robot.";
|
||||
}
|
||||
|
||||
// password
|
||||
@@ -101,7 +101,7 @@ if($step == 'save')
|
||||
{
|
||||
if($config['account_mail_unique'])
|
||||
{
|
||||
$test_email_account = $ots->createObject('Account');
|
||||
$test_email_account = new OTS_Account();
|
||||
$test_email_account->findByEmail($email);
|
||||
if($test_email_account->isLoaded())
|
||||
$errors['email'] = 'Account with this e-mail address already exist.';
|
||||
@@ -126,7 +126,7 @@ if($step == 'save')
|
||||
|
||||
if(empty($errors))
|
||||
{
|
||||
$new_account = $ots->createObject('Account');
|
||||
$new_account = new OTS_Account();
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$new_account->create($account_name);
|
||||
else
|
||||
@@ -172,44 +172,21 @@ if($step == 'save')
|
||||
$verify_url = BASE_URL . '?p=account&action=confirm_email&v=' . $hash;
|
||||
$server_name = $config['lua']['serverName'];
|
||||
|
||||
$body_plain = "Hello!
|
||||
$body_plain = $twig->render('mail.account.verify.plain.html.twig', array(
|
||||
'account' => $tmp_account,
|
||||
'verify_url' => $verify_url
|
||||
));
|
||||
|
||||
Thank you for registering on $server_name!
|
||||
|
||||
Here are the details of your account:
|
||||
Account" . (USE_ACCOUNT_NAME ? ' Name' : '') . ": $tmp_account
|
||||
Password: ************ (hidden for security reasons)
|
||||
|
||||
To verify your email address please click the link below:
|
||||
$verify_url
|
||||
If you haven't registered on $server_name please ignore this email.";
|
||||
|
||||
$body_html = 'Hello!<br/>
|
||||
<br/>
|
||||
Thank you for registering on ' . $config['lua']['serverName'] . '!<br/>
|
||||
<br/>
|
||||
Here are the details of your account:<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/>
|
||||
' . generateLink($verify_url, $verify_url, true) . '<br/>
|
||||
If you haven\'t registered on ' . $config['lua']['serverName'] . ' please ignore this email.';
|
||||
$body_html = $twig->render('mail.account.verify.html.twig', array(
|
||||
'account' => $tmp_account,
|
||||
'verify_url' => generateLink($verify_url, $verify_url, true)
|
||||
));
|
||||
|
||||
if(_mail($email, 'New account on ' . $config['lua']['serverName'], $body_html, $body_plain))
|
||||
{
|
||||
?>
|
||||
Your account has been created.<br/><br/>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<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<?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?> is <b><?php echo $tmp_account; ?></b>.
|
||||
|
||||
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
|
||||
echo $twig->render('account.created.verify.html.twig', array(
|
||||
'account' => $tmp_account
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -219,25 +196,15 @@ If you haven\'t registered on ' . $config['lua']['serverName'] . ' please ignore
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Your account has been created. Now you can login and create your first character. See you in Tibia!<br/><br/>';
|
||||
echo '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
|
||||
<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 ' . (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/>';
|
||||
|
||||
echo $twig->render('account.created.html.twig', array(
|
||||
'account' => $tmp_account
|
||||
));
|
||||
|
||||
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>
|
||||
<br/><br/>
|
||||
Your login details:
|
||||
<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>';
|
||||
$mailBody = $twig->render('account.welcome_mail.html.twig', array(
|
||||
'account' => $tmp_account
|
||||
));
|
||||
|
||||
if(_mail($email, 'Your account on ' . $config['lua']['serverName'], $mailBody))
|
||||
echo '<br /><small>These informations were send on email address <b>' . $email . '</b>.';
|
||||
@@ -245,326 +212,40 @@ If you haven\'t registered on ' . $config['lua']['serverName'] . ' please ignore
|
||||
echo '<br /><p class="error">An error occorred while sending email (<b>' . $email . '</b>)! Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
||||
}
|
||||
}
|
||||
echo '</TD></TR></TABLE></TD></TR></TABLE><br/><br/>';
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
eventId = 0;
|
||||
lastSend = 0;
|
||||
|
||||
$('#createaccount').submit(function(){
|
||||
return validate_form(this);
|
||||
});
|
||||
|
||||
function checkAccount()
|
||||
{
|
||||
if(eventId != 0)
|
||||
{
|
||||
clearInterval(eventId);
|
||||
eventId = 0;
|
||||
}
|
||||
|
||||
if(document.getElementById("account_input").value == "")
|
||||
{
|
||||
document.getElementById("acc_check").innerHTML = '<b><font color="red">Please enter account<?php echo (USE_ACCOUNT_NAME ? ' name' : 'number'); ?>.</font></b>';
|
||||
return;
|
||||
}
|
||||
|
||||
// anti flood
|
||||
date = new Date;
|
||||
timeNow = parseInt(date.getTime());
|
||||
|
||||
if(lastSend != 0)
|
||||
{
|
||||
if(timeNow - lastSend < 1100)
|
||||
{
|
||||
eventId = setInterval('checkAccount()', 1100)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
account = document.getElementById("account_input").value;
|
||||
$.get("tools/validate.php", { account: account, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("acc_check").innerHTML = data;
|
||||
lastSend = timeNow;
|
||||
});
|
||||
}
|
||||
|
||||
function checkEmail()
|
||||
{
|
||||
if(eventId != 0)
|
||||
{
|
||||
clearInterval(eventId)
|
||||
eventId = 0;
|
||||
}
|
||||
|
||||
if(document.getElementById("email").value == "")
|
||||
{
|
||||
document.getElementById("email_check").innerHTML = '<b><font color="red">Please enter e-mail.</font></b>';
|
||||
return;
|
||||
}
|
||||
|
||||
//anti flood
|
||||
date = new Date;
|
||||
timeNow = parseInt(date.getTime());
|
||||
|
||||
if(lastSend != 0)
|
||||
{
|
||||
if(timeNow - lastSend < 1100)
|
||||
{
|
||||
eventId = setInterval('checkEmail()', 1100)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
email = document.getElementById("email").value;
|
||||
$.get("tools/validate.php", { email: email, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("email_check").innerHTML = data;
|
||||
lastSend = timeNow;
|
||||
});
|
||||
}
|
||||
|
||||
function validate_required(field,alerttxt)
|
||||
{
|
||||
with (field)
|
||||
{
|
||||
if (value==null || value=="" || value==" ")
|
||||
{
|
||||
alert(alerttxt);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
function validate_email(field,alerttxt)
|
||||
{
|
||||
with (field)
|
||||
{
|
||||
apos=value.indexOf("@");
|
||||
dotpos=value.lastIndexOf(".");
|
||||
if (apos<1 || dotpos-apos<2)
|
||||
{
|
||||
alert(alerttxt);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function validate_form(thisform)
|
||||
{
|
||||
with (thisform)
|
||||
{
|
||||
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)
|
||||
{email.focus();return false;}
|
||||
<?php if(!$config['account_mail_verify']): ?>
|
||||
if (validate_required(passor,"Please enter password!")==false)
|
||||
{passor.focus();return false;}
|
||||
if (validate_required(passor2,"Please repeat password!")==false)
|
||||
{passor2.focus();return false;}
|
||||
if (passor2.value!=passor.value)
|
||||
{alert('Repeated password is not equal to password!');return false;}
|
||||
<?php endif; ?>
|
||||
if(accept_rules.checked==false)
|
||||
{alert('To create account you must accept server rules!');return false;}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
$country_recognized = null;
|
||||
if($config['account_country_recognize']) {
|
||||
$info = json_decode(@file_get_contents('http://ispinfo.io/' . $_SERVER['REMOTE_ADDR'] . '/geo'), true);
|
||||
$info = json_decode(@file_get_contents('http://ipinfo.io/' . $_SERVER['REMOTE_ADDR'] . '/geo'), true);
|
||||
if(isset($info['country'])) {
|
||||
$country_recognized = strtolower($info['country']);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
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 <?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 <?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" >
|
||||
<div class="CaptionContainer" >
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span>
|
||||
<div class="Text" >Create <?php echo $config['lua']['serverName']; ?> Account</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-vertical.gif);" /></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url(<?php echo $template_path; ?>/images/content/box-frame-edge.gif);" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer" >
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<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" 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'); ?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['email'][0]) ? ' class="red"' : ''); ?>>Email Address:</span>
|
||||
</td>
|
||||
<td style="width:100%;" >
|
||||
<input type="text" name="email" id="email" onkeyup="checkEmail();" size="30" maxlength="50" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : ''); ?>" />
|
||||
<small id="email_check"></small>
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('email'); ?>
|
||||
<?php if($config['account_country']): ?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['country'][0]) ? ' class="red"' : ''); ?>>Country:</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="country" id="account_country">
|
||||
<?php
|
||||
foreach(array('pl', 'se', 'br', 'us', 'gb', ) as $c)
|
||||
echo '<option value="' . $c . '">' . $config['countries'][$c] . '</option>';
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo '<option value="">----------</option>';
|
||||
foreach($config['countries'] as $code => $c)
|
||||
echo '<option value="' . $code . '"' . (((isset($country) && $country == $code) || (!isset($country) && $country_recognized == $code)) ? ' selected' : '') . '>' . $c . '</option>';
|
||||
?>
|
||||
</select>
|
||||
<img src="" id="account_country_img"/>
|
||||
<script>
|
||||
function updateFlag()
|
||||
{
|
||||
var img = $('#account_country_img');
|
||||
var country = $('#account_country :selected').val();
|
||||
if(country.length) {
|
||||
img.attr('src', 'images/flags/' + country + '.gif');
|
||||
img.show();
|
||||
}
|
||||
else {
|
||||
img.hide();
|
||||
}
|
||||
}
|
||||
if($config['account_country']) {
|
||||
$countries = array();
|
||||
foreach (array('pl', 'se', 'br', 'us', 'gb') as $c)
|
||||
$countries[$c] = $config['countries'][$c];
|
||||
|
||||
$countries['--'] = '----------';
|
||||
foreach ($config['countries'] as $code => $c)
|
||||
$countries[$code] = $c;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
updateFlag();
|
||||
$('#account_country').change(function() {
|
||||
updateFlag();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('country'); ?>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['password'][0]) ? ' class="red"' : ''); ?>>Password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password" value="" size="30" maxlength="50" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('password'); ?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['password'][0]) ? ' class="red"' : ''); ?>>Repeat password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password2" value="" size="30" maxlength="50" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('password');
|
||||
if($config['recaptcha_enabled']):
|
||||
?>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span<?php echo (isset($errors['verification'][0]) ? ' class="red"' : ''); ?>>Verification:</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="g-recaptcha" data-sitekey="<?php echo $config['recaptcha_site_key']; ?>" data-theme="<?php echo $config['recaptcha_theme']; ?>"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php write_if_error('verification'); ?>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td><br/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" ><b>Please select all of the following check boxes:</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" >
|
||||
<span><input type="checkbox" id="accept_rules" name="accept_rules" value="true"<?php echo (isset($_POST['accept_rules']) ? ' checked' : ''); ?>/> <label for="accept_rules">I agree to the <a href="?subtopic=rules" target="_blank"><?php echo $config['lua']['serverName']; ?> Rules</a>.</label></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(isset($errors['accept_rules'][0])): ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="FormFieldError"><?php echo $errors['accept_rules']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</table></div></td></tr><br/>
|
||||
<table width="100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<input type="hidden" name="step" value="save" >
|
||||
<div class="BigButton" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton.gif)" >
|
||||
<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
|
||||
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/buttons/sbutton_over.gif);" ></div>
|
||||
<input class="ButtonText" type="image" name="Submit" alt="Submit" src="<?php echo $template_path; ?>/images/buttons/_sbutton_submit.gif" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#account_input').focus();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
function write_if_error($field)
|
||||
{
|
||||
global $errors;
|
||||
|
||||
if(isset($errors[$field][0]))
|
||||
echo '<tr><td></td><td><span class="FormFieldError">' . $errors[$field] . '</span></td></tr>';
|
||||
}
|
||||
echo $twig->render('account.create.js.html.twig');
|
||||
echo $twig->render('account.create.html.twig', array(
|
||||
'account' => isset($_POST['account']) ? $_POST['account'] : '',
|
||||
'email' => isset($_POST['email']) ? $_POST['email'] : '',
|
||||
'countries' => isset($countries) ? $countries : null,
|
||||
'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] : false,
|
||||
'country_recognized' => $country_recognized,
|
||||
'country' => isset($country) ? $country : null,
|
||||
'errors' => $errors
|
||||
));
|
||||
?>
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -43,15 +43,16 @@ function printLoot($level, $itemid, $count, $chance)
|
||||
$chance *= $lootRate;
|
||||
}
|
||||
|
||||
foreach($rarity as $lootRarity => $percent){
|
||||
if($chance >= $percent)
|
||||
{
|
||||
//echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> ' . $itemid . ' <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br />';
|
||||
foreach($rarity as $lootRarity => $percent) {
|
||||
if($chance >= $percent) {
|
||||
if(isset($itemid))
|
||||
echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> ' . $itemid . ' <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br />';
|
||||
|
||||
if($i % 6 == 0)
|
||||
{
|
||||
if($i != 0)
|
||||
echo '</td></tr>';
|
||||
echo '<tr BGCOLOR="'.getStyle(0).'"><td width="100">';
|
||||
echo '<tr bgcolor="'.getStyle(0).'"><td width="100">';
|
||||
}
|
||||
echo getItemImage($itemid);
|
||||
$i++;
|
||||
@@ -170,7 +171,7 @@ if(empty($_REQUEST['creature']))
|
||||
//generate sql query
|
||||
$desc = '';
|
||||
if(isset($_REQUEST['desc']) && $_REQUEST['desc'] == 1) {
|
||||
$desc = " DESC";
|
||||
$desc = " DESC";
|
||||
}
|
||||
if($order == 'name') {
|
||||
$whereandorder = ' ORDER BY name'.$desc;
|
||||
@@ -229,24 +230,25 @@ if(empty($_REQUEST['creature']))
|
||||
$number_of_rows = 0;
|
||||
foreach($monsters as $monster) {
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><TD><a href="?subtopic=creatures&creature='.urlencode($monster['name']).'">'.$monster['name'].'</a></TD><TD>'.$monster['health'].'</TD><TD>'.$monster['exp'].'</TD>';
|
||||
|
||||
if($monster['summonable']) {
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
}
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
}
|
||||
|
||||
if($monster['convinceable']) {
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
}
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
}
|
||||
|
||||
echo '<TD>'.ucwords($monster['race']).'</TD></TR>';
|
||||
echo '<td>'.ucwords($monster['race']).'</td></tr>';
|
||||
}
|
||||
|
||||
echo '</TABLE>';
|
||||
echo '</table>';
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom pages loader
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$query = $db->query('SELECT `title`, `body`, `php` FROM `' . TABLE_PREFIX . 'pages` WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1');
|
||||
if($query->rowCount() > 0) // found page
|
||||
{
|
||||
$query = $query->fetch();
|
||||
$title = $query['title'];
|
||||
|
||||
if($query['php'] == '1') // execute it as php code
|
||||
eval($query['body']);
|
||||
else
|
||||
echo $query['body']; // plain html
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
?>
|
@@ -3,21 +3,12 @@
|
||||
* Downloads
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
$title = 'Downloads';
|
||||
?>
|
||||
<br/><br/>
|
||||
<center>
|
||||
We're using official Tibia Client <strong><?php echo $config['client'] / 100; ?></strong><br/>
|
||||
<p>Download Tibia client <?php echo ($config['client'] / 100); ?> for windows <a href="<?php echo $config['client_download']; ?>">HERE</a>.</p>
|
||||
<p>Download Tibia client <?php echo ($config['client'] / 100); ?> for linux <a href="<?php echo $config['client_download_linux']; ?>">HERE</a>.</p>
|
||||
|
||||
<h2>IP Changer:</h2>
|
||||
|
||||
<a href="https://static.otland.net/ipchanger.exe" target="_blank">HERE</a>
|
||||
</center>
|
||||
echo $twig->render('downloads.html.twig');
|
||||
?>
|
@@ -6,19 +6,22 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Experience Stages';
|
||||
|
||||
if(file_exists($config['data_path'] . 'XML/stages.xml')) {
|
||||
$stages = new DOMDocument();
|
||||
$stages->load($config['data_path'] . 'XML/stages.xml');
|
||||
}
|
||||
|
||||
if(!isset($config['lua']['experienceStages']) || !getBoolean($config['lua']['experienceStages']))
|
||||
{
|
||||
$enabled = false;
|
||||
|
||||
if(file_exists($config['data_path'] . 'XML/stages.xml')) {
|
||||
$stages = new DOMDocument();
|
||||
$stages->load($config['data_path'] . 'XML/stages.xml');
|
||||
if(isset($stages)) {
|
||||
foreach($stages->getElementsByTagName('config') as $node) {
|
||||
if($node->getAttribute('enabled'))
|
||||
$enabled = true;
|
||||
@@ -34,23 +37,18 @@ if(!isset($config['lua']['experienceStages']) || !getBoolean($config['lua']['exp
|
||||
else if(isset($config['lua']['rate_exp']))
|
||||
$rate_exp = $config['lua']['rate_exp'];
|
||||
|
||||
$content .= 'Server is not configured to use experience stages.<br/>Current experience rate is: <b>x' . $rate_exp . '</b>';
|
||||
echo 'Server is not configured to use experience stages.<br/>Current experience rate is: <b>x' . $rate_exp . '</b>';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($stages)) {
|
||||
$stages = new DOMDocument();
|
||||
$stages->load($config['data_path'] . 'XML/stages.xml');
|
||||
}
|
||||
|
||||
if(!$stages)
|
||||
{
|
||||
echo 'Error: cannot load <b>stages.xml</b>!';
|
||||
return;
|
||||
}
|
||||
|
||||
$content .= '<center><h3>Experience stages</h3></center>
|
||||
echo '<center><h3>Experience stages</h3></center>
|
||||
<table bgcolor="'.$config['darkborder'].'" border="0" cellpadding="4" cellspacing="1" width="100%"><tbody>
|
||||
<tr bgcolor="'.$config['vdarkborder'].'">
|
||||
<td class="white" colspan="5"><b>Stages table</b></td>
|
||||
@@ -61,11 +59,11 @@ $content .= '<center><h3>Experience stages</h3></center>
|
||||
foreach($stages->getElementsByTagName('stage') as $stage)
|
||||
{
|
||||
$maxlevel = $stage->getAttribute('maxlevel');
|
||||
$content .= '<tr bgcolor="'.$config['lightborder'].'">
|
||||
echo '<tr bgcolor="'.$config['lightborder'].'">
|
||||
<td>'.$stage->getAttribute('minlevel') . '-'. (isset($maxlevel[0]) ? $maxlevel : '*') . '</td><td>x'.$stage->getAttribute('multiplier').'</td>
|
||||
</tr>';
|
||||
}
|
||||
$content .= '
|
||||
echo '
|
||||
</tbody></table>
|
||||
</td></tr>
|
||||
</tbody></table>';
|
||||
|
@@ -3,50 +3,23 @@
|
||||
* Experience table
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Experience Table';
|
||||
?>
|
||||
|
||||
This is a list of the experience points that are required to advance to the various levels.
|
||||
Remember you can also check the respective skill bar in your skill window of the client to check your progress towards the next level.<br/><br/>
|
||||
|
||||
<table bgcolor="<?php echo $config['darkborder']; ?>" border="0" cellpadding="4" cellspacing="1" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" colspan="5"><b>Experience Table</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$columns = $config['experiencetable_columns'];
|
||||
for($i = 0; $i < $columns; $i++)
|
||||
{
|
||||
?>
|
||||
<td>
|
||||
<table border="0" cellpadding="2" cellspacing="1" width="100%">
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td><b>Level</b></td>
|
||||
<td><b>Experience</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
for($level = $i * $config['experiencetable_rows'] + 1; $level < $i * $config['experiencetable_rows'] + ($config['experiencetable_rows'] + 1); $level++)
|
||||
{
|
||||
?>
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td><?php echo $level; ?></td>
|
||||
<td><?php echo OTS_Toolbox::experienceForLevel($level); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
<?php
|
||||
$experience = array();
|
||||
$columns = $config['experiencetable_columns'];
|
||||
for($i = 0; $i < $columns; $i++) {
|
||||
for($level = $i * $config['experiencetable_rows'] + 1; $level < $i * $config['experiencetable_rows'] + ($config['experiencetable_rows'] + 1); $level++) {
|
||||
$experience[$level] = OTS_Toolbox::experienceForLevel($level);
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('experience_table.html.twig', array(
|
||||
'experience' => $experience
|
||||
));
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -20,47 +20,10 @@ if(!$faqs->rowCount())
|
||||
There are no questions added yet.
|
||||
<?php
|
||||
if(admin())
|
||||
echo ' You can add new faq questions in phpmyadmin under ' . TABLE_PREFIX . 'faq table.';
|
||||
echo ' You can add new faq questions in phpmyadmin under <b>' . TABLE_PREFIX . 'faq</b> table.';
|
||||
}
|
||||
|
||||
echo $twig->render('faq.html.twig', array(
|
||||
'faqs' => $faqs
|
||||
));
|
||||
?>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white">
|
||||
<b>FAQ</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a href="#" onclick="toggleAll(); return false;">Toggle all</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($faqs as $faq): ?>
|
||||
<tr bgcolor="<?php echo getStyle(++$i); ?>">
|
||||
<td colspan="2" style="cursor: pointer;" onclick="toggleVisibility('faq_<?php echo $i; ?>'); return false;">
|
||||
<b><?php echo $faq['question']; ?></b>
|
||||
<div id="faq_<?php echo $i; ?>" style="display: none;"><?php echo $faq['answer']; ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var expanded = false;
|
||||
|
||||
function toggleVisibility(id)
|
||||
{
|
||||
var tmp = document.getElementById(id);
|
||||
if(tmp)
|
||||
tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
|
||||
}
|
||||
|
||||
function toggleAll()
|
||||
{
|
||||
for(i = 1; i < <?php echo $i + 1; ?>; i++)
|
||||
{
|
||||
document.getElementById('faq_' + i).style.display = expanded ? 'none' : '';
|
||||
}
|
||||
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -24,16 +24,6 @@ if(strtolower($config['forum']) != 'site')
|
||||
return;
|
||||
}
|
||||
|
||||
$sections = array();
|
||||
foreach(getForumSections() as $section)
|
||||
{
|
||||
$sections[$section['id']] = array(
|
||||
'name' => $section['name'],
|
||||
'description' => $section['description'],
|
||||
'closed' => $section['closed'] == '1'
|
||||
);
|
||||
}
|
||||
|
||||
function parseSmiles($text)
|
||||
{
|
||||
$smileys = array(
|
||||
@@ -127,25 +117,126 @@ function showPost($topic, $text, $smiles)
|
||||
if(!$logged)
|
||||
echo 'You are not logged in. <a href="?subtopic=accountmanagement&redirect=' . BASE_URL . urlencode('?subtopic=forum') . '">Log in</a> to post on the forum.<br /><br />';
|
||||
|
||||
$canEdit = hasFlag(FLAG_CONTENT_FORUM) || superAdmin();
|
||||
if($canEdit)
|
||||
{
|
||||
if(!empty($action))
|
||||
{
|
||||
if($action == 'delete_board' || $action == 'edit_board' || $action == 'hide_board' || $action == 'moveup_board' || $action == 'movedown_board')
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
if(isset($_REQUEST['name']))
|
||||
$name = $_REQUEST['name'];
|
||||
|
||||
if(isset($_REQUEST['description']))
|
||||
$description = stripslashes($_REQUEST['description']);
|
||||
|
||||
$errors = array();
|
||||
|
||||
if($action == 'add_board') {
|
||||
if(Forum::add_board($name, $description, $errors))
|
||||
$action = $name = $description = '';
|
||||
}
|
||||
else if($action == 'delete_board') {
|
||||
Forum::delete_board($id, $errors);
|
||||
$action = '';
|
||||
}
|
||||
else if($action == 'edit_board')
|
||||
{
|
||||
if(isset($id) && !isset($name)) {
|
||||
$board = Forum::get_board($id);
|
||||
$name = $board['name'];
|
||||
$description = $board['description'];
|
||||
}
|
||||
else {
|
||||
Forum::update_board($id, $name, $description);
|
||||
$action = $name = $description = '';
|
||||
}
|
||||
}
|
||||
else if($action == 'hide_board') {
|
||||
Forum::toggleHidden_board($id, $errors);
|
||||
$action = '';
|
||||
}
|
||||
else if($action == 'moveup_board') {
|
||||
Forum::move_board($id, -1, $errors);
|
||||
$action = '';
|
||||
}
|
||||
else if($action == 'movedown_board') {
|
||||
Forum::move_board($id, 1, $errors);
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if(!empty($errors)) {
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($action) || $action == 'edit_board') {
|
||||
echo $twig->render('forum.add_board.html.twig', array(
|
||||
'link' => getPageLink('forum', ($action == 'edit_board' ? 'edit_board' : 'add_board')),
|
||||
'action' => $action,
|
||||
'id' => isset($id) ? $id : null,
|
||||
'name' => isset($name) ? $name : null,
|
||||
'description' => isset($description) ? $description : null
|
||||
));
|
||||
|
||||
if($action == 'edit_board')
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
$sections = array();
|
||||
foreach(getForumBoards() as $section)
|
||||
{
|
||||
$sections[$section['id']] = array(
|
||||
'id' => $section['id'],
|
||||
'name' => $section['name'],
|
||||
'description' => $section['description'],
|
||||
'closed' => $section['closed'] == '1'
|
||||
);
|
||||
|
||||
if($canEdit) {
|
||||
$sections[$section['id']]['hidden'] = $section['hidden'];
|
||||
}
|
||||
else {
|
||||
$sections[$section['id']]['hidden'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$number_of_rows = 0;
|
||||
if(empty($action))
|
||||
{
|
||||
echo '<b>Boards</b>';
|
||||
echo '<table width="100%"><tr bgcolor="'.$config['vdarkborder'].'"><td><font color="white" size="1"><b>Board</b></font></td><td><font color="white" size="1"><b>Posts</b></font></td><td><font color="white" size="1"><b>Threads</b></font></td><td align="center"><font color="white" size="1"><b>Last Post</b></font></td></tr>';
|
||||
$info = $db->query("SELECT `section`, COUNT(`id`) AS 'threads', SUM(`replies`) AS 'replies' FROM `" . TABLE_PREFIX . "forum` WHERE `first_post` = `id` GROUP BY `section`")->fetchAll();
|
||||
|
||||
$boards = array();
|
||||
foreach($info as $data)
|
||||
$counters[$data['section']] = array('threads' => $data['threads'], 'posts' => $data['replies'] + $data['threads']);
|
||||
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="' . 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
|
||||
echo 'No posts';
|
||||
echo '</td></tr>';
|
||||
$boards[] = array(
|
||||
'id' => $id,
|
||||
'link' => getForumBoardLink($id),
|
||||
'name' => $section['name'],
|
||||
'description' => $section['description'],
|
||||
'hidden' => $section['hidden'],
|
||||
'posts' => isset($counters[$id]['posts']) ? $counters[$id]['posts'] : 0,
|
||||
'threads' => isset($counters[$id]['threads']) ? $counters[$id]['threads'] : 0,
|
||||
'last_post' => array(
|
||||
'name' => isset($last_post['name']) ? $last_post['name'] : null,
|
||||
'date' => isset($last_post['post_date']) ? $last_post['post_date'] : null,
|
||||
'player_link' => isset($last_post['name']) ? getPlayerLink($last_post['name']) : null,
|
||||
)
|
||||
);
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
echo $twig->render('forum.boards.html.twig', array(
|
||||
'boards' => $boards,
|
||||
'canEdit' => $canEdit,
|
||||
'last' => count($sections)
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -166,7 +257,7 @@ if($action == 'show_board')
|
||||
if(!$sections[$section_id]['closed'] || Forum::isModerator())
|
||||
{
|
||||
echo '<br /><br />
|
||||
<a href="?subtopic=forum&action=new_topic§ion_id='.$section_id.'"><img src="images/forum/topic.gif" border="0" /></a>';
|
||||
<a href="?subtopic=forum&action=new_thread§ion_id='.$section_id.'"><img src="images/forum/topic.gif" border="0" /></a>';
|
||||
}
|
||||
|
||||
echo '<br /><br />Page: '.$links_to_pages.'<br />';
|
||||
@@ -175,7 +266,7 @@ if($action == 'show_board')
|
||||
{
|
||||
echo '<table width="100%"><tr bgcolor="'.$config['vdarkborder'].'" align="center"><td><font color="white" size="1"><b>Thread</b></font></td><td><font color="white" size="1"><b>Thread Starter</b></font></td><td><font color="white" size="1"><b>Replies</b></font></td><td><font color="white" size="1"><b>Views</b></font></td><td><font color="white" size="1"><b>Last Post</b></font></td></tr>';
|
||||
|
||||
$player = $ots->createObject('Player');
|
||||
$player = new OTS_Player();
|
||||
foreach($last_threads as $thread)
|
||||
{
|
||||
echo '<tr bgcolor="' . getStyle($number_of_rows++) . '"><td>';
|
||||
@@ -209,7 +300,7 @@ if($action == 'show_board')
|
||||
}
|
||||
echo '</table>';
|
||||
if(!$sections[$section_id]['closed'] || Forum::isModerator())
|
||||
echo '<br /><a href="?subtopic=forum&action=new_topic§ion_id='.$section_id.'"><img src="images/forum/topic.gif" border="0" /></a>';
|
||||
echo '<br /><a href="?subtopic=forum&action=new_thread§ion_id='.$section_id.'"><img src="images/forum/topic.gif" border="0" /></a>';
|
||||
}
|
||||
else
|
||||
echo '<h3>No threads in this board.</h3>';
|
||||
@@ -318,7 +409,7 @@ if($action == 'remove_post')
|
||||
}
|
||||
}
|
||||
else
|
||||
echo 'Post with ID '.$id.' does not exist.';
|
||||
echo 'Post with ID ' . $id . ' does not exist.';
|
||||
}
|
||||
else
|
||||
echo 'You are not logged in or you are not moderator.';
|
||||
@@ -392,7 +483,7 @@ if($action == 'new_post')
|
||||
if(!$saved)
|
||||
{
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo '<form action="?" method="POST">
|
||||
<input type="hidden" name="action" value="new_post" />
|
||||
@@ -434,7 +525,7 @@ if($action == 'new_post')
|
||||
echo 'Thread with ID '.$thread_id.' doesn\'t exist.';
|
||||
}
|
||||
else
|
||||
echo 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
|
||||
echo "Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
|
||||
}
|
||||
|
||||
if($action == 'edit_post')
|
||||
@@ -508,7 +599,7 @@ if($action == 'edit_post')
|
||||
if(!$saved)
|
||||
{
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo '<br /><form action="?" method="POST"><input type="hidden" name="action" value="edit_post" /><input type="hidden" name="id" value="'.$post_id.'" /><input type="hidden" name="subtopic" value="forum" /><input type="hidden" name="save" value="save" /><table width="100%"><tr bgcolor="'.$config['vdarkborder'].'"><td colspan="2"><font color="white"><b>Edit Post</b></font></td></tr><tr bgcolor="'.$config['darkborder'].'"><td width="180"><b>Character:</b></td><td><select name="char_id"><option value="0">(Choose character)</option>';
|
||||
foreach($players_from_account as $player)
|
||||
@@ -536,98 +627,92 @@ if($action == 'edit_post')
|
||||
echo '<br />Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
|
||||
}
|
||||
|
||||
if($action == 'new_topic')
|
||||
if($action == 'new_thread')
|
||||
{
|
||||
if(Forum::canPost($account_logged))
|
||||
{
|
||||
$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="' . 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())
|
||||
$errors[] = 'You cannot create topic on this board.';
|
||||
|
||||
$quote = (int) (isset($_REQUEST['quote']) ? $_REQUEST['quote'] : 0);
|
||||
$text = isset($_REQUEST['text']) ? stripslashes(trim($_REQUEST['text'])) : '';
|
||||
$char_id = (int) (isset($_REQUEST['char_id']) ? $_REQUEST['char_id'] : 0);
|
||||
$post_topic = isset($_REQUEST['topic']) ? stripslashes(trim($_REQUEST['topic'])) : '';
|
||||
$smile = (int) (isset($_REQUEST['smile']) ? $_REQUEST['smile'] : 0);
|
||||
$saved = false;
|
||||
if(isset($_REQUEST['save']))
|
||||
{
|
||||
$lenght = 0;
|
||||
for($i = 0; $i < strlen($post_topic); $i++)
|
||||
{
|
||||
if(ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126)
|
||||
$lenght++;
|
||||
}
|
||||
if($lenght < 1 || strlen($post_topic) > 60)
|
||||
$errors[] = 'Too short or too long topic (short: '.$lenght.' long: '.strlen($post_topic).' letters). Minimum 1 letter, maximum 60 letters.';
|
||||
$lenght = 0;
|
||||
for($i = 0; $i < strlen($text); $i++)
|
||||
{
|
||||
if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126)
|
||||
$lenght++;
|
||||
}
|
||||
if($lenght < 1 || strlen($text) > 15000)
|
||||
$errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.';
|
||||
if($char_id == 0)
|
||||
$errors[] = 'Please select a character.';
|
||||
$player_on_account = false;
|
||||
if(count($errors) == 0)
|
||||
{
|
||||
foreach($players_from_account as $player)
|
||||
if($char_id == $player['id'])
|
||||
$player_on_account = true;
|
||||
if(!$player_on_account)
|
||||
$errors[] = 'Player with selected ID '.$char_id.' doesn\'t exist or isn\'t on your account';
|
||||
}
|
||||
if(count($errors) == 0)
|
||||
{
|
||||
$last_post = 0;
|
||||
$query = $db->query('SELECT post_date FROM ' . TABLE_PREFIX . 'forum ORDER BY post_date DESC LIMIT 1');
|
||||
if($query->rowCount() > 0)
|
||||
{
|
||||
$query = $query->fetch();
|
||||
$last_post = $query['post_date'];
|
||||
$players_from_account = $db->query('SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = '.(int) $account_logged->getId())->fetchAll();
|
||||
$section_id = isset($_REQUEST['section_id']) ? $_REQUEST['section_id'] : null;
|
||||
if($section_id !== null) {
|
||||
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())
|
||||
$errors[] = 'You cannot create topic on this board.';
|
||||
|
||||
$quote = (int)(isset($_REQUEST['quote']) ? $_REQUEST['quote'] : 0);
|
||||
$text = isset($_REQUEST['text']) ? stripslashes($_REQUEST['text']) : '';
|
||||
$char_id = (int)(isset($_REQUEST['char_id']) ? $_REQUEST['char_id'] : 0);
|
||||
$post_topic = isset($_REQUEST['topic']) ? stripslashes($_REQUEST['topic']) : '';
|
||||
$smile = (int)(isset($_REQUEST['smile']) ? $_REQUEST['smile'] : 0);
|
||||
$saved = false;
|
||||
if (isset($_REQUEST['save'])) {
|
||||
$errors = array();
|
||||
|
||||
$lenght = 0;
|
||||
for ($i = 0; $i < strlen($post_topic); $i++) {
|
||||
if (ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126)
|
||||
$lenght++;
|
||||
}
|
||||
if ($lenght < 1 || strlen($post_topic) > 60)
|
||||
$errors[] = 'Too short or too long topic (short: ' . $lenght . ' long: ' . strlen($post_topic) . ' letters). Minimum 1 letter, maximum 60 letters.';
|
||||
$lenght = 0;
|
||||
for ($i = 0; $i < strlen($text); $i++) {
|
||||
if (ord($text[$i]) >= 33 && ord($text[$i]) <= 126)
|
||||
$lenght++;
|
||||
}
|
||||
if ($lenght < 1 || strlen($text) > 15000)
|
||||
$errors[] = 'Too short or too long post (short: ' . $lenght . ' long: ' . strlen($text) . ' letters). Minimum 1 letter, maximum 15000 letters.';
|
||||
|
||||
if ($char_id == 0)
|
||||
$errors[] = 'Please select a character.';
|
||||
$player_on_account = false;
|
||||
|
||||
if (count($errors) == 0) {
|
||||
foreach ($players_from_account as $player)
|
||||
if ($char_id == $player['id'])
|
||||
$player_on_account = true;
|
||||
if (!$player_on_account)
|
||||
$errors[] = 'Player with selected ID ' . $char_id . ' doesn\'t exist or isn\'t on your account';
|
||||
}
|
||||
|
||||
if (count($errors) == 0) {
|
||||
$last_post = 0;
|
||||
$query = $db->query('SELECT `post_date` FROM `' . TABLE_PREFIX . 'forum` ORDER BY `post_date` DESC LIMIT 1');
|
||||
if ($query->rowCount() > 0) {
|
||||
$query = $query->fetch();
|
||||
$last_post = $query['post_date'];
|
||||
}
|
||||
if ($last_post + $config['forum_post_interval'] - time() > 0 && !Forum::isModerator())
|
||||
$errors[] = 'You can post one time per ' . $config['forum_post_interval'] . ' seconds. Next post after ' . ($last_post + $config['forum_post_interval'] - time()) . ' second(s).';
|
||||
}
|
||||
if (count($errors) == 0) {
|
||||
$saved = true;
|
||||
$db->query("INSERT INTO `" . TABLE_PREFIX . "forum` (`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 ('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: ' . getForumThreadLink($thread_id));
|
||||
echo '<br />Thank you for posting.<br /><a href="' . getForumThreadLink($thread_id) . '">GO BACK TO LAST THREAD</a>';
|
||||
}
|
||||
if($last_post+$config['forum_post_interval']-time() > 0 && !Forum::isModerator())
|
||||
$errors[] = 'You can post one time per '.$config['forum_post_interval'].' seconds. Next post after '.($last_post+$config['forum_post_interval']-time()).' second(s).';
|
||||
}
|
||||
if(count($errors) == 0)
|
||||
{
|
||||
$saved = true;
|
||||
$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: ' . getForumThreadLink($thread_id));
|
||||
echo '<br />Thank you for posting.<br /><a href="' . getForumThreadLink($thread_id) . '">GO BACK TO LAST THREAD</a>';
|
||||
if (!$saved) {
|
||||
if (!empty($errors))
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
echo $twig->render('forum.new_thread.html.twig', array(
|
||||
'section_id' => $section_id,
|
||||
'players' => $players_from_account,
|
||||
'post_player_id' => $char_id,
|
||||
'post_thread' => $post_topic,
|
||||
'text' => $text,
|
||||
'smiles_enabled' => $smile > 0
|
||||
));
|
||||
}
|
||||
}
|
||||
if(!$saved)
|
||||
{
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
|
||||
echo '<form action="?" method="POST"><input type="hidden" name="action" value="new_topic" /><input type="hidden" name="section_id" value="'.$section_id.'" /><input type="hidden" name="subtopic" value="forum" /><input type="hidden" name="save" value="save" /><table width="100%"><tr bgcolor="'.$config['vdarkborder'].'"><td colspan="2"><font color="white"><b>Post New Reply</b></font></td></tr><tr bgcolor="'.$config['darkborder'].'"><td width="180"><b>Character:</b></td><td><select name="char_id"><option value="0">(Choose character)</option>';
|
||||
foreach($players_from_account as $player)
|
||||
{
|
||||
echo '<option value="'.$player['id'].'"';
|
||||
if($player['id'] == $char_id)
|
||||
echo ' selected="selected"';
|
||||
echo '>'.$player['name'].'</option>';
|
||||
}
|
||||
echo '</select></td></tr><tr bgcolor="'.$config['lightborder'].'"><td><b>Topic:</b></td><td><input type="text" name="topic" value="'.htmlspecialchars($post_topic).'" size="40" maxlength="60" /> (Optional)</td></tr>
|
||||
<tr bgcolor="'.$config['darkborder'].'"><td valign="top"><b>Message:</b><font size="1"><br />You can use:<br />[player]Nick[/player]<br />[url]http://address.com/[/url]<br />[img]http://images.com/images3.gif[/img]<br />[code]Code[/code]<br />[b]<b>Text</b>[/b]<br />[i]<i>Text</i>[/i]<br />[u]<u>Text</u>[/u]<br />and smileys:<br />;) , :) , :D , :( , :rolleyes:<br />:cool: , :eek: , :o , :p</font></td><td><textarea rows="10" cols="60" name="text">'.htmlspecialchars($text).'</textarea><br />(Max. 15,000 letters)</td></tr>
|
||||
<tr bgcolor="'.$config['lightborder'].'"><td valign="top">Options:</td><td><label><input type="checkbox" name="smile" value="1"';
|
||||
if($smile == 1)
|
||||
echo ' checked="checked"';
|
||||
echo '/>Disable Smileys in This Post </label></td></tr></table><center><input type="submit" value="Post Thread" /></center></form>';
|
||||
}
|
||||
else
|
||||
echo 'Board with ID ' . $board_id . ' doesn\'t exist.';
|
||||
}
|
||||
else
|
||||
echo 'Board with ID '.$board_id.' doesn\'t exist.';
|
||||
echo 'Please enter section_id.';
|
||||
}
|
||||
else
|
||||
echo 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
|
||||
@@ -645,22 +730,14 @@ if($action == 'move_thread')
|
||||
{
|
||||
if($post['id'] == $post['first_post'])
|
||||
{
|
||||
echo '<br/><table bgcolor='.$config['vdarkborder'].' border=0 cellpadding=2 cellspacing=0 width=100%>
|
||||
<tr bgcolor='.$config['vdarkborder'].'><td class=white colspan=5><B>Move thread to another board</B></td></tr>
|
||||
<tr><td><table border=0 cellpadding=3 cellspacing=1 width=100%>
|
||||
<tr bgcolor='.$config['lightborder'].'><td>
|
||||
<FORM ACTION="" METHOD="GET">
|
||||
<input type="hidden" name="subtopic" value="forum" />
|
||||
<input type="hidden" name="action" value="moved_thread" />
|
||||
<input type="hidden" name="id" value="'.$post['id'].'" />
|
||||
<strong>THREAD:</strong> '.$post['post_topic'].'
|
||||
<br/><strong>AUTHOR:</strong> '.$name[0].'
|
||||
<br/><strong>BOARD:</strong> '.$sections[$post['section']]['name'].'<br/>
|
||||
<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="' . getForumBoardLink($post['section']) . '" method="POST">
|
||||
<input type="submit" value="Cancel"></form></td></tr></table></td></tr></table>';
|
||||
echo $twig->render('forum.move_thread.html.twig', array(
|
||||
'thread' => $post['post_topic'],
|
||||
'author' => $name[0],
|
||||
'board' => $sections[$post['section']]['name'],
|
||||
'post_id' => $post['id'],
|
||||
'sections' => $sections,
|
||||
'section_link' => getForumBoardLink($post['section']),
|
||||
));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -675,7 +752,7 @@ if($action == 'moved_thread')
|
||||
if(Forum::isModerator())
|
||||
{
|
||||
$id = (int) $_REQUEST['id'];
|
||||
$board = (int) $_REQUEST['sektion'];
|
||||
$board = (int) $_REQUEST['section'];
|
||||
$post = $db->query("SELECT `id`, `first_post`, `section` FROM `" . TABLE_PREFIX . "forum` WHERE `id` = ".$id." LIMIT 1")->fetch();
|
||||
if($post['id'] == $id)
|
||||
{
|
||||
@@ -687,7 +764,7 @@ if($action == 'moved_thread')
|
||||
}
|
||||
}
|
||||
else
|
||||
echo 'Post with ID '.$id.' does not exist.';
|
||||
echo 'Post with ID ' . $id . ' does not exist.';
|
||||
}
|
||||
else
|
||||
echo 'You are not logged in or you are not moderator.';
|
||||
@@ -707,14 +784,106 @@ class Forum
|
||||
|
||||
return
|
||||
$db->query(
|
||||
'SELECT ' . $db->fieldName('id') .
|
||||
' FROM ' . $db->tableName('players') .
|
||||
' WHERE ' . $db->fieldName('account_id') . ' = ' . $db->quote($account->getId()) .
|
||||
' AND ' . $db->fieldName('level') . ' >= ' . $db->quote($config['forum_level_required']) .
|
||||
'SELECT `id` FROM `players` WHERE `account_id` = ' . $db->quote($account->getId()) .
|
||||
' AND `level` >= ' . $db->quote($config['forum_level_required']) .
|
||||
' LIMIT 1')->rowCount() > 0;
|
||||
}
|
||||
|
||||
static public function isModerator() {
|
||||
return hasFlag(FLAG_CONTENT_FORUM) || admin();
|
||||
}
|
||||
|
||||
static public function add_board($name, $description, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($name[0]) && isset($description[0]))
|
||||
{
|
||||
$query = $db->select(TABLE_PREFIX . 'forum_boards', array('name' => $name));
|
||||
|
||||
if($query === false)
|
||||
{
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT ' . $db->fieldName('ordering') .
|
||||
' FROM ' . $db->tableName(TABLE_PREFIX . 'forum_boards') .
|
||||
' ORDER BY ' . $db->fieldName('ordering') . ' DESC LIMIT 1'
|
||||
);
|
||||
|
||||
$ordering = 0;
|
||||
if($query->rowCount() > 0) {
|
||||
$query = $query->fetch();
|
||||
$ordering = $query['ordering'] + 1;
|
||||
}
|
||||
$db->insert(TABLE_PREFIX . 'forum_boards', array('name' => $name, 'description' => $description, 'ordering' => $ordering));
|
||||
}
|
||||
else
|
||||
$errors[] = 'Forum board with this name already exists.';
|
||||
}
|
||||
else
|
||||
$errors[] = 'Please fill all inputs.';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
|
||||
static public function get_board($id) {
|
||||
global $db;
|
||||
return $db->select(TABLE_PREFIX . 'forum_boards', array('id' => $id));
|
||||
}
|
||||
|
||||
static public function update_board($id, $name, $description) {
|
||||
global $db;
|
||||
$db->update(TABLE_PREFIX . 'forum_boards', array('name' => $name, 'description' => $description), array('id' => $id));
|
||||
}
|
||||
|
||||
static public function delete_board($id, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($id))
|
||||
{
|
||||
if(self::get_board($id) !== false)
|
||||
$db->delete(TABLE_PREFIX . 'forum_boards', array('id' => $id));
|
||||
else
|
||||
$errors[] = 'Forum board with id ' . $id . ' does not exists.';
|
||||
}
|
||||
else
|
||||
$errors[] = 'id not set';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
|
||||
static public function toggleHidden_board($id, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($id))
|
||||
{
|
||||
$query = self::get_board($id);
|
||||
if($query !== false)
|
||||
$db->update(TABLE_PREFIX . 'forum_boards', array('hidden' => ($query['hidden'] == 1 ? 0 : 1)), array('id' => $id));
|
||||
else
|
||||
$errors[] = 'Forum board with id ' . $id . ' does not exists.';
|
||||
}
|
||||
else
|
||||
$errors[] = 'id not set';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
|
||||
static public function move_board($id, $i, &$errors)
|
||||
{
|
||||
global $db;
|
||||
$query = self::get_board($id);
|
||||
if($query !== false)
|
||||
{
|
||||
$ordering = $query['ordering'] + $i;
|
||||
$old_record = $db->select(TABLE_PREFIX . 'forum_boards', array('ordering' => $ordering));
|
||||
if($old_record !== false)
|
||||
$db->update(TABLE_PREFIX . 'forum_boards', array('ordering' => $query['ordering']), array('ordering' => $ordering));
|
||||
|
||||
$db->update(TABLE_PREFIX . 'forum_boards', array('ordering' => $ordering), array('id' => $id));
|
||||
}
|
||||
else
|
||||
$errors[] = 'Forum board with id ' . $id . ' does not exists.';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -5,13 +5,13 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Movies';
|
||||
|
||||
$movies = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'movies') . ' ORDER BY ' . $db->fieldName('ordering'));
|
||||
$movies = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'movies` ORDER BY `ordering`;');
|
||||
if(!$movies->rowCount())
|
||||
{
|
||||
?>
|
||||
@@ -21,11 +21,8 @@ There are no movies added yet.
|
||||
echo ' You can add new movies in phpmyadmin under ' . TABLE_PREFIX . 'movies table.';
|
||||
return;
|
||||
}
|
||||
|
||||
echo $twig->render('movies.html.twig', array(
|
||||
'movies' => $movies
|
||||
));
|
||||
?>
|
||||
<center>
|
||||
<?php foreach($movies as $movie): ?>
|
||||
<?php echo $movie['title']; ?><br/>
|
||||
Author: <?php echo $movie['author']; ?><br/>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $movie['youtube_id']; ?>" frameborder="0" allowfullscreen></iframe><br/><br/>
|
||||
<?php endforeach; ?>
|
||||
</center>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -32,26 +32,40 @@ if(isset($_GET['archive']))
|
||||
if($_REQUEST['id'] < 100000)
|
||||
$field_name = 'id';
|
||||
|
||||
$news = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE type = 1 AND hidden != 1 and `' . $field_name . '` = ' . (int)$_REQUEST['id'] . '');
|
||||
$news = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE `type` = 1 AND `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . '');
|
||||
if($news->rowCount() == 1)
|
||||
{
|
||||
if(@file_exists($template_path . '/news.php'))
|
||||
require($template_path . '/news.php');
|
||||
else
|
||||
require(SYSTEM . 'templates/news.php');
|
||||
|
||||
$news = $news->fetch();
|
||||
$author = '';
|
||||
$query = $db->query('SELECT name FROM players WHERE id = ' . $db->quote($news['player_id'] . ' LIMIT 1'));
|
||||
$query = $db->query('SELECT `name` FROM `players` WHERE id = ' . $db->quote($news['player_id'] . ' LIMIT 1;'));
|
||||
if($query->rowCount() > 0) {
|
||||
$query = $query->fetch();
|
||||
$author = $query['name'];
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
$content_ = $news['body'];
|
||||
$firstLetter = '';
|
||||
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_ = $firstLetter . substr($content_, 1);
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('news.html.twig', array(
|
||||
'title' => stripslashes($news['title']),
|
||||
'content' => $content_,
|
||||
'date' => $news['date'],
|
||||
'icon' => $categories[$news['category']]['icon_id'],
|
||||
'author' => $config['news_author'] ? $author : '',
|
||||
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
|
||||
'news_date_format' => $config['news_date_format']
|
||||
));
|
||||
}
|
||||
else
|
||||
echo 'This news doesn\'t exist or is hidden.<br>';
|
||||
echo "This news doesn't exist or is hidden.<br/>";
|
||||
|
||||
//echo '<br /><a href="' . internalLayoutLink('news') . ($config['friendly_urls'] ? '/' : '') . 'archive' . '"><font size="2"><b>Back to Archive</b></font></a>';
|
||||
?>
|
||||
@@ -64,15 +78,11 @@ if(isset($_GET['archive']))
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td colspan="3" class="white"><b>News archives</b></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$i = 0;
|
||||
$news_DB = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE type = 1 AND hidden != 1 ORDER BY date DESC');
|
||||
$newses = array();
|
||||
$news_DB = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE `type` = 1 AND `hidden` != 1 ORDER BY `date` DESC');
|
||||
foreach($news_DB as $news)
|
||||
{
|
||||
$link = internalLayoutLink('news');
|
||||
@@ -80,13 +90,19 @@ if(isset($_GET['archive']))
|
||||
$link .= '/archive/' . $news['id'];
|
||||
else
|
||||
$link .= 'archive&id=' . $news['id'];
|
||||
|
||||
echo '<tr BGCOLOR='. getStyle($i) .'><td width=4%><center><img src="'.$template_path.'/images/news/icon_' . $categories[$news['category']]['icon_id'] . '_small.gif"></center></td><td>'.date("j.n.Y", $news['date']).'</td><td><b><a href="' . $link.'">'.stripslashes($news['title']).'</a></b></td></tr>';
|
||||
|
||||
$i++;
|
||||
|
||||
$newses[] = array(
|
||||
'link' => $link,
|
||||
'icon_id' => $categories[$news['category']]['icon_id'],
|
||||
'title' => stripslashes($news['title']),
|
||||
'date' => $news['date']
|
||||
);
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
|
||||
echo $twig->render('news.archive.html.twig', array(
|
||||
'newses' => $newses
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,8 +114,6 @@ define('TITLE_LIMIT', 100);
|
||||
define('BODY_LIMIT', 65535); // maximum news body length
|
||||
|
||||
$canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin();
|
||||
if($canEdit)
|
||||
echo '<script type="text/javascript" src="' . BASE_URL . 'tools/tiny_mce/tiny_mce.js"></script>';
|
||||
if($canEdit)
|
||||
{
|
||||
if(!empty($action))
|
||||
@@ -151,7 +165,7 @@ if($canEdit)
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
|
||||
if($cache->enabled())
|
||||
{
|
||||
@@ -257,162 +271,32 @@ if(isset($tickers_to_add[0]))
|
||||
if(!$news_cached)
|
||||
{
|
||||
ob_start();
|
||||
// newses
|
||||
if(@file_exists($template_path . '/news.php'))
|
||||
require($template_path . '/news.php');
|
||||
else
|
||||
require(SYSTEM . 'templates/news.php');
|
||||
|
||||
if($canEdit)
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
forced_root_block : false,
|
||||
if($action == 'edit') {
|
||||
$player = new OTS_Player();
|
||||
$player->load($player_id);
|
||||
}
|
||||
|
||||
$account_players = $account_logged->getPlayersList();
|
||||
$account_players->orderBy('group_id', POT::ORDER_DESC);
|
||||
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
plugins: "safari,advimage,emotions,insertdatetime,preview,wordcount",
|
||||
|
||||
theme_advanced_buttons3_add : "emotions,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
});
|
||||
</script>
|
||||
<?php if($action != 'edit'): ?>
|
||||
<a id="news-button" href="#">Add news</a>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="<?php echo getPageLink('news', ($action == 'edit' ? 'edit' : 'add')); ?>">
|
||||
<?php if($action == 'edit'): ?>
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<?php endif; ?>
|
||||
<table id="news-edit" width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="<?php echo $config['vdarkborder']; ?>" class="white"><b><?php echo ($action == 'edit' ? 'Edit' : 'Add'); ?> news</b></td>
|
||||
</tr>
|
||||
|
||||
<?php $rows = 0; ?>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Title:</b></td>
|
||||
<td><input name="title" value="<?php echo (isset($p_title) ? $p_title : ''); ?>" size="50" maxlength="100"/></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<!--td>Description:</td-->
|
||||
<td colspan="2"><textarea name="body" maxlength="<?php echo BODY_LIMIT; ?>" class="tinymce"><?php echo (isset($body) ? $body : ''); ?></textarea></td>
|
||||
<tr/>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Type:</b></td>
|
||||
<td>
|
||||
<select name="type">
|
||||
<option value="<?php echo NEWS; ?>" <?php echo (isset($type) && $type == NEWS ? 'selected="yes"' : ''); ?>>News</option>
|
||||
<option value="<?php echo TICKET; ?>" <?php echo (isset($type) && $type == TICKET ? 'selected="yes"' : ''); ?>>Ticket</option>
|
||||
<!--option value="<?php echo ARTICLE; ?>">Article</option-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if($action == 'edit')
|
||||
{
|
||||
$player = $ots->createObject('Player');
|
||||
$player->load($player_id);
|
||||
if($player->isLoaded())
|
||||
{
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td width="180"><b>Author:</b></td>
|
||||
<td>
|
||||
<select name="original_id" disabled="disabled">
|
||||
<?php
|
||||
echo '<option value="' . $player->getId() . '">' . $player->getName() . '</option>';
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td width="180"><b><?php echo ($action == 'edit' ? 'Modified by' : 'Author'); ?>:</b></td>
|
||||
<td>
|
||||
<select name="player_id">
|
||||
<?php
|
||||
$account_players = $account_logged->getPlayersList();
|
||||
$account_players->orderBy('group_id', POT::ORDER_DESC);
|
||||
$player_number = 0;
|
||||
foreach($account_players as $player)
|
||||
{
|
||||
echo '<option value="' . $player->getId() . '"';
|
||||
if(isset($player_id) && $player->getId() == $player_id)
|
||||
echo ' selected="selected"';
|
||||
echo '>' . $player->getName() . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Category:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
if(!isset($category))
|
||||
$category = 0;
|
||||
foreach($categories as $id => $cat): ?>
|
||||
<input type="radio" name="category" value="<?php echo $id; ?>" <?php echo (((isset($category) && $category == 0 && $id == 1) || (isset($category) && $category == $id)) ? 'checked="yes"' : ''); ?>/> <img src="images/news/icon_<?php echo $cat['icon_id']; ?>_small.gif" />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($action == ''):
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td><b>Create forum thread in section:</b></td>
|
||||
<td>
|
||||
<select name="forum_section">
|
||||
<option value="-1">None</option>
|
||||
<?php
|
||||
foreach(getForumSections() as $section): ?>
|
||||
<option value="<?php echo $section['id']; ?>" <?php echo (isset($forum_section) && $forum_section == $section['id']) ? 'checked="yes"' : ''; ?>/><?php echo $section['name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<tr bgcolor="<?php echo getStyle($rows++); ?>">
|
||||
<td align="right">
|
||||
<input type="submit" value="Submit"/>
|
||||
</td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '<?php echo getPageLink(PAGE); ?>';" value="Cancel"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php if($action != 'edit'): ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#news-edit").hide();
|
||||
});
|
||||
|
||||
$("#news-button").click(function() {
|
||||
$("#news-edit").toggle();
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
echo $twig->render('news.add.html.twig', array(
|
||||
'action' => $action,
|
||||
'news_link' => getPageLink(PAGE),
|
||||
'news_link_form' => getPageLink('news', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'news_id' => isset($id) ? $id : null,
|
||||
'title' => isset($p_title) ? $p_title : '',
|
||||
'body' => isset($body) ? $body : '',
|
||||
'type' => isset($type) ? $type : null,
|
||||
'player' => isset($player) && $player->isLoaded() ? $player : null,
|
||||
'player_id' => isset($player_id) ? $player_id : null,
|
||||
'account_players' => $account_players,
|
||||
'category' => isset($category) ? $category : 0,
|
||||
'categories' => $categories,
|
||||
'forum_boards' => getForumBoards(),
|
||||
'forum_section' => isset($forum_section) ? $forum_section : null
|
||||
));
|
||||
}
|
||||
|
||||
$newses =
|
||||
@@ -427,7 +311,7 @@ if(!$news_cached)
|
||||
foreach($newses as $news)
|
||||
{
|
||||
$author = '';
|
||||
$query = $db->query('SELECT name FROM players WHERE id = ' . $db->quote($news['player_id'] . ' LIMIT 1'));
|
||||
$query = $db->query('SELECT `name` FROM `players` WHERE id = ' . $db->quote($news['player_id'] . ' LIMIT 1'));
|
||||
if($query->rowCount() > 0) {
|
||||
$query = $query->fetch();
|
||||
$author = $query['name'];
|
||||
@@ -447,8 +331,27 @@ if(!$news_cached)
|
||||
' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '
|
||||
</a>';
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
$content_ = $news['body'];
|
||||
$firstLetter = '';
|
||||
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_ = $firstLetter . substr($content_, 1);
|
||||
}
|
||||
}
|
||||
|
||||
echo $twig->render('news.html.twig', array(
|
||||
'title' => stripslashes($news['title']),
|
||||
'content' => $content_ . $admin_options,
|
||||
'date' => $news['date'],
|
||||
'icon' => $categories[$news['category']]['icon_id'],
|
||||
'author' => $config['news_author'] ? $author : '',
|
||||
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
|
||||
'news_date_format' => $config['news_date_format']
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,7 +467,7 @@ class Forum
|
||||
{
|
||||
global $db;
|
||||
$thread_id = 0;
|
||||
if($db->insert(TABLE_PREFIX . 'forum', array('id' => 'null', 'first_post' => 0, 'last_post' => time(), 'section' => $section_id, 'replies' => 0, 'views' => 0, 'author_aid' => isset($account_id) ? $account_id : 0, 'author_guid' => isset($player_id) ? $player_id : 0, 'post_text' => $body, 'post_topic' => $title, 'post_smile' => 0, 'post_date' => time(), 'last_edit_aid' => 0, 'edit_date' => 0, 'post_ip' => $_SERVER['REMOTE_ADDR']))) {
|
||||
if($db->insert(TABLE_PREFIX . 'forum', array('first_post' => 0, 'last_post' => time(), 'section' => $section_id, 'replies' => 0, 'views' => 0, 'author_aid' => isset($account_id) ? $account_id : 0, 'author_guid' => isset($player_id) ? $player_id : 0, 'post_text' => $body, 'post_topic' => $title, 'post_smile' => 0, 'post_date' => time(), 'last_edit_aid' => 0, 'edit_date' => 0, 'post_ip' => $_SERVER['REMOTE_ADDR']))) {
|
||||
$thread_id = $db->lastInsertId();
|
||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -14,13 +14,7 @@ $title = 'Who is online?';
|
||||
|
||||
if($config['account_country'])
|
||||
require(SYSTEM . 'countries.conf.php');
|
||||
?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white"><b>Server Status</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
$promotion = '';
|
||||
if(fieldExist('promotion', 'players'))
|
||||
$promotion = '`promotion`,';
|
||||
@@ -63,6 +57,7 @@ if(tableExist('players_online')) // tfs 1.0
|
||||
else
|
||||
$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`' . $outfit . ', ' . $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_data = array();
|
||||
$players = 0;
|
||||
$data = '';
|
||||
foreach($playersOnline as $player)
|
||||
@@ -70,202 +65,91 @@ foreach($playersOnline as $player)
|
||||
$skull = '';
|
||||
if($config['online_skulls'])
|
||||
{
|
||||
if($player['skulltime'] > 0 && $player['skull'] == 3)
|
||||
$skull = ' <img style="border: 0;" src="images/white_skull.gif"/>';
|
||||
elseif($player['skulltime'] > 0 && $player['skull'] == 4)
|
||||
$skull = ' <img style="border: 0;" src="images/red_skull.gif"/>';
|
||||
elseif($player['skulltime'] > 0 && $player['skull'] == 5)
|
||||
$skull = ' <img style="border: 0;" src="images/black_skull.gif"/>';
|
||||
if($player['skulltime'] > 0)
|
||||
{
|
||||
if($player['skull'] == 3)
|
||||
$skull = ' <img style="border: 0;" src="images/white_skull.gif"/>';
|
||||
elseif($player['skull'] == 4)
|
||||
$skull = ' <img style="border: 0;" src="images/red_skull.gif"/>';
|
||||
elseif($player['skull'] == 5)
|
||||
$skull = ' <img style="border: 0;" src="images/black_skull.gif"/>';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($player['promotion'])) {
|
||||
if((int)$player['promotion'] > 0)
|
||||
$player['vocation'] += ($player['promotion'] * $config['vocations_amount']);
|
||||
}
|
||||
|
||||
$data .= '<tr bgcolor="' . getStyle(++$players) . '">';
|
||||
if($config['account_country'])
|
||||
$data .= '<td>' . getFlagImage($player['country']) . '</td>';
|
||||
|
||||
if($config['online_outfit'])
|
||||
$data .= '<TD WIDTH=5%><img style="position:absolute;margin-top:' . (in_array($player['looktype'], array(75, 266, 302)) ? '-20px;margin-left:-0px;' : '-45px;margin-left:-25px;') . '" src="' . $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td>';
|
||||
|
||||
$data .= '<td>' . getPlayerLink($player['name']) . $skull . '</td>
|
||||
<td>'.$player['level'].'</td>
|
||||
<td>'.$config['vocations'][$player['vocation']].'</td>
|
||||
</tr>';
|
||||
|
||||
|
||||
$players_data[] = array(
|
||||
'name' => getPlayerLink($player['name']),
|
||||
'player' => $player,
|
||||
'level' => $player['level'],
|
||||
'vocation' => $config['vocations'][$player['vocation']],
|
||||
'country_image' => $config['account_country'] ? getFlagImage($player['country']) : null,
|
||||
'outfit' => $config['online_outfit'] ? $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null
|
||||
);
|
||||
|
||||
if($config['online_vocations'])
|
||||
$vocs[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++;
|
||||
}
|
||||
|
||||
if(!$players): ?>
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>"><td>Currently no one is playing on <?php echo $config['lua']['serverName']; ?>.</td></tr></table>
|
||||
<?php else:
|
||||
?>
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>">
|
||||
<td>
|
||||
<?php
|
||||
if(!$status['online'])
|
||||
echo 'Server is offline.<br/>';
|
||||
else
|
||||
{
|
||||
if($config['online_afk'])
|
||||
{
|
||||
$afk = $players - $status['players'];
|
||||
if($afk < 0) {
|
||||
$players += abs($afk);
|
||||
$afk = 0;
|
||||
}
|
||||
?>
|
||||
Currently there are <b><?php echo $status['players']; ?></b> active and <b><?php echo $afk ?></b> AFK players.<br/>
|
||||
Total number of players: <b><?php echo $players; ?></b>.<br/>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
echo 'Currently ' . $players . ' players are online.<br/>';
|
||||
}
|
||||
|
||||
if($config['online_record'])
|
||||
{
|
||||
$timestamp = false;
|
||||
if(tableExist('server_record')) {
|
||||
$record = '';
|
||||
if($players > 0)
|
||||
{
|
||||
if($config['online_record'])
|
||||
{
|
||||
$timestamp = false;
|
||||
if(tableExist('server_record')) {
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT ' . $db->fieldName('record') . ', ' . $db->fieldName('timestamp') .
|
||||
' FROM ' . $db->tableName('server_record') .
|
||||
' WHERE ' . $db->fieldName('world_id') . ' = ' . (int)$config['lua']['worldId'] .
|
||||
' ORDER BY ' . $db->fieldName('record') . ' DESC LIMIT 1');
|
||||
$timestamp = true;
|
||||
}
|
||||
else if(tableExist('server_config')) { // tfs 1.0
|
||||
$query = $db->query('SELECT `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record'));
|
||||
}
|
||||
else
|
||||
$query = NULL;
|
||||
|
||||
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']) . '.' : '.');
|
||||
}
|
||||
'SELECT `record`, `timestamp` FROM `server_record` WHERE `world_id` = ' . (int)$config['lua']['worldId'] .
|
||||
' ORDER BY `record` DESC LIMIT 1');
|
||||
$timestamp = true;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
else if(tableExist('server_config')) { // tfs 1.0
|
||||
$query = $db->query('SELECT `value` as `record` FROM `server_config` WHERE `config` = ' . $db->quote('players_record'));
|
||||
}
|
||||
else
|
||||
$query = NULL;
|
||||
|
||||
if(isset($query) && $query->rowCount() > 0)
|
||||
{
|
||||
$result = $query->fetch();
|
||||
$record = 'The maximum on this game world was ' . $result['record'] . ' players' . ($timestamp ? ' on ' . date("M d Y, H:i:s", $result['timestamp']) . '.' : '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
// vocation statistics
|
||||
if($config['online_vocations']): ?>
|
||||
<br/>
|
||||
<?php if($config['online_vocations_images']): ?>
|
||||
<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr bgcolor="<?php echo $config['darkborder']; ?>">
|
||||
<td><img src="images/sorcerer.png" /></td>
|
||||
<td><img src="images/druid.png" /></td>
|
||||
<td><img src="images/palladin.png" /></td>
|
||||
<td><img src="images/knight.png" /></td>
|
||||
</tr>
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" style="text-align: center;"><strong>Sorcerers<br /></strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Druids</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Paladins</strong></td>
|
||||
<td class="white" style="text-align: center;"><strong>Knights</strong></td>
|
||||
</tr>
|
||||
<tr bgcolor="<?php echo $config['lightborder']; ?>">
|
||||
<td style="text-align: center;"><?php echo $vocs[1]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[2]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[3]; ?></td>
|
||||
<td style="text-align: center;"><?php echo $vocs[4]; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: center;"> </div>
|
||||
<?php else: ?>
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<td class="white" colspan="2"><b>Vocation statistics</b></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
for($i = 1; $i <= $config['vocations_amount']; $i++)
|
||||
echo '<tr bgcolor="' . getStyle($i) . '">
|
||||
<td width="25%">' . $config['vocations'][$i] . '</td>
|
||||
<td width="75%">' . $vocs[$i] . '</td>
|
||||
</tr>';
|
||||
?>
|
||||
</table><br/>
|
||||
<?php endif;
|
||||
endif;
|
||||
|
||||
// frags counter
|
||||
if($config['online_skulls']): ?>
|
||||
<table width="100%" cellspacing="1">
|
||||
<tr>
|
||||
<td style="background: <?php echo $config['darkborder']; ?>;" align="center">
|
||||
<img src="images/white_skull.gif"/> - 1 - 6 Frags<br/>
|
||||
<img src="images/red_skull.gif"/> - 6+ Frags or Red Skull<br/>
|
||||
<img src="images/black_skull.gif"/> - 10+ Frags or Black Skull
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="<?php echo $config['vdarkborder']; ?>">
|
||||
<?php if($config['account_country']): ?>
|
||||
<td width="11px"><a href="?subtopic=online&order=country" class="white">#</A></td>
|
||||
<?php endif; ?>
|
||||
<?php if($config['online_outfit']): ?>
|
||||
<td class="white"><b>Outfit</b></td>
|
||||
<?php endif; ?>
|
||||
<td width="60%"><a href="?subtopic=online&order=name" class="white">Name</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=level" class="white">Level</A></td>
|
||||
<td width="20%"><a href="?subtopic=online&order=vocation" class="white">Vocation</td>
|
||||
</tr>
|
||||
<?php echo $data; ?>
|
||||
</table>
|
||||
<?php
|
||||
endif;
|
||||
echo $twig->render('online.html.twig', array(
|
||||
'players' => $players_data,
|
||||
'record' => $record
|
||||
));
|
||||
|
||||
//search bar
|
||||
echo '<br/>
|
||||
<FORM ACTION="?subtopic=characters" METHOD=post>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
|
||||
<TR>
|
||||
<TD BGCOLOR="'.$config['vdarkborder'].'" class="white">
|
||||
<B>Search Character</B>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD BGCOLOR="'.$config['darkborder'].'">
|
||||
<TABLE BORDER=0 CELLPADDING=1>
|
||||
<TR>
|
||||
<TD>Name:</TD>
|
||||
<TD>
|
||||
<INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29>
|
||||
</TD>
|
||||
<TD>
|
||||
<INPUT TYPE=image NAME="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</FORM>';
|
||||
|
||||
/* temporary disable it - shows server offline
|
||||
// update online players counter
|
||||
if($players > 0)
|
||||
{
|
||||
$status['players'] = $players;
|
||||
if($cache->enabled())
|
||||
$cache->set('status', serialize($status));
|
||||
else
|
||||
{
|
||||
foreach($status as $key => $value)
|
||||
updateDatabaseConfig('serverStatus_' . $key, $value);
|
||||
}
|
||||
}*/
|
||||
<form action="?subtopic=characters" method=post>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<td bgcolor="'.$config['vdarkborder'].'" class="white">
|
||||
<b>Search Character</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="'.$config['darkborder'].'">
|
||||
<table border=0 cellpadding=1>
|
||||
<tr>
|
||||
<td>Name:</td>
|
||||
<td>
|
||||
<input name="name" value=""size=29 maxlength=29>
|
||||
</td>
|
||||
<td>
|
||||
<input type="image" name="Submit" src="'.$template_path.'/images/buttons/sbutton_submit.gif" border="0" width="120" height="18">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>';
|
||||
?>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Averatec <pervera.pl & otland.net>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
@@ -6,42 +6,10 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Server Rules';
|
||||
|
||||
if(PAGE == 'rules'): ?>
|
||||
<b><?php echo $config['lua']['serverName']; ?> Rules</b><br/>
|
||||
<textarea rows="25" wrap="physical" cols="70" readonly="true">
|
||||
<?php endif; ?>
|
||||
1. Names
|
||||
a) Names which contain insulting (e.g. "Bastard"), racist (e.g. "Nigger"), extremely right-wing (e.g. "Hitler"), sexist (e.g. "Bitch") or offensive (e.g. "Copkiller") language.
|
||||
b) Names containing parts of sentences (e.g. "Mike returns"), nonsensical combinations of letters (e.g. "Fgfshdsfg") or invalid formattings (e.g. "Thegreatknight").
|
||||
c) Names that obviously do not describe a person (e.g. "Christmastree", "Matrix"), names of real life celebrities (e.g. "Britney Spears"), names that refer to real countries (e.g. "Swedish Druid"), names which were created to fake other players' identities (e.g. "Arieswer" instead of "Arieswar") or official positions (e.g. "System Admin").
|
||||
|
||||
2. Cheating
|
||||
a) Exploiting obvious errors of the game ("bugs"), for instance to duplicate items. If you find an error you must report it to CipSoft immediately.
|
||||
b) Intentional abuse of weaknesses in the gameplay, for example arranging objects or players in a way that other players cannot move them.
|
||||
c) Using tools to automatically perform or repeat certain actions without any interaction by the player ("macros").
|
||||
d) Manipulating the client program or using additional software to play the game.
|
||||
e) Trying to steal other players' account data ("hacking").
|
||||
f) Playing on more than one account at the same time ("multi-clienting").
|
||||
g) Offering account data to other players or accepting other players' account data ("account-trading/sharing").
|
||||
|
||||
3. Gamemasters
|
||||
a) Threatening a gamemaster because of his or her actions or position as a gamemaster.
|
||||
b) Pretending to be a gamemaster or to have influence on the decisions of a gamemaster.
|
||||
c) Intentionally giving wrong or misleading information to a gamemaster concerning his or her investigations or making false reports about rule violations.
|
||||
|
||||
4. Player Killing
|
||||
a) Excessive killing of characters who are not marked with a "skull" on worlds which are not PvP-enforced. Please note that killing marked characters is not a reason for a banishment.
|
||||
|
||||
A violation of the Tibia Rules may lead to temporary banishment of characters and accounts. In severe cases removal or modification of character skills, attributes and belongings, as well as the permanent removal of accounts without any compensation may be considered. The sanction is based on the seriousness of the rule violation and the previous record of the player. It is determined by the gamemaster imposing the banishment.
|
||||
|
||||
These rules may be changed at any time. All changes will be announced on the official website.
|
||||
<?php
|
||||
if(PAGE == 'rules'): ?>
|
||||
</textarea>
|
||||
<?php endif;?>
|
||||
echo $twig->render('rules.html.twig');
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -53,15 +53,13 @@ if($canEdit) {
|
||||
}
|
||||
|
||||
if (!empty($errors))
|
||||
output_errors($errors);
|
||||
echo $twig->render('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
echo $twig->render('screenshots.form.html', array(
|
||||
echo $twig->render('screenshots.form.html.twig', array(
|
||||
'link' => getPageLink('screenshots', ($action == 'edit' ? 'edit' : 'add')),
|
||||
'action' => $action,
|
||||
'id' => isset($id) ? $id : null,
|
||||
'vdarkborder' => $config['vdarkborder'],
|
||||
'darkborder' => $config['darkborder'],
|
||||
'comment' => isset($comment) ? $comment : null,
|
||||
'image' => isset($image) ? $image : null,
|
||||
'author' => isset($author) ? $author : null
|
||||
@@ -94,7 +92,7 @@ if(isset($_GET['screenshot']))
|
||||
else
|
||||
$next_screenshot = NULL;
|
||||
|
||||
echo $twig->render('screenshots.get.html', array(
|
||||
echo $twig->render('screenshots.get.html.twig', array(
|
||||
'previous' => $previous_screenshot ? $previous_screenshot['id'] : null,
|
||||
'next' => $next_screenshot ? $next_screenshot['id'] : null,
|
||||
'screenshot' => $screenshot
|
||||
@@ -118,7 +116,7 @@ if(!$last)
|
||||
return;
|
||||
}
|
||||
|
||||
echo $twig->render('screenshots.html', array(
|
||||
echo $twig->render('screenshots.html.twig', array(
|
||||
'screenshots' => $screenshots,
|
||||
'last' => $last,
|
||||
'canEdit' => $canEdit
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -69,7 +69,7 @@ if(isset($_POST['reload_spells']) && $canEdit)
|
||||
$type = 2;
|
||||
$count = $spell->getConjureCount();
|
||||
try {
|
||||
$db->query('INSERT INTO myaac_spells (spell, name, words, type, mana, level, maglevel, soul, premium, vocations, conjure_count, hidden) VALUES (' . $db->quote($spell_txt) . ', ' . $db-quote($name) . ', ' . $db->quote($spell_txt) , ', ' . $db->quote($type) . ', ' . $db->quote($mana) . ', ' . $db->quote($lvl) . ', ' . $db->quote($mlvl) . ', ' . $db->quote($soul) . ', ' . $db>quote($pacc) . ', ' . $db->quote($vocations_to_db) . ', ' . $db->quote($count) . ', ' . $db->quote($hide_spell) . ')');
|
||||
$db->query('INSERT INTO myaac_spells (spell, name, words, type, mana, level, maglevel, soul, premium, vocations, conjure_count, hidden) VALUES (' . $db->quote($spell_txt) . ', ' . $db->quote($name) . ', ' . $db->quote($spell_txt) . ', ' . $db->quote($type) . ', ' . $db->quote($mana) . ', ' . $db->quote($lvl) . ', ' . $db->quote($mlvl) . ', ' . $db->quote($soul) . ', ' . $db->quote($pacc) . ', ' . $db->quote($vocations_to_db) . ', ' . $db->quote($count) . ', ' . $db->quote($hide_spell) . ')');
|
||||
success("Added: " . $name . "<br>");
|
||||
}
|
||||
catch(PDOException $error) {
|
||||
@@ -143,7 +143,7 @@ if($canEdit)
|
||||
<?php
|
||||
}
|
||||
|
||||
$vocation_id = (int) (isset($_REQUEST['vocation_id']) ? $_REQUEST['vocation_id'] : 'All');
|
||||
$vocation_id = (isset($_REQUEST['vocation_id']) ? (int)$_REQUEST['vocation_id'] : 'All');
|
||||
$order = 'spell';
|
||||
if(isset($_GET['order']))
|
||||
$order = $_GET['order'];
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Gesior <jerzyskalski@wp.pl>
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.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.3.0
|
||||
* @version 0.4.3
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
@@ -79,7 +79,7 @@ $template['link_account_logout'] = internalLayoutLink(($config['friendly_urls']
|
||||
|
||||
$template['link_news_archive'] = internalLayoutLink('news' . ($config['friendly_urls'] ? '/' : '') . 'archive');
|
||||
|
||||
$links = array('news', 'changelog', 'rules', 'downloads', 'characters', 'online', 'highscores', 'powergamers', 'lastkills', 'houses', 'guilds', 'wars', 'polls', 'bans', 'team', 'creatures', 'spells', 'commands', 'experienceStages', 'freeHouses', 'screenshots', 'movies', 'serverInfo', 'experienceTable', 'faq', 'points', 'gifts');
|
||||
$links = array('news', 'changelog', 'rules', 'downloads', 'characters', 'online', 'highscores', 'powergamers', 'lastkills', 'houses', 'guilds', 'wars', 'polls', 'bans', 'team', 'creatures', 'spells', 'commands', 'experienceStages', 'freeHouses', 'screenshots', 'movies', 'serverInfo', 'experienceTable', 'faq', 'points', 'gifts', 'bugtracker');
|
||||
foreach($links as $link) {
|
||||
$template['link_' . $link] = internalLayoutLink($link);
|
||||
}
|
||||
@@ -92,4 +92,8 @@ if($config['forum'] != '')
|
||||
else
|
||||
$template['link_forum'] = "<a href='" . $config['forum'] . "' target='_blank'>";
|
||||
}
|
||||
|
||||
$twig->addGlobal('template_path', $template_path);
|
||||
if($twig_loader && file_exists(BASE . $template_path))
|
||||
$twig_loader->prependPath(BASE . $template_path);
|
||||
?>
|
||||
|
113
system/templates/account.change_comment.html.twig
Normal file
113
system/templates/account.change_comment.html.twig
Normal file
@@ -0,0 +1,113 @@
|
||||
Here you can see and edit the information about your character.<br/>
|
||||
If you do not want to specify a certain field, just leave it blank.<br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=changecomment" method="post">
|
||||
<div class="TableContainer" >
|
||||
<table class="Table5" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Edit Character Information</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="TableShadowContainerRightTop">
|
||||
<div class="TableShadowRightTop" style="background-image:url({{ template_path }}/images/content/table-shadow-rt.gif);" ></div>
|
||||
</div>
|
||||
<div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);">
|
||||
<div class="TableContentContainer">
|
||||
<table class="TableContent" width="100%">
|
||||
<tr>
|
||||
<td class="LabelV">Name:</td>
|
||||
<td style="width:80%;" >{{ player_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" >Hide Account:</td>
|
||||
<td>
|
||||
<input type="hidden" value="0" name="accountvisible">
|
||||
<input type="checkbox" name="accountvisible" id="accountvisible" value="1" {% if player.getCustomField('hidden') == 1 %}checked="checked"{% endif %}>
|
||||
<label for="accountvisible"> check to hide your account information</label>
|
||||
{% if player.getCustomField('group_id') > 1 %} (you will be also hidden on the Team page!){% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="TableShadowContainer">
|
||||
<div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bm.gif);">
|
||||
<div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div>
|
||||
<div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-br.gif);"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="TableShadowContainerRightTop">
|
||||
<div class="TableShadowRightTop" style="background-image:url({{ template_path }}/images/content/table-shadow-rt.gif);"></div>
|
||||
</div>
|
||||
<div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);">
|
||||
<div class="TableContentContainer">
|
||||
<table class="TableContent" width="100%">
|
||||
<tr>
|
||||
<td class="LabelV" ><span>Comment:</span></td>
|
||||
<td style="width:80%;"><textarea name="comment" rows="10" cols="50" wrap="virtual">{{ player.getCustomField('comment')|raw }}</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="TableShadowContainer">
|
||||
<div class="TableBottomShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bm.gif);">
|
||||
<div class="TableBottomLeftShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-bl.gif);"></div>
|
||||
<div class="TableBottomRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-br.gif);" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<input type="hidden" name="name" value="{{ player.getName() }}">
|
||||
<input type="hidden" name="changecommentsave" value="1">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
104
system/templates/account.change_info.html.twig
Normal file
104
system/templates/account.change_info.html.twig
Normal file
@@ -0,0 +1,104 @@
|
||||
Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.<br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=changeinfo" method=post>
|
||||
<div class="TableContainer" >
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
<div class="CaptionContainer" >
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<div class="Text" >Change Public Information</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer" >
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >Real Name:</td>
|
||||
<td style="width:90%;" >
|
||||
<input name="info_rlname" value="{{ account_rlname }}" size="30" maxlength="50" >
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" >Location:</td>
|
||||
<td>
|
||||
<input name="info_location" value="{{ account_location }}" size="30" maxlength="50" >
|
||||
</td>
|
||||
</tr>
|
||||
{% if config.account_country %}
|
||||
<tr>
|
||||
<td class="LabelV" >Country:</td>
|
||||
<td>
|
||||
<select name="info_country" id="account_country">
|
||||
{% for code, country in countries %}
|
||||
<option value="{{ code}}"{% if account_country == code %} selected{% endif %}>{{ country }} </option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<img src="" id="account_country_img"/>
|
||||
<script>
|
||||
function updateFlag()
|
||||
{
|
||||
var img = $('#account_country_img');
|
||||
var country = $('#account_country :selected').val();
|
||||
if(country.length) {
|
||||
img.attr('src', 'images/flags/' + country + '.gif');
|
||||
img.show();
|
||||
}
|
||||
else {
|
||||
img.hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
updateFlag();
|
||||
$('#account_country').change(function() {
|
||||
updateFlag();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table width="100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<input type="hidden" name="changeinfosave" value="1">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div>
|
||||
<input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
</form>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<form action="?subtopic=accountmanagement" method="post" >
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" >
|
||||
<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);"></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
72
system/templates/account.change_mail.html.twig
Normal file
72
system/templates/account.change_mail.html.twig
Normal file
@@ -0,0 +1,72 @@
|
||||
Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of {{ config.account_mail_change }} days.</b><br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=changeemail" method="post">
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Change Email Address</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span >New Email Address:</span>
|
||||
</td>
|
||||
<td style="width:90%;">
|
||||
<input name="new_email" value="{% if new_email is defined %}{{ new_email }}{% endif %}" size="30" maxlength="50" autofocus/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV">
|
||||
<span >Password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password" size="30" maxlength="29">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%;">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<input type="hidden" name="changeemailsave" value="1"/>
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
</td>
|
||||
</form>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
76
system/templates/account.change_name.html.twig
Normal file
76
system/templates/account.change_name.html.twig
Normal file
@@ -0,0 +1,76 @@
|
||||
To change a name of character select player and choose a new name.<br/>
|
||||
<font color="red">Change name cost {{ config.account_change_character_name_points }} premium points. You have {{ points }} premium points.</font><br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=changename" method="post">
|
||||
<input type="hidden" name="changenamesave" value="1">
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Change Name</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer" >
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" ><span>Character:</span></td>
|
||||
<td style="width:90%;" >
|
||||
<select name="player_id">
|
||||
{% for player in account_logged.getPlayersList() %}
|
||||
<option value="{{ player.getId() }}">{{ player.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" ><span>New Name:</span></td>
|
||||
<td>
|
||||
<input type="text" name="name" id="name" onkeyup="checkName();" size="25" maxlength="25" >
|
||||
<font size="1" face="verdana,arial,helvetica">
|
||||
<div id="name_check">Please enter your character name.</div>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%" >
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
80
system/templates/account.change_password.html.twig
Normal file
80
system/templates/account.change_password.html.twig
Normal file
@@ -0,0 +1,80 @@
|
||||
Please enter your current password and a new password. For your security, please enter the new password twice.<br/>
|
||||
<br/>
|
||||
<form action="?subtopic=accountmanagement&action=changepassword" method="post">
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Change Password</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="LabelV">
|
||||
<span>New Password:</span>
|
||||
</td>
|
||||
<td style="width:90%;">
|
||||
<input type="password" name="newpassword" size="30" maxlength="29">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV">
|
||||
<span>New Password Again:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="newpassword2" size="30" maxlength="29">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV">
|
||||
<span>Current Password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="oldpassword" size="30" maxlength="29">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%;">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
</td>
|
||||
</form>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
78
system/templates/account.change_sex.html.twig
Normal file
78
system/templates/account.change_sex.html.twig
Normal file
@@ -0,0 +1,78 @@
|
||||
To change a sex of character select player and choose a new sex.<br/>
|
||||
<font color="red">Change sex cost {{ config.account_change_character_sex_points }} premium points. You have {{ points }} premium points.</font><br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=changesex" method="post">
|
||||
<input type="hidden" name="changesexsave" value="1"/>
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Change sex</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" ><span >Character:</td>
|
||||
<td style="width:90%;" >
|
||||
<select name="player_id">
|
||||
{% for player in players %}
|
||||
<option value="{{ player.getId() }}">{{ player.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" ><span >New Sex:</td>
|
||||
<td>
|
||||
<select name="new_sex">
|
||||
{% for id, gender in config.genders %}
|
||||
<option value="{{ id }}"{% if player_sex == id %} selected{% endif %}>{{ gender }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
162
system/templates/account.create.html.twig
Normal file
162
system/templates/account.create.html.twig
Normal file
@@ -0,0 +1,162 @@
|
||||
To play on {{ config.lua.serverName }} you need an account.
|
||||
All you have to do to create your new account is to enter an account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}, password{% if config.recaptcha_enabled %}, confirm reCAPTCHA{% endif %}{% if config.account_country %}, country{% endif %} and your email address.
|
||||
Also you have to agree to the terms presented below. If you have done so, your account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %} 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" id="createaccount">
|
||||
<div class="TableContainer" >
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
<div class="CaptionContainer" >
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<div class="Text" >Create {{ config.lua.serverName }} Account</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer" >
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.account[0] is defined %} class="red"{% endif %}>Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="account" id="account_input" onkeyup="checkAccount();" size="30" maxlength="{% if constant('USE_ACCOUNT_NAME') %}30{% else %}10{% endif %}" value="{{ account }}" autofocus/>
|
||||
<small id="acc_check"></small>
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.account is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.account }}</span></td></tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.email[0] is defined %} class="red"{% endif %}>Email Address:</span>
|
||||
</td>
|
||||
<td style="width:100%;" >
|
||||
<input type="text" name="email" id="email" onkeyup="checkEmail();" size="30" maxlength="50" value="{{ email }}" />
|
||||
<small id="email_check"></small>
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.email is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.email }}</span></td></tr>
|
||||
{% endif %}
|
||||
{% if config.account_country %}
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.country[0] is defined %} class="red"{% endif %}>Country:</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="country" id="account_country">
|
||||
{% for code, country_ in countries %}
|
||||
<option value="{{ code }}"{% if(country is defined and country == code) or (country is null and country_recognized == code) %}selected{% endif %}>{{ country_ }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<img src="" id="account_country_img"/>
|
||||
<script>
|
||||
function updateFlag()
|
||||
{
|
||||
var img = $('#account_country_img');
|
||||
var country = $('#account_country :selected').val();
|
||||
if(country.length) {
|
||||
img.attr('src', 'images/flags/' + country + '.gif');
|
||||
img.show();
|
||||
}
|
||||
else {
|
||||
img.hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
updateFlag();
|
||||
$('#account_country').change(function() {
|
||||
updateFlag();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.country is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.country }}</span></td></tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password" value="" size="30" maxlength="50" />
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.password is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.password }}</span></td></tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.password[0] is defined %} class="red"{% endif %}>Repeat password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password2" value="" size="30" maxlength="50" />
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.password is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.password }}</span></td></tr>
|
||||
{% endif %}
|
||||
{% if config.recaptcha_enabled %}
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if errors.verification[0] is defined %} class="red"{% endif %}>Verification:</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="g-recaptcha" data-sitekey="{{ config.recaptcha_site_key }}" data-theme="{{ config.recaptcha_theme }}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.verification is defined %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ errors.verification }}</span></td></tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td><br/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" ><b>Please select all of the following check boxes:</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" >
|
||||
<span><input type="checkbox" id="accept_rules" name="accept_rules" value="true"{% if accept_rules %}checked{% endif %}/> <label for="accept_rules">I agree to the <a href="?subtopic=rules" target="_blank">{{ config.lua.serverName }} Rules</a>.</label></span>
|
||||
</td>
|
||||
</tr>
|
||||
{% if errors.accept_rules is defined %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="FormFieldError">{{ errors.accept_rules }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</table></div></td></tr><br/>
|
||||
<table width="100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td style="border:0px;" >
|
||||
<input type="hidden" name="step" value="save" >
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" >
|
||||
<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
|
||||
<div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div>
|
||||
<input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
133
system/templates/account.create.js.html.twig
Normal file
133
system/templates/account.create.js.html.twig
Normal file
@@ -0,0 +1,133 @@
|
||||
<script type="text/javascript">
|
||||
eventId = 0;
|
||||
lastSend = 0;
|
||||
|
||||
$(function() {
|
||||
$('#createaccount').submit(function () {
|
||||
return validate_form(this);
|
||||
});
|
||||
});
|
||||
|
||||
function checkAccount()
|
||||
{
|
||||
if(eventId != 0)
|
||||
{
|
||||
clearInterval(eventId);
|
||||
eventId = 0;
|
||||
}
|
||||
|
||||
if(document.getElementById("account_input").value == "")
|
||||
{
|
||||
document.getElementById("acc_check").innerHTML = '<b><font color="red">Please enter account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}.</font></b>';
|
||||
return;
|
||||
}
|
||||
|
||||
// anti flood
|
||||
var date = new Date;
|
||||
var timeNow = parseInt(date.getTime());
|
||||
|
||||
if(lastSend != 0)
|
||||
{
|
||||
if(timeNow - lastSend < 1100)
|
||||
{
|
||||
eventId = setInterval('checkAccount()', 1100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var account = document.getElementById("account_input").value;
|
||||
$.get("tools/validate.php", { account: account, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("acc_check").innerHTML = data;
|
||||
lastSend = timeNow;
|
||||
});
|
||||
}
|
||||
|
||||
function checkEmail()
|
||||
{
|
||||
if(eventId != 0)
|
||||
{
|
||||
clearInterval(eventId)
|
||||
eventId = 0;
|
||||
}
|
||||
|
||||
if(document.getElementById("email").value == "")
|
||||
{
|
||||
document.getElementById("email_check").innerHTML = '<b><font color="red">Please enter e-mail.</font></b>';
|
||||
return;
|
||||
}
|
||||
|
||||
//anti flood
|
||||
var date = new Date;
|
||||
vartimeNow = parseInt(date.getTime());
|
||||
|
||||
if(lastSend != 0)
|
||||
{
|
||||
if(timeNow - lastSend < 1100)
|
||||
{
|
||||
eventId = setInterval('checkEmail()', 1100)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var email = document.getElementById("email").value;
|
||||
$.get("tools/validate.php", { email: email, uid: Math.random() },
|
||||
function(data){
|
||||
document.getElementById("email_check").innerHTML = data;
|
||||
lastSend = timeNow;
|
||||
});
|
||||
}
|
||||
|
||||
function validate_required(field,alerttxt)
|
||||
{
|
||||
with (field)
|
||||
{
|
||||
if (value==null || value=="" || value==" ")
|
||||
{
|
||||
alert(alerttxt);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
function validate_email(field,alerttxt)
|
||||
{
|
||||
with (field)
|
||||
{
|
||||
apos=value.indexOf("@");
|
||||
dotpos=value.lastIndexOf(".");
|
||||
if (apos<1 || dotpos-apos<2)
|
||||
{
|
||||
alert(alerttxt);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function validate_form(thisform)
|
||||
{
|
||||
with (thisform)
|
||||
{
|
||||
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)
|
||||
{email.focus();return false;}
|
||||
{% if not config.account_mail_verify %}
|
||||
if (validate_required(passor,"Please enter password!")==false)
|
||||
{passor.focus();return false;}
|
||||
if (validate_required(passor2,"Please repeat password!")==false)
|
||||
{passor2.focus();return false;}
|
||||
if (passor2.value!=passor.value)
|
||||
{alert('Repeated password is not equal to password!');return false;}
|
||||
{% endif %}
|
||||
if(accept_rules.checked==false)
|
||||
{alert('To create account you must accept server rules!');return false;}
|
||||
}
|
||||
}
|
||||
</script>
|
147
system/templates/account.create_character.html.twig
Normal file
147
system/templates/account.create_character.html.twig
Normal file
@@ -0,0 +1,147 @@
|
||||
Please choose a name{% if config.character_samples|length > 1 %}, vocation{% endif %}
|
||||
{% if config.character_towns|length > 1 %}, town{% endif %}
|
||||
and sex for your character. <br/>
|
||||
In any case the name must not violate the naming conventions stated in the <a href="?subtopic=rules" target="_blank" >{{ config.lua.serverName }} Rules</a>, or your character might get deleted or name locked.
|
||||
{% if account_logged.getPlayersList()|length >= config.characters_per_account %}
|
||||
<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>
|
||||
{% endif %}
|
||||
<br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=createcharacter" method="post">
|
||||
<input type="hidden" name=savecharacter value="1">
|
||||
<div class="TableContainer">
|
||||
<table class="Table3" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Create Character</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="TableShadowContainerRightTop">
|
||||
<div class="TableShadowRightTop" style="background-image:url({{ template_path }}/images/content/table-shadow-rt.gif);"></div>
|
||||
</div>
|
||||
<div class="TableContentAndRightShadow" style="background-image:url({{ template_path }}/images/content/table-shadow-rm.gif);">
|
||||
<div class="TableContentContainer">
|
||||
<table class="TableContent" width="100%">
|
||||
<tr class="LabelH">
|
||||
<td style="width:50%;">
|
||||
<span>Name</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>Sex</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="Odd">
|
||||
<td>
|
||||
<input id="name" name="name" onkeyup="checkName();" value=" {{ name }}" size="25" maxlength="25" ><br/>
|
||||
<font size="1" face="verdana,arial,helvetica">
|
||||
<div id="name_check">Please enter your character name.</div>
|
||||
</font>
|
||||
</td>
|
||||
<td>
|
||||
{% set i = 0 %}
|
||||
{% for id, gender in config.genders|reverse(true) %}
|
||||
{% set i = i + 1 %}
|
||||
<input type="radio" name="sex" id="sex{{ i }}" value="{{ id }}"{% if sex is not null and sex == id %} checked="checked"{% endif %}
|
||||
><label for="sex{{ i }}">{{ gender|lower }}</label><br/>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
{% if config.character_samples|length > 1 %}
|
||||
<td>
|
||||
<table class="TableContent" width="100%">
|
||||
<tr class="Odd" valign="top">
|
||||
<td width="160"><br/><b>Select your vocation:</b></td>
|
||||
<td>
|
||||
<table class="TableContent" width="100%" >
|
||||
{% for key, sample_char in config.character_samples %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="radio" name="vocation" id="vocation{{ key }}" value="{{ key }}"
|
||||
{% if vocation is not null and vocation == key %} checked="checked"{% endif %}>
|
||||
<label for="vocation{{ key }}">{{ config['vocations'][key] }}</label>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% if config.character_towns|length > 1 %}
|
||||
<td>
|
||||
<table class="TableContent" width="100%">
|
||||
<tr class="Odd" valign="top">
|
||||
<td width="160"><br/><b>Select your city:</b></td>
|
||||
<td>
|
||||
<table class="TableContent" width="100%">
|
||||
{% for town_id in config.character_towns %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="radio" name="town" id="town{{ town_id }}" value="{{ town_id }}"
|
||||
{% if town is not null and town == town_id %} checked="checked"{% endif %}>
|
||||
<label for="town{{ town_id }}">{{ config.towns[town_id] }}</label>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%;">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)">
|
||||
<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div></div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
25
system/templates/account.created.html.twig
Normal file
25
system/templates/account.created.html.twig
Normal file
@@ -0,0 +1,25 @@
|
||||
Your account has been created. Now you can login and create your first character. See you in Tibia!<br/><br/>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<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>
|
||||
{% if constant('USE_ACCOUNT_NAME') %}
|
||||
{% set account_type = 'name' %}
|
||||
{% else %}
|
||||
{% set account_type = 'number' %}
|
||||
{% endif %}
|
||||
<br/>Your account {{ account_type }} is <b>{{ account }}</b><br/>You will need the account {{ account_type }} and your password to play on {{ config.lua.serverName }}.
|
||||
Please keep your account {{ account_type }} and password in a safe place and
|
||||
never give your account {{ account_type }} or password to anybody.<br/><br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
27
system/templates/account.created.verify.html.twig
Normal file
27
system/templates/account.created.verify.html.twig
Normal file
@@ -0,0 +1,27 @@
|
||||
Your account has been created.<br/><br/>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<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>
|
||||
{% if constant('USE_ACCOUNT_NAME') %}
|
||||
{% set account_type = 'name' %}
|
||||
{% else %}
|
||||
{% set account_type = 'number' %}
|
||||
{% endif %}
|
||||
<br/>Your account {{ account_type }} is <b>{{ account }}</b>.
|
||||
|
||||
You will need the account {{ account_type }} and your password to play on {{ config.lua.serverName }}.
|
||||
Please keep your account {{ account_type }} and password in a safe place and
|
||||
never give your account {{ account_type }} or password to anybody.<br/><br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
68
system/templates/account.delete_character.html.twig
Normal file
68
system/templates/account.delete_character.html.twig
Normal file
@@ -0,0 +1,68 @@
|
||||
To delete a character enter the name of the character and your password.<br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=deletecharacter" method="post">
|
||||
<input type="hidden" name="deletecharactersave" value="1"/>
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Delete Character</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="LabelV" ><span>Character Name:</span></td>
|
||||
<td style="width:90%;">
|
||||
<input name="delete_name" value="" size="30" maxlength="29"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" ><span>Password:</span></td>
|
||||
<td>
|
||||
<input type="password" name="delete_password" size="30" maxlength="29"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
61
system/templates/account.generate_new_recovery_key.html.twig
Normal file
61
system/templates/account.generate_new_recovery_key.html.twig
Normal file
@@ -0,0 +1,61 @@
|
||||
To generate new recovery key for your account please enter your password.<br/>
|
||||
<font color="red"><b>New recovery key cost {{ config.generate_new_reckey_price }} Premium Points.</font> You have {{ points }} premium points. You will receive e-mail with this recovery key.</b><br/>
|
||||
<form action="?subtopic=accountmanagement&action=newreckey" method="post">
|
||||
<input type="hidden" name="registeraccountsave" value="1">
|
||||
<div class="TableContainer" >
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Generate recovery key</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td class="LabelV" ><span>Password:</span></td>
|
||||
<td><input type="password" name="reg_password" size="30" maxlength="29" ></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
64
system/templates/account.generate_recovery_key.html.twig
Normal file
64
system/templates/account.generate_recovery_key.html.twig
Normal file
@@ -0,0 +1,64 @@
|
||||
To generate recovery key for your account please enter your password.<br/><br/>
|
||||
<form action="?subtopic=accountmanagement&action=registeraccount" method="post">
|
||||
<input type="hidden" name="registeraccountsave" value="1"/>
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0">
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer">
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<div class="Text" >Generate recovery key</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV">
|
||||
<span>Password:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="reg_password" size="30" maxlength="29" autofocus/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table style="width:100%">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
</td>
|
||||
</form>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=accountmanagement" method="post">
|
||||
<tr>
|
||||
<td style="border: 0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="{{ template_path }}/images/buttons/_sbutton_back.gif" ></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
82
system/templates/account.login.html.twig
Normal file
82
system/templates/account.login.html.twig
Normal file
@@ -0,0 +1,82 @@
|
||||
Please enter your account {{ account|lower }} and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/>
|
||||
<form action="?subtopic=accountmanagement" method="post" >
|
||||
{% if redirect is not null %}
|
||||
<input type="hidden" name="redirect" value="{{ redirect }}" />
|
||||
{% endif %}
|
||||
<div class="TableContainer" >
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
<div class="CaptionContainer" >
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<div class="Text" >Account Login</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);" /></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;" >
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if error is not null %} class="red"{% endif %}>Account {{ account }}:</span>
|
||||
</td>
|
||||
<td style="width:100%;" ><input type="password" name="account_login" size="30" maxlength="30" autofocus/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" >
|
||||
<span{% if error is not null %} class="red"{% endif %}>Password:</span>
|
||||
</td>
|
||||
<td><input type="password" name="password_login" size="30" maxlength="29" ></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="LabelV" ></td>
|
||||
<td><input type="checkbox" id="remember_me" name="remember_me" value="true" />
|
||||
<label for="remember_me"> Remember me</label></td>
|
||||
</tr>
|
||||
{% if error is not null %}
|
||||
<tr><td></td><td><span class="FormFieldError">{{ error }}</span></td></tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<table width="100%" >
|
||||
<tr align="center">
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div>
|
||||
<input class="ButtonText" type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/_sbutton_submit.gif" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<form action="?subtopic=lostaccount" method="post">
|
||||
<tr>
|
||||
<td style="border:0px;">
|
||||
<div class="BigButton" style="background-image:url({{ template_path }}/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/buttons/sbutton_over.gif);" ></div>
|
||||
<input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="{{ template_path }}/images/buttons/_sbutton_accountlost.gif" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
28
system/templates/account.logout.html.twig
Normal file
28
system/templates/account.logout.html.twig
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="TableContainer">
|
||||
<table class="Table1" cellpadding="0" cellspacing="0" >
|
||||
<div class="CaptionContainer">
|
||||
<div class="CaptionInnerContainer" >
|
||||
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span>
|
||||
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span>
|
||||
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"/></span>
|
||||
<div class="Text">Logout Successful</div>
|
||||
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"/></span>
|
||||
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);" ></span>
|
||||
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span>
|
||||
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="InnerTableContainer">
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
<td>You have logged out of your {{ config.serverName }} account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
35
system/templates/account.lost.form.html.twig
Normal file
35
system/templates/account.lost.form.html.twig
Normal file
@@ -0,0 +1,35 @@
|
||||
The Lost Account Interface can help you to get back your account name and password. Please enter your character name and select what you want to do.<br/>
|
||||
<form action="?subtopic=lostaccount&action=step1" method=post>
|
||||
<input type="hidden" name="character" value="">
|
||||
<table cellspacing="1" cellpadding="4" border="0" width="100%">
|
||||
<tr>
|
||||
<td bgcolor="{{ config.vdarkborder }}" class="white"><b>Please enter your character name</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{{ config.darkborder }}">
|
||||
<input type="text" name="nick" size="40" autofocus/><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing="1" cellpadding="4" border="0" width="100%">
|
||||
<tr>
|
||||
<td bgcolor="{{ config.vdarkborder }}" class="white"><b>What do you want?</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{{ config.darkborder }}">
|
||||
<input type="radio" name="action_type" id="action_type_email" value="email">
|
||||
<label for="action_type_email"> Send me new password and my account name to account e-mail adress.</label><br/>
|
||||
<input type=radio name="action_type" id="action_type_key" value="reckey">
|
||||
<label for="action_type_key"> I got <b>recovery key</b> and want set new password and e-mail adress to my account.</label><br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="image" name="Submit" alt="Submit" src="{{ template_path }}/images/buttons/sbutton_submit.gif" border="0" width="120" height="18">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
10
system/templates/account.lost.noaction.html.twig
Normal file
10
system/templates/account.lost.noaction.html.twig
Normal file
@@ -0,0 +1,10 @@
|
||||
Please select action.<br/>
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="?subtopic=lostaccount" border="0">
|
||||
<img src="{{ template_path }}/images/buttons/sbutton_back.gif" name="back" alt="back" border="0" width="120" height="18">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user