mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 20:43:34 +02:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8af9186098 | ||
![]() |
2d427601ee | ||
![]() |
454d4b088d | ||
![]() |
738bfbfa5c | ||
![]() |
03223c1c30 | ||
![]() |
3c6f44d6ee | ||
![]() |
dacc5b9dab | ||
![]() |
a4bccbaa34 | ||
![]() |
174054237b | ||
![]() |
bcc81fa34f | ||
![]() |
ba1c5e9b2e | ||
![]() |
0129c79580 | ||
![]() |
c863ad460a | ||
![]() |
cb08e53103 | ||
![]() |
d5cc2a1090 | ||
![]() |
6ba8d2c9cb | ||
![]() |
668e4688c4 | ||
![]() |
bd19b8665a | ||
![]() |
c5980f2350 | ||
![]() |
6c03984f53 | ||
![]() |
ecd865f275 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
* text=auto
|
||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
_config.yml export-ignore
|
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,5 +1,25 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.7.11 - 04.05.2019]
|
||||||
|
### Added:
|
||||||
|
* support for some old servers, where arrays are used in config.lua
|
||||||
|
* an additional text to the install page informing that user can reinstall MyAAC by deleting config.local.php
|
||||||
|
|
||||||
|
### Fixed:
|
||||||
|
* XSS in forum show_thread
|
||||||
|
* guilds - "Add new rank" function
|
||||||
|
* multiple mail recipients when using admin mailer function
|
||||||
|
* Admin Panel - MyAAC logs not shown if servers logs directory doesn't exist (#47)
|
||||||
|
* missing prefix for cache get() and delete() functions
|
||||||
|
* add fatal error message when myaac tables in database do not exist
|
||||||
|
* the mystical defect where "Create Account" button was not highlighted (on the account/manage page)
|
||||||
|
* bug where server_config table does not exist (OTHire as an example)
|
||||||
|
* database_name in Usage_Statistics
|
||||||
|
* forgot to open <head> in install template
|
||||||
|
|
||||||
|
### Changed:
|
||||||
|
* do not display software version
|
||||||
|
|
||||||
## [0.7.10 - 03.03.2018]
|
## [0.7.10 - 03.03.2018]
|
||||||
### Added:
|
### Added:
|
||||||
* new configurable: smtp_secure
|
* new configurable: smtp_secure
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
define('MYAAC', true);
|
define('MYAAC', true);
|
||||||
define('MYAAC_VERSION', '0.7.10');
|
define('MYAAC_VERSION', '0.7.11');
|
||||||
define('DATABASE_VERSION', 22);
|
define('DATABASE_VERSION', 22);
|
||||||
define('TABLE_PREFIX', 'myaac_');
|
define('TABLE_PREFIX', 'myaac_');
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
|
@@ -170,6 +170,11 @@ require_once(SYSTEM . 'status.php');
|
|||||||
$twig->addGlobal('config', $config);
|
$twig->addGlobal('config', $config);
|
||||||
$twig->addGlobal('status', $status);
|
$twig->addGlobal('status', $status);
|
||||||
|
|
||||||
|
// verify myaac tables exists in database
|
||||||
|
if(!tableExist('myaac_account_actions')) {
|
||||||
|
die('Seems that the table <strong>myaac_account_actions</strong> of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting <a href="' . BASE_URL . 'install">this</a> url.');
|
||||||
|
}
|
||||||
|
|
||||||
// database migrations
|
// database migrations
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
|
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
|
||||||
@@ -417,7 +422,7 @@ else
|
|||||||
die('ERROR: Cannot load template.');
|
die('ERROR: Cannot load template.');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<!-- MyAAC ' . MYAAC_VERSION . ' :: http://www.my-aac.org/ -->' . "\n";
|
echo base64_decode('PCEtLSBQb3dlcmVkIGJ5IE15QUFDIDo6IGh0dHBzOi8vd3d3Lm15LWFhYy5vcmcvIC0tPg==') . PHP_EOL;
|
||||||
if(($config['debug_level'] & 1) == 1)
|
if(($config['debug_level'] & 1) == 1)
|
||||||
echo '<!-- Generated in :: ' . round(microtime(true) - START_TIME, 4) . ' -->';
|
echo '<!-- Generated in :: ' . round(microtime(true) - START_TIME, 4) . ' -->';
|
||||||
|
|
||||||
|
@@ -174,6 +174,11 @@ if(!$error) {
|
|||||||
success($locale['step_database_adding_field'] . ' accounts.premium_points...');
|
success($locale['step_database_adding_field'] . ' accounts.premium_points...');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(fieldExist('motd', 'guilds')) {
|
||||||
|
if(query("ALTER TABLE `guilds` MODIFY `motd` VARCHAR(255) NOT NULL DEFAULT '';"))
|
||||||
|
success($locale['step_database_modifying_field'] . ' guilds.motd...');
|
||||||
|
}
|
||||||
|
|
||||||
if(!fieldExist('description', 'guilds')) {
|
if(!fieldExist('description', 'guilds')) {
|
||||||
if(query("ALTER TABLE `guilds` ADD `description` TEXT NOT NULL;"))
|
if(query("ALTER TABLE `guilds` ADD `description` TEXT NOT NULL;"))
|
||||||
success($locale['step_database_adding_field'] . ' guilds.description...');
|
success($locale['step_database_adding_field'] . ' guilds.description...');
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $locale['direction']; ?>" lang="<?php echo $locale['lang']; ?>" xml:lang="<?php echo $locale['lang']; ?>">
|
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $locale['direction']; ?>" lang="<?php echo $locale['lang']; ?>" xml:lang="<?php echo $locale['lang']; ?>">
|
||||||
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $locale['encoding']; ?>" />
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $locale['encoding']; ?>" />
|
||||||
<title>MyAAC - <?php echo $locale['installation']; ?></title>
|
<title>MyAAC - <?php echo $locale['installation']; ?></title>
|
||||||
<link rel="stylesheet" type="text/css" href="template/style.css" />
|
<link rel="stylesheet" type="text/css" href="template/style.css" />
|
||||||
@@ -8,7 +9,7 @@
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<!--div class="buffer"-->
|
<!--div class="buffer"-->
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<h1>MyAAC v<?php echo MYAAC_VERSION . ' ' . $locale['installation']; ?></h1>
|
<h1>MyAAC <?php echo $locale['installation']; ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="body">
|
<div id="body">
|
||||||
|
@@ -473,7 +473,7 @@ function template_header($is_admin = false)
|
|||||||
$ret .= '
|
$ret .= '
|
||||||
<meta name="description" content="' . $config['meta_description'] . '" />
|
<meta name="description" content="' . $config['meta_description'] . '" />
|
||||||
<meta name="keywords" content="' . $config['meta_keywords'] . ', myaac, wodzaac" />
|
<meta name="keywords" content="' . $config['meta_keywords'] . ', myaac, wodzaac" />
|
||||||
<meta name="generator" content="MyAAC ' . MYAAC_VERSION . '" />
|
<meta name="generator" content="MyAAC" />
|
||||||
<link rel="stylesheet" type="text/css" href="' . BASE_URL . 'tools/messages.css" />
|
<link rel="stylesheet" type="text/css" href="' . BASE_URL . 'tools/messages.css" />
|
||||||
<script type="text/javascript" src="' . BASE_URL . 'tools/jquery.js"></script>
|
<script type="text/javascript" src="' . BASE_URL . 'tools/jquery.js"></script>
|
||||||
<noscript>
|
<noscript>
|
||||||
@@ -810,6 +810,7 @@ function getWorldName($id)
|
|||||||
*/
|
*/
|
||||||
function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
||||||
{
|
{
|
||||||
|
/** @var PHPMailer $mailer */
|
||||||
global $mailer, $config;
|
global $mailer, $config;
|
||||||
if(!$mailer)
|
if(!$mailer)
|
||||||
{
|
{
|
||||||
@@ -817,6 +818,9 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer = new PHPMailer();
|
$mailer = new PHPMailer();
|
||||||
$mailer->setLanguage('en', LIBS . 'phpmailer/language/');
|
$mailer->setLanguage('en', LIBS . 'phpmailer/language/');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$mailer->clearAllRecipients();
|
||||||
|
}
|
||||||
|
|
||||||
$signature_html = '';
|
$signature_html = '';
|
||||||
if(isset($config['mail_signature']['html']))
|
if(isset($config['mail_signature']['html']))
|
||||||
@@ -917,6 +921,10 @@ function load_config_lua($filename)
|
|||||||
$result[$key] = (string) substr(substr($value, 1), 0, -1);
|
$result[$key] = (string) substr(substr($value, 1), 0, -1);
|
||||||
elseif(in_array($value, array('true', 'false')))
|
elseif(in_array($value, array('true', 'false')))
|
||||||
$result[$key] = ($value == 'true') ? true : false;
|
$result[$key] = ($value == 'true') ? true : false;
|
||||||
|
elseif(substr($value, 0 , 1) == '{' && substr($value, -1 , 1) == '}') {
|
||||||
|
// arrays are not supported yet
|
||||||
|
// just ignore the error
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($result as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
|
foreach($result as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
|
||||||
|
@@ -31,7 +31,7 @@ class Cache_APC
|
|||||||
public function get($key)
|
public function get($key)
|
||||||
{
|
{
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if($this->fetch($key, $tmp))
|
if($this->fetch($this->prefix . $key, $tmp))
|
||||||
return $tmp;
|
return $tmp;
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@@ -42,7 +42,7 @@ class Cache_APC
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
apc_delete($key);
|
apc_delete($this->prefix . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enabled() {
|
public function enabled() {
|
||||||
|
@@ -30,7 +30,7 @@ class Cache_eAccelerator
|
|||||||
public function get($key)
|
public function get($key)
|
||||||
{
|
{
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if($this->fetch($key, $tmp))
|
if($this->fetch($this->prefix . $key, $tmp))
|
||||||
return $tmp;
|
return $tmp;
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@@ -41,7 +41,7 @@ class Cache_eAccelerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
eaccelerator_rm($key);
|
eaccelerator_rm($this->prefix . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enabled() {
|
public function enabled() {
|
||||||
|
@@ -30,7 +30,7 @@ class Cache_XCache
|
|||||||
public function get($key)
|
public function get($key)
|
||||||
{
|
{
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if($this->fetch($key, $tmp))
|
if($this->fetch($this->prefix . $key, $tmp))
|
||||||
return $tmp;
|
return $tmp;
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@@ -47,7 +47,7 @@ class Cache_XCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function delete($key) {
|
public function delete($key) {
|
||||||
xcache_unset($key);
|
xcache_unset($this->prefix . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enabled() {
|
public function enabled() {
|
||||||
|
@@ -40,10 +40,12 @@ class Usage_Statistics {
|
|||||||
$ret['myaac_version'] = MYAAC_VERSION;
|
$ret['myaac_version'] = MYAAC_VERSION;
|
||||||
$ret['myaac_db_version'] = DATABASE_VERSION;
|
$ret['myaac_db_version'] = DATABASE_VERSION;
|
||||||
|
|
||||||
$query = $db->query('SELECT `value` FROM `server_config` WHERE `config` = ' . $db->quote('database_version'));
|
if(tableExist('server_config')) {
|
||||||
if($query->rowCount() == 1) {
|
$query = $db->query('SELECT `value` FROM `server_config` WHERE `config` = ' . $db->quote('database_version'));
|
||||||
$query = $query->fetch();
|
if($query->rowCount() == 1) {
|
||||||
$ret['otserv_db_version'] = $query['value'];
|
$query = $query->fetch();
|
||||||
|
$ret['otserv_db_version'] = $query['value'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret['client_version'] = $config['client'];
|
$ret['client_version'] = $config['client'];
|
||||||
@@ -58,7 +60,7 @@ class Usage_Statistics {
|
|||||||
|
|
||||||
$query = $db->query('SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 ), 0)) AS "size"
|
$query = $db->query('SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 ), 0)) AS "size"
|
||||||
FROM INFORMATION_SCHEMA.TABLES
|
FROM INFORMATION_SCHEMA.TABLES
|
||||||
WHERE TABLE_SCHEMA = "forgottenserver";');
|
WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
|
||||||
|
|
||||||
if($query->rowCount() == 1) {
|
if($query->rowCount() == 1) {
|
||||||
$query = $query->fetch();
|
$query = $query->fetch();
|
||||||
|
@@ -18,7 +18,7 @@ $locale['loaded'] = 'Loaded';
|
|||||||
$locale['not_loaded'] = 'Not loaded';
|
$locale['not_loaded'] = 'Not loaded';
|
||||||
|
|
||||||
$locale['please_fill_all'] = 'Please fill all inputs!';
|
$locale['please_fill_all'] = 'Please fill all inputs!';
|
||||||
$locale['already_installed'] = 'MyAAC has been already installed. Please delete <b>install/<b/> directory.';
|
$locale['already_installed'] = 'MyAAC has been already installed. Please delete <b>install/<b/> directory. If you want to reinstall MyAAC - please delete <strong>config.local.php</strong> file from the main directory and refresh the page.';
|
||||||
|
|
||||||
// welcome
|
// welcome
|
||||||
$locale['step_welcome'] = 'Welcome';
|
$locale['step_welcome'] = 'Welcome';
|
||||||
|
@@ -18,7 +18,7 @@ $locale['loaded'] = 'Załadowane';
|
|||||||
$locale['not_loaded'] = 'Nie załadowane';
|
$locale['not_loaded'] = 'Nie załadowane';
|
||||||
|
|
||||||
$locale['please_fill_all'] = 'Proszę wypełnić wszystkie pola!';
|
$locale['please_fill_all'] = 'Proszę wypełnić wszystkie pola!';
|
||||||
$locale['already_installed'] = 'MyAAC został już zainstalowany. Proszę usunąć katalog <b>install/</b>.';
|
$locale['already_installed'] = 'MyAAC został już zainstalowany. Proszę usunąć katalog <b>install/</b>. Jeśli chcesz zainstalować MyAAC od nowa - proszę usuń plik <strong>config.local.php</strong> z katalogu głównego i odśwież stronę.';
|
||||||
|
|
||||||
// welcome
|
// welcome
|
||||||
$locale['step_welcome'] = 'Witamy';
|
$locale['step_welcome'] = 'Witamy';
|
||||||
|
@@ -18,7 +18,7 @@ $locale['loaded'] = 'Laddad';
|
|||||||
$locale['not_loaded'] = 'Inte Laddad';
|
$locale['not_loaded'] = 'Inte Laddad';
|
||||||
|
|
||||||
$locale['please_fill_all'] = 'Vänligen fyll i allt!';
|
$locale['please_fill_all'] = 'Vänligen fyll i allt!';
|
||||||
$locale['already_installed'] = 'MyAAC är redan installerat. Vänligen ta bort <b>install/<b/> mappen.';
|
$locale['already_installed'] = 'MyAAC är redan installerat. Vänligen ta bort <b>install/<b/> mappen. Om du vill installera MyAAC igen - ta bort filen <strong>config.local.php</strong> från huvudkatalogen och uppdatera sidan.';
|
||||||
|
|
||||||
// welcome
|
// welcome
|
||||||
$locale['step_welcome'] = 'Välkommen';
|
$locale['step_welcome'] = 'Välkommen';
|
||||||
|
@@ -28,29 +28,27 @@ foreach(scandir($aac_path_logs) as $f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$server_path_logs = $config['server_path'] . 'logs/';
|
$server_path_logs = $config['server_path'] . 'logs/';
|
||||||
if(!file_exists($server_path_logs))
|
|
||||||
$server_path_logs = $config['data_path'] . 'logs/';
|
|
||||||
|
|
||||||
if(!file_exists($server_path_logs)) {
|
if(!file_exists($server_path_logs)) {
|
||||||
echo '</table>Logs are not available on this server.';
|
$server_path_logs = $config['data_path'] . 'logs/';
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(scandir($server_path_logs) as $f) {
|
if(file_exists($server_path_logs)) {
|
||||||
if($f[0] == '.' || $f == '..')
|
foreach(scandir($server_path_logs) as $f) {
|
||||||
continue;
|
if($f[0] == '.' || $f == '..')
|
||||||
|
continue;
|
||||||
|
|
||||||
if(is_dir($server_path_logs . $f)) {
|
if(is_dir($server_path_logs . $f)) {
|
||||||
foreach(scandir($server_path_logs . $f) as $f2) {
|
foreach(scandir($server_path_logs . $f) as $f2) {
|
||||||
if($f2[0] == '.' || $f2 == '..')
|
if($f2[0] == '.' || $f2 == '..')
|
||||||
continue;
|
continue;
|
||||||
$files[] = array($f . '/' . $f2, $server_path_logs);
|
$files[] = array($f . '/' . $f2, $server_path_logs);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
$files[] = array($f, $server_path_logs);
|
||||||
}
|
}
|
||||||
|
|
||||||
$files[] = array($f, $server_path_logs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
@@ -13,7 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
$links_to_pages = '';
|
$links_to_pages = '';
|
||||||
$thread_id = (int) $_REQUEST['id'];
|
$thread_id = (int) $_REQUEST['id'];
|
||||||
$_page = (int) (isset($_REQUEST['page']) ? $_REQUEST['page'] : 0);
|
$_page = (int) (isset($_REQUEST['page']) ? $_REQUEST['page'] : 0);
|
||||||
$thread_name = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`section` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." AND `" . TABLE_PREFIX . "forum`.`id` = `" . TABLE_PREFIX . "forum`.`first_post` AND `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` LIMIT 1")->fetch();
|
$thread_name = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`section`, `" . TABLE_PREFIX . "forum`.`post_html` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." AND `" . TABLE_PREFIX . "forum`.`id` = `" . TABLE_PREFIX . "forum`.`first_post` AND `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` LIMIT 1")->fetch();
|
||||||
|
|
||||||
if(empty($thread_name['name'])) {
|
if(empty($thread_name['name'])) {
|
||||||
echo 'Thread with this ID does not exits.';
|
echo 'Thread with this ID does not exits.';
|
||||||
@@ -36,8 +36,8 @@ for($i = 0; $i < $posts_count['posts_count'] / $config['forum_threads_per_page']
|
|||||||
$threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `players`.`account_id`, `players`.`vocation`" . (fieldExist('promotion', 'players') ? ", `players`.`promotion`" : "") . ", `players`.`level`, `" . TABLE_PREFIX . "forum`.`id`,`" . TABLE_PREFIX . "forum`.`first_post`, `" . TABLE_PREFIX . "forum`.`section`,`" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_date`, `" . TABLE_PREFIX . "forum`.`post_smile`, `" . TABLE_PREFIX . "forum`.`post_html`, `" . TABLE_PREFIX . "forum`.`author_aid`, `" . TABLE_PREFIX . "forum`.`author_guid`, `" . TABLE_PREFIX . "forum`.`last_edit_aid`, `" . TABLE_PREFIX . "forum`.`edit_date` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." ORDER BY `" . TABLE_PREFIX . "forum`.`post_date` LIMIT ".$config['forum_posts_per_page']." OFFSET ".($_page * $config['forum_posts_per_page']))->fetchAll();
|
$threads = $db->query("SELECT `players`.`id` as `player_id`, `players`.`name`, `players`.`account_id`, `players`.`vocation`" . (fieldExist('promotion', 'players') ? ", `players`.`promotion`" : "") . ", `players`.`level`, `" . TABLE_PREFIX . "forum`.`id`,`" . TABLE_PREFIX . "forum`.`first_post`, `" . TABLE_PREFIX . "forum`.`section`,`" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_date`, `" . TABLE_PREFIX . "forum`.`post_smile`, `" . TABLE_PREFIX . "forum`.`post_html`, `" . TABLE_PREFIX . "forum`.`author_aid`, `" . TABLE_PREFIX . "forum`.`author_guid`, `" . TABLE_PREFIX . "forum`.`last_edit_aid`, `" . TABLE_PREFIX . "forum`.`edit_date` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." ORDER BY `" . TABLE_PREFIX . "forum`.`post_date` LIMIT ".$config['forum_posts_per_page']." OFFSET ".($_page * $config['forum_posts_per_page']))->fetchAll();
|
||||||
if(isset($threads[0]['name']))
|
if(isset($threads[0]['name']))
|
||||||
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `views`=`views`+1 WHERE `id` = ".(int) $thread_id);
|
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `views`=`views`+1 WHERE `id` = ".(int) $thread_id);
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($threads[0]['section']) . '">'.$sections[$threads[0]['section']]['name'].'</a> >> <b>'.$thread_name['post_topic'].'</b>';
|
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($threads[0]['section']) . '">'.$sections[$threads[0]['section']]['name'].'</a> >> <b>'.($thread_name['post_html'] ? $thread_name['post_topic'] : htmlspecialchars($thread_name['post_topic'])).'</b>';
|
||||||
echo '<br /><br /><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"><img src="images/forum/post.gif" border="0" /></a><br /><br />Page: '.$links_to_pages.'<br /><table width="100%"><tr bgcolor="'.$config['lightborder'].'" width="100%"><td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1"><br />by ' . getPlayerLink($thread_name['name']) . '</font></td></tr><tr bgcolor="'.$config['vdarkborder'].'"><td width="200"><font color="white" size="1"><b>Author</b></font></td><td> </td></tr>';
|
echo '<br /><br /><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"><img src="images/forum/post.gif" border="0" /></a><br /><br />Page: '.$links_to_pages.'<br /><table width="100%"><tr bgcolor="'.$config['lightborder'].'" width="100%"><td colspan="2"><font size="4"><b>'.($thread_name['post_html'] ? $thread_name['post_topic'] : htmlspecialchars($thread_name['post_topic'])).'</b></font><font size="1"><br />by ' . getPlayerLink($thread_name['name']) . '</font></td></tr><tr bgcolor="'.$config['vdarkborder'].'"><td width="200"><font color="white" size="1"><b>Author</b></font></td><td> </td></tr>';
|
||||||
$player = $ots->createObject('Player');
|
$player = $ots->createObject('Player');
|
||||||
foreach($threads as $thread)
|
foreach($threads as $thread)
|
||||||
{
|
{
|
||||||
|
@@ -11,13 +11,13 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
|
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
|
||||||
$new_rank = isset($_REQUEST['rank_name']) ? $_REQUEST['rank_name'] : null;
|
$rank_name = isset($_REQUEST['rank_name']) ? $_REQUEST['rank_name'] : null;
|
||||||
if(!Validator::guildName($guild_name)) {
|
if(!Validator::guildName($guild_name)) {
|
||||||
$errors[] = Validator::getLastError();
|
$errors[] = Validator::getLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
if(!Validator::rankName($new_rank)) {
|
if(!Validator::rankName($rank_name)) {
|
||||||
$errors[] = 'Invalid rank name format.';
|
$errors[] = 'Invalid rank name format.';
|
||||||
}
|
}
|
||||||
if(!$logged) {
|
if(!$logged) {
|
||||||
@@ -45,7 +45,7 @@ if(empty($errors)) {
|
|||||||
$new_rank = new OTS_GuildRank();
|
$new_rank = new OTS_GuildRank();
|
||||||
$new_rank->setGuild($guild);
|
$new_rank->setGuild($guild);
|
||||||
$new_rank->setLevel(1);
|
$new_rank->setLevel(1);
|
||||||
$new_rank->setName($new_rank);
|
$new_rank->setName($rank_name);
|
||||||
$new_rank->save();
|
$new_rank->save();
|
||||||
header("Location: ?subtopic=guilds&guild=".$guild->getName()."&action=manager");
|
header("Location: ?subtopic=guilds&guild=".$guild->getName()."&action=manager");
|
||||||
echo 'New rank added. Redirecting...';
|
echo 'New rank added. Redirecting...';
|
||||||
|
@@ -108,11 +108,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<div style="float: right; margin-top: 20px;" >
|
<div style="float: right; margin-top: 20px;" >
|
||||||
|
{% spaceless %}
|
||||||
<form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" >
|
<form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" >
|
||||||
<div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ></div>
|
<div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);">
|
||||||
|
<div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"></div>
|
||||||
<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" />
|
<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
{% endspaceless %}
|
||||||
</div>
|
</div>
|
||||||
<div id="LoginCreateAccountBox" >
|
<div id="LoginCreateAccountBox" >
|
||||||
<p><b>{{ config.lua.serverName }}...</b></p>
|
<p><b>{{ config.lua.serverName }}...</b></p>
|
||||||
|
@@ -1785,6 +1785,37 @@ img {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* BUTTONS */
|
||||||
|
.MediumButtonText {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 37px;
|
||||||
|
width: 150px;
|
||||||
|
z-index: 20;
|
||||||
|
}
|
||||||
|
.MediumButtonBackground {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 150px;
|
||||||
|
height: 37px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
.MediumButtonOver {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 150px;
|
||||||
|
height: 37px;
|
||||||
|
visibility: hidden;
|
||||||
|
z-index: 15;
|
||||||
|
}
|
||||||
|
.MediumButtonForm {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.moduleRow { }
|
.moduleRow { }
|
||||||
|
|
||||||
.moduleRowOver {
|
.moduleRowOver {
|
||||||
|
@@ -279,7 +279,7 @@ if(isset($config['boxes']))
|
|||||||
<img id="TibiaLogoArtworkTop" src="<?php echo $template_path; ?>/images/header/<?php echo $config['logo_image']; ?>" onClick="window.location = '<?php echo getLink('news')?>';" alt="logoartwork" />
|
<img id="TibiaLogoArtworkTop" src="<?php echo $template_path; ?>/images/header/<?php echo $config['logo_image']; ?>" onClick="window.location = '<?php echo getLink('news')?>';" alt="logoartwork" />
|
||||||
<img id="TibiaLogoArtworkBottom" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-bottom.gif" alt="logoartwork" />
|
<img id="TibiaLogoArtworkBottom" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-bottom.gif" alt="logoartwork" />
|
||||||
<img id="Statue_2" src="<?php echo $template_path; ?>/images/header/animated-statue.gif" alt="logoartwork" />
|
<img id="Statue_2" src="<?php echo $template_path; ?>/images/header/animated-statue.gif" alt="logoartwork" />
|
||||||
<img id="LogoLink" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-string.gif" onClick="window.location = 'mailto:<?php echo $config['lua']['ownerEmail']; ?>';" alt="logoartwork" />
|
<img id="LogoLink" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-string.gif" onClick="window.location = 'mailto:<?php echo $config['mail_address']; ?>';" alt="logoartwork" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="Loginbox" >
|
<div id="Loginbox" >
|
||||||
|
Reference in New Issue
Block a user