diff --git a/admin/pages/changelog.php b/admin/pages/changelog.php
index 40097e4e..3be99498 100644
--- a/admin/pages/changelog.php
+++ b/admin/pages/changelog.php
@@ -73,7 +73,7 @@ if(!empty($action) && isRequestMethod('post'))
}
}
else if($action == 'hide') {
- if (Changelog::toggleHidden($id, $errors, $status)) {
+ if (Changelog::toggleHide($id, $errors, $status)) {
success(($status == 1 ? 'Hide' : 'Show') . ' successful.');
}
}
diff --git a/admin/pages/news.php b/admin/pages/news.php
index 9bcb2226..ab57a7f3 100644
--- a/admin/pages/news.php
+++ b/admin/pages/news.php
@@ -88,7 +88,7 @@ if(!empty($action))
}
}
} else if ($action == 'hide') {
- if (News::toggleHidden($id, $errors, $status)) {
+ if (News::toggleHide($id, $errors, $status)) {
success(($status == 1 ? 'Hide' : 'Show') . ' successful.');
}
}
@@ -99,7 +99,7 @@ if(!empty($action))
}
$categories = array();
-foreach($db->query('SELECT `id`, `name`, `icon_id` FROM `' . TABLE_PREFIX . 'news_categories` WHERE `hidden` != 1') as $cat)
+foreach($db->query('SELECT `id`, `name`, `icon_id` FROM `' . TABLE_PREFIX . 'news_categories` WHERE `hide` != 1') as $cat)
{
$categories[$cat['id']] = array(
'name' => $cat['name'],
@@ -142,7 +142,7 @@ foreach ($query as $_news) {
$newses[$_news['type']][] = array(
'id' => $_news['id'],
- 'hidden' => $_news['hidden'],
+ 'hide' => $_news['hide'],
'archive_link' => getLink('news') . '/archive/' . $_news['id'],
'title' => $_news['title'],
'date' => $_news['date'],
diff --git a/admin/pages/pages.php b/admin/pages/pages.php
index 834c0eed..586d7e53 100644
--- a/admin/pages/pages.php
+++ b/admin/pages/pages.php
@@ -97,7 +97,7 @@ if (!empty($action) && isRequestMethod('post')) {
}
}
} else if ($action == 'hide') {
- if (Pages::toggleHidden($id, $errors, $status)) {
+ if (Pages::toggleHide($id, $errors, $status)) {
success(($status == 0 ? 'Show' : 'Hide') . ' successful.');
}
}
@@ -112,7 +112,7 @@ $pages = ModelsPages::all()->map(function ($e) {
'title' => substr($e->title, 0, 20),
'php' => $e->php == '1',
'id' => $e->id,
- 'hidden' => $e->hidden
+ 'hide' => $e->hide
];
})->toArray();
diff --git a/admin/pages/players.php b/admin/pages/players.php
index 32edf5b4..1fa3bf19 100644
--- a/admin/pages/players.php
+++ b/admin/pages/players.php
@@ -213,7 +213,7 @@ else if (isset($_REQUEST['search'])) {
}
$deleted = (isset($_POST['deleted']) && $_POST['deleted'] == 'true');
- $hidden = (isset($_POST['hidden']) && $_POST['hidden'] == 'true');
+ $hide = (isset($_POST['hide']) && $_POST['hide'] == 'true');
$created = strtotime($_POST['created']);
verify_number($created, 'Created', 11);
@@ -290,7 +290,7 @@ else if (isset($_REQUEST['search'])) {
$player->setCustomField('deletion', $deleted ? '1' : '0');
else
$player->setCustomField('deleted', $deleted ? '1' : '0');
- $player->setCustomField('hidden', $hidden ? '1' : '0');
+ $player->setCustomField('hide', $hide ? '1' : '0');
$player->setCustomField('created', $created);
if (isset($comment))
$player->setCustomField('comment', $comment);
@@ -485,8 +485,8 @@ else if (isset($_REQUEST['search'])) {
diff --git a/common.php b/common.php
index c03df713..f64c5aee 100644
--- a/common.php
+++ b/common.php
@@ -27,7 +27,7 @@ if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is
const MYAAC = true;
const MYAAC_VERSION = '1.0-beta';
-const DATABASE_VERSION = 38;
+const DATABASE_VERSION = 39;
const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true));
define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX'));
diff --git a/install/includes/schema.sql b/install/includes/schema.sql
index fbbcad37..ffbdf8d1 100644
--- a/install/includes/schema.sql
+++ b/install/includes/schema.sql
@@ -1,4 +1,4 @@
-SET @myaac_database_version = 36;
+SET @myaac_database_version = 39;
CREATE TABLE `myaac_account_actions`
(
@@ -44,11 +44,11 @@ CREATE TABLE `myaac_changelog`
`where` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - server, 2 - site',
`date` INT(11) NOT NULL DEFAULT 0,
`player_id` INT(11) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
-INSERT INTO `myaac_changelog` (`id`, `type`, `where`, `date`, `body`, `hidden`) VALUES (1, 3, 2, UNIX_TIMESTAMP(), 'MyAAC installed. (:', 0);
+INSERT INTO `myaac_changelog` (`id`, `type`, `where`, `date`, `body`, `hide`) VALUES (1, 3, 2, UNIX_TIMESTAMP(), 'MyAAC installed. (:', 0);
CREATE TABLE `myaac_config`
(
@@ -67,7 +67,7 @@ CREATE TABLE `myaac_faq`
`question` VARCHAR(255) NOT NULL DEFAULT '',
`answer` VARCHAR(1020) NOT NULL DEFAULT '',
`ordering` INT(11) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
@@ -80,7 +80,7 @@ CREATE TABLE `myaac_forum_boards`
`guild` INT(11) NOT NULL DEFAULT 0,
`access` INT(11) NOT NULL DEFAULT 0,
`closed` TINYINT(1) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
INSERT INTO `myaac_forum_boards` (`id`, `name`, `description`, `ordering`, `closed`) VALUES (NULL, 'News', 'News commenting', 0, 1);
@@ -129,7 +129,7 @@ CREATE TABLE `myaac_menu`
CREATE TABLE `myaac_monsters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `hidden` tinyint(1) NOT NULL default 0,
+ `hide` tinyint(1) NOT NULL default 0,
`name` varchar(255) NOT NULL,
`mana` int(11) NOT NULL DEFAULT 0,
`exp` int(11) NOT NULL,
@@ -174,7 +174,7 @@ CREATE TABLE `myaac_news`
`comments` VARCHAR(50) NOT NULL DEFAULT '',
`article_text` VARCHAR(300) NOT NULL DEFAULT '',
`article_image` VARCHAR(100) NOT NULL DEFAULT '',
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
@@ -184,7 +184,7 @@ CREATE TABLE `myaac_news_categories`
`name` VARCHAR(50) NOT NULL DEFAULT "",
`description` VARCHAR(50) NOT NULL DEFAULT "",
`icon_id` INT(2) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
@@ -215,7 +215,7 @@ CREATE TABLE `myaac_pages`
`php` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '0 - plain html, 1 - php',
`enable_tinymce` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1 - enabled, 0 - disabled',
`access` TINYINT(2) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
@@ -228,7 +228,7 @@ CREATE TABLE `myaac_gallery`
`thumb` VARCHAR(255) NOT NULL,
`author` VARCHAR(50) NOT NULL DEFAULT '',
`ordering` INT(11) NOT NULL DEFAULT 0,
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
@@ -262,7 +262,7 @@ CREATE TABLE `myaac_spells`
`item_id` INT(11) NOT NULL DEFAULT 0,
`premium` TINYINT(1) NOT NULL DEFAULT 0,
`vocations` VARCHAR(100) NOT NULL DEFAULT '',
- `hidden` TINYINT(1) NOT NULL DEFAULT 0,
+ `hide` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
diff --git a/install/steps/7-finish.php b/install/steps/7-finish.php
index 90ea088f..3c4094dc 100644
--- a/install/steps/7-finish.php
+++ b/install/steps/7-finish.php
@@ -113,8 +113,8 @@ else {
$query = $db->query("SELECT `id` FROM `" . TABLE_PREFIX ."news` WHERE `title` LIKE 'Hello!';");
if($query->rowCount() == 0) {
- if(query("INSERT INTO `" . TABLE_PREFIX ."news` (`id`, `type`, `date`, `category`, `title`, `body`, `player_id`, `comments`, `hidden`) VALUES (NULL, '1', UNIX_TIMESTAMP(), '2', 'Hello!', 'MyAAC is just READY to use!', " . $player_id . ", 'https://my-aac.org', '0');
- INSERT INTO `myaac_news` (`id`, `type`, `date`, `category`, `title`, `body`, `player_id`, `comments`, `hidden`) VALUES (NULL, '2', UNIX_TIMESTAMP(), '4', 'Hello tickets!', 'https://my-aac.org', " . $player_id . ", '', '0');")) {
+ if(query("INSERT INTO `" . TABLE_PREFIX ."news` (`id`, `type`, `date`, `category`, `title`, `body`, `player_id`, `comments`, `hide`) VALUES (NULL, '1', UNIX_TIMESTAMP(), '2', 'Hello!', 'MyAAC is just READY to use!', " . $player_id . ", 'https://my-aac.org', '0');
+ INSERT INTO `myaac_news` (`id`, `type`, `date`, `category`, `title`, `body`, `player_id`, `comments`, `hide`) VALUES (NULL, '2', UNIX_TIMESTAMP(), '4', 'Hello tickets!', 'https://my-aac.org', " . $player_id . ", '', '0');")) {
success($locale['step_database_created_news']);
}
}
diff --git a/install/tools/5-database.php b/install/tools/5-database.php
index 4ebaf37a..ce024524 100644
--- a/install/tools/5-database.php
+++ b/install/tools/5-database.php
@@ -180,17 +180,17 @@ if(!$db->hasColumn('players', 'deleted') && !$db->hasColumn('players', 'deletion
}
if($db->hasColumn('players', 'hide_char')) {
- if(!$db->hasColumn('players', 'hidden')) {
- if(query("ALTER TABLE `players` CHANGE `hide_char` `hidden` TINYINT(1) NOT NULL DEFAULT 0;")) {
+ if(!$db->hasColumn('players', 'hide')) {
+ if(query("ALTER TABLE `players` CHANGE `hide_char` `hide` TINYINT(1) NOT NULL DEFAULT 0;")) {
$tmp = str_replace('$FIELD$', 'players.hide_char', $locale['step_database_changing_field']);
- $tmp = str_replace('$FIELD_NEW$', 'players.hidden', $tmp);
+ $tmp = str_replace('$FIELD_NEW$', 'players.hide', $tmp);
success($tmp);
}
}
}
-else if(!$db->hasColumn('players', 'hidden')) {
- if(query("ALTER TABLE `players` ADD `hidden` TINYINT(1) NOT NULL DEFAULT 0;"))
- success($locale['step_database_adding_field'] . ' players.hidden...');
+else if(!$db->hasColumn('players', 'hide')) {
+ if(query("ALTER TABLE `players` ADD `hide` TINYINT(1) NOT NULL DEFAULT 0;"))
+ success($locale['step_database_adding_field'] . ' players.hide...');
}
if(!$db->hasColumn('players', 'comment')) {
diff --git a/install/tools/7-finish.php b/install/tools/7-finish.php
index a25d4a4a..430bc346 100644
--- a/install/tools/7-finish.php
+++ b/install/tools/7-finish.php
@@ -35,7 +35,7 @@ function insert_sample_if_not_exist($p) {
$query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote($p['name']));
if($query->rowCount() == 0) {
- if(!query("INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `lastlogout`, `balance`, `$deleted`, `created`, `hidden`, `comment`) VALUES (null, " . $db->quote($p['name']) . ", 1, " . getSession('account') . ", " . $p['level'] . ", " . $p['vocation_id'] . ", " . $p['health'] . ", " . $p['healthmax'] . ", " . $p['experience'] . ", 118, 114, 38, 57, " . $p['looktype'] . ", 0, " . $p['mana'] . ", " . $p['manamax'] . ", 0, " . $p['soul'] . ", 1, 1000, 1000, 7, '', " . $p['cap'] . ", 1, " . $time . ", 2130706433, 1, " . $time . ", 0, 0, " . $time . ", 1, '');"))
+ if(!query("INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `lastlogout`, `balance`, `$deleted`, `created`, `hide`, `comment`) VALUES (null, " . $db->quote($p['name']) . ", 1, " . getSession('account') . ", " . $p['level'] . ", " . $p['vocation_id'] . ", " . $p['health'] . ", " . $p['healthmax'] . ", " . $p['experience'] . ", 118, 114, 38, 57, " . $p['looktype'] . ", 0, " . $p['mana'] . ", " . $p['manamax'] . ", 0, " . $p['soul'] . ", 1, 1000, 1000, 7, '', " . $p['cap'] . ", 1, " . $time . ", 2130706433, 1, " . $time . ", 0, 0, " . $time . ", 1, '');"))
$success = false;
}
}
diff --git a/system/functions.php b/system/functions.php
index 2a8474ff..8f41dad9 100644
--- a/system/functions.php
+++ b/system/functions.php
@@ -257,7 +257,7 @@ function generateRandomString($length, $lowCase = true, $upCase = false, $numeri
function getForumBoards()
{
global $db, $canEdit;
- $sections = $db->query('SELECT `id`, `name`, `description`, `closed`, `guild`, `access`' . ($canEdit ? ', `hidden`, `ordering`' : '') . ' FROM `' . TABLE_PREFIX . 'forum_boards` ' . (!$canEdit ? ' WHERE `hidden` != 1' : '') .
+ $sections = $db->query('SELECT `id`, `name`, `description`, `closed`, `guild`, `access`' . ($canEdit ? ', `hide`, `ordering`' : '') . ' FROM `' . TABLE_PREFIX . 'forum_boards` ' . (!$canEdit ? ' WHERE `hide` != 1' : '') .
' ORDER BY `ordering`;');
if($sections)
return $sections->fetchAll();
diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php
index 7fd96fec..491a6303 100644
--- a/system/libs/pot/OTS_Player.php
+++ b/system/libs/pot/OTS_Player.php
@@ -90,7 +90,7 @@ class OTS_Player extends OTS_Row_DAO
* @version 0.1.2
* @var array
*/
- private $data = array('sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hidden' => 0);
+ private $data = array('sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hide' => 0);
/**
* Player skills.
@@ -231,7 +231,7 @@ class OTS_Player extends OTS_Row_DAO
}
else {
// SELECT query on database
- $this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . ($this->db->hasColumn('players', 'lookaddons') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $__load['skull_time'] . '` as `skulltime`, `' . $__load['skull_type'] . '` as `skull`' . $__load['guild_info'] . ', `town_id`' . $__load['loss_experience'] . $__load['loss_items'] . ', `balance`' . ($__load['blessings'] ? ', `blessings`' : '') . ($__load['direction'] ? ', `direction`' : '') . ($__load['stamina'] ? ', `stamina`' : '') . ($__load['world_id'] ? ', `world_id`' : '') . ($__load['online'] ? ', `online`' : '') . ', `' . ($__load['deletion'] ? 'deletion' : 'deleted') . '`' . ($__load['promotion'] ? ', `promotion`' : '') . ($__load['marriage'] ? ', `marriage`' : '') . ', `comment`, `created`, `hidden` FROM `players` WHERE `id` = ' . (int)$id)->fetch();
+ $this->data = $this->db->query('SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`' . ($this->db->hasColumn('players', 'lookaddons') ? ', `lookaddons`' : '') . ', `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `' . $__load['skull_time'] . '` as `skulltime`, `' . $__load['skull_type'] . '` as `skull`' . $__load['guild_info'] . ', `town_id`' . $__load['loss_experience'] . $__load['loss_items'] . ', `balance`' . ($__load['blessings'] ? ', `blessings`' : '') . ($__load['direction'] ? ', `direction`' : '') . ($__load['stamina'] ? ', `stamina`' : '') . ($__load['world_id'] ? ', `world_id`' : '') . ($__load['online'] ? ', `online`' : '') . ', `' . ($__load['deletion'] ? 'deletion' : 'deleted') . '`' . ($__load['promotion'] ? ', `promotion`' : '') . ($__load['marriage'] ? ', `marriage`' : '') . ', `comment`, `created`, `hide` FROM `players` WHERE `id` = ' . (int)$id)->fetch();
}
// loads skills
@@ -521,17 +521,17 @@ class OTS_Player extends OTS_Row_DAO
public function isHidden()
{
- if( !isset($this->data['hidden']) )
+ if( !isset($this->data['hide']) )
{
throw new E_OTS_NotLoaded();
}
- return $this->data['hidden'] == 1;
+ return $this->data['hide'] == 1;
}
public function setHidden($hidden)
{
- $this->data['hidden'] = (int) $hidden;
+ $this->data['hide'] = (int) $hidden;
}
public function getMarriage()
diff --git a/system/migrations/27.php b/system/migrations/27.php
index b32c70ef..cddda504 100644
--- a/system/migrations/27.php
+++ b/system/migrations/27.php
@@ -2,7 +2,7 @@
$query = $db->query("SELECT `id` FROM `" . TABLE_PREFIX . "pages` WHERE `name` LIKE " . $db->quote('downloads') . " LIMIT 1;");
if($query->rowCount() === 0) {
- $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `access`, `hidden`) VALUES
+ $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `access`, `hide`) VALUES
(null, 'downloads', 'Downloads', '
We''re using official Tibia Client
{{ config.client / 100 }}
@@ -13,7 +13,7 @@ if($query->rowCount() === 0) {
$query = $db->query("SELECT `id` FROM `" . TABLE_PREFIX . "pages` WHERE `name` LIKE " . $db->quote('commands') . " LIMIT 1;");
if($query->rowCount() === 0) {
- $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `access`, `hidden`) VALUES
+ $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `access`, `hide`) VALUES
(null, 'commands', 'Commands', '
diff --git a/system/migrations/30.php b/system/migrations/30.php
index 5b1e409e..3d919597 100644
--- a/system/migrations/30.php
+++ b/system/migrations/30.php
@@ -2,7 +2,7 @@
$query = $db->query("SELECT `id` FROM `" . TABLE_PREFIX . "pages` WHERE `name` LIKE " . $db->quote('rules_on_the_page') . " LIMIT 1;");
if($query->rowCount() === 0) {
- $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `enable_tinymce`, `access`, `hidden`) VALUES
+ $db->exec("INSERT INTO `myaac_pages` (`id`, `name`, `title`, `body`, `date`, `player_id`, `php`, `enable_tinymce`, `access`, `hide`) VALUES
(null, 'rules_on_the_page', 'Rules', '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\").
diff --git a/system/migrations/39.php b/system/migrations/39.php
new file mode 100644
index 00000000..697dd751
--- /dev/null
+++ b/system/migrations/39.php
@@ -0,0 +1,15 @@
+exec("ALTER TABLE `players` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "changelog` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "faq` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "forum_boards` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "news` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "news_categories` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "pages` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "gallery` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
+$db->exec("ALTER TABLE `" . TABLE_PREFIX . "spells` CHANGE `hidden` `hide` TINYINT(1) NOT NULL DEFAULT 0;");
diff --git a/system/pages/account/change_comment.php b/system/pages/account/change_comment.php
index 868f38c6..e4fb6e42 100644
--- a/system/pages/account/change_comment.php
+++ b/system/pages/account/change_comment.php
@@ -40,7 +40,7 @@ if($player_name != null) {
if (isset($_POST['changecommentsave']) && $_POST['changecommentsave'] == 1) {
if(empty($errors)) {
- $player->hidden = $new_hideacc;
+ $player->hide = $new_hideacc;
$player->comment = $new_comment;
$player->save();
$account_logged->logAction('Changed comment for character ' . $player->name . '.');
diff --git a/system/pages/characters.php b/system/pages/characters.php
index 2cb5e084..b2286db6 100644
--- a/system/pages/characters.php
+++ b/system/pages/characters.php
@@ -342,8 +342,8 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
$signature_url = BASE_URL . (setting('core.friendly_urls') ? '' : 'index.php/') . urlencode($player->getName()) . '.png';
}
- $hidden = $player->isHidden();
- if(!$hidden) {
+ $hide = $player->isHidden();
+ if(!$hide) {
// check if account has been banned
$bannedUntil = '';
$banned = array();
@@ -363,7 +363,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
$query = $db->query('SELECT `id` FROM `players` WHERE `account_id` = ' . $account->getId() . ' ORDER BY `name`')->fetchAll();
foreach($query as $p) {
$_player = new OTS_Player();
- $fields = array('id', 'name', 'vocation', 'level', 'online', 'deleted', 'hidden');
+ $fields = array('id', 'name', 'vocation', 'level', 'online', 'deleted', 'hide');
$_player->load($p['id'], $fields, false);
if($_player->isLoaded() && !$_player->isHidden()) {
$account_players[] = $_player;
@@ -404,7 +404,8 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
'frags' => $frags,
'signature_url' => isset($signature_url) ? $signature_url : null,
'player_link' => getPlayerLink($player->getName(), false),
- 'hidden' => $hidden,
+ 'hide' => $hide,
+ 'hidden' => $hide,
'bannedUntil' => isset($bannedUntil) ? $bannedUntil : null,
'account_players' => isset($account_players) ? $account_players : null,
'search_form' => generate_search_form(),
diff --git a/system/pages/creatures.php b/system/pages/creatures.php
index 672ea1a8..adafa037 100644
--- a/system/pages/creatures.php
+++ b/system/pages/creatures.php
@@ -18,7 +18,7 @@ $title = 'Creatures';
if (empty($_REQUEST['name'])) {
// display list of monsters
$preview = setting('core.monsters_images_preview');
- $creatures = Monster::where('hidden', '!=', 1)->when(!empty($_REQUEST['boss']), function ($query) {
+ $creatures = Monster::where('hide', '!=', 1)->when(!empty($_REQUEST['boss']), function ($query) {
$query->where('rewardboss', 1);
})->get()->toArray();
@@ -39,7 +39,7 @@ if (empty($_REQUEST['name'])) {
// display monster
$creature_name = urldecode(stripslashes(ucwords(strtolower($_REQUEST['name']))));
-$creature = Monster::where('hidden', '!=', 1)->where('name', $creature_name)->first()->toArray();
+$creature = Monster::where('hide', '!=', 1)->where('name', $creature_name)->first()->toArray();
if (isset($creature['name'])) {
function sort_by_chance($a, $b)
diff --git a/system/pages/faq.php b/system/pages/faq.php
index 1c7f5a29..155983b9 100644
--- a/system/pages/faq.php
+++ b/system/pages/faq.php
@@ -49,7 +49,7 @@ if($canEdit)
}
}
else if($action == 'hide') {
- FAQ::toggleHidden($id, $errors);
+ FAQ::toggleHide($id, $errors);
}
else if($action == 'moveup') {
FAQ::move($id, -1, $errors);
@@ -72,11 +72,11 @@ if($canEdit)
}
$faqs = ModelsFAQ::select('id', 'question', 'answer')->when(!$canEdit, function ($query) {
- $query->where('hidden', '!=', 1);
+ $query->where('hide', '!=', 1);
})->orderBy('ordering');
if ($canEdit) {
- $faqs->addSelect(['hidden', 'ordering']);
+ $faqs->addSelect(['hide', 'ordering']);
}
$faqs = $faqs->get()->toArray();
@@ -146,15 +146,15 @@ class FAQ
return !count($errors);
}
- static public function toggleHidden($id, &$errors)
+ static public function toggleHide($id, &$errors)
{
if(isset($id))
{
$row = ModelsFAQ::find($id);
if ($row) {
- $row->hidden = ($row->hidden == 1 ? 0 : 1);
+ $row->hide = ($row->hide == 1 ? 0 : 1);
if (!$row->save()) {
- $errors[] = 'Fail during toggle hidden FAQ.';
+ $errors[] = 'Fail during toggle hide FAQ.';
}
} else {
$errors[] = 'FAQ with id ' . $id . ' does not exists.';
diff --git a/system/pages/forum.php b/system/pages/forum.php
index c00b7f4b..51a078ae 100644
--- a/system/pages/forum.php
+++ b/system/pages/forum.php
@@ -53,7 +53,7 @@ foreach($sections as $id => $section)
'link' => getForumBoardLink($id),
'name' => $section['name'],
'description' => $section['description'],
- 'hidden' => $section['hidden'],
+ 'hide' => $section['hide'],
'posts' => isset($counters[$id]['posts']) ? $counters[$id]['posts'] : 0,
'threads' => isset($counters[$id]['threads']) ? $counters[$id]['threads'] : 0,
'last_post' => array(
diff --git a/system/pages/forum/admin.php b/system/pages/forum/admin.php
index 046452b2..d8a73eb3 100644
--- a/system/pages/forum/admin.php
+++ b/system/pages/forum/admin.php
@@ -64,7 +64,7 @@ if($canEdit) {
}
}
else if($action == 'hide_board') {
- Forum::toggleHidden_board($id, $errors);
+ Forum::toggleHide_board($id, $errors);
$action = '';
}
else if($action == 'moveup_board') {
diff --git a/system/pages/forum/base.php b/system/pages/forum/base.php
index 2ede7f2e..8da5b169 100644
--- a/system/pages/forum/base.php
+++ b/system/pages/forum/base.php
@@ -41,10 +41,10 @@ foreach(getForumBoards() as $section) {
);
if($canEdit) {
- $sections[$section['id']]['hidden'] = $section['hidden'];
+ $sections[$section['id']]['hide'] = $section['hide'];
}
else {
- $sections[$section['id']]['hidden'] = 0;
+ $sections[$section['id']]['hide'] = 0;
}
}
diff --git a/system/pages/gallery.php b/system/pages/gallery.php
index f44bd91f..cb854fca 100644
--- a/system/pages/gallery.php
+++ b/system/pages/gallery.php
@@ -48,7 +48,7 @@ if($canEdit) {
$action = $comment = $image = $author = '';
}
} else if ($action == 'hide') {
- Gallery::toggleHidden($id, $errors);
+ Gallery::toggleHide($id, $errors);
} else if ($action == 'moveup') {
Gallery::move($id, -1, $errors);
} else if ($action == 'movedown') {
@@ -107,9 +107,9 @@ if(isset($_GET['image']))
$images = Cache::remember('gallery_' . ($canEdit ? '1' : '0'), 60, function () use ($db, $canEdit) {
return $db->query('SELECT `id`, `comment`, `image`, `author`, `thumb`' .
- ($canEdit ? ', `hidden`, `ordering`' : '') .
+ ($canEdit ? ', `hide`, `ordering`' : '') .
' FROM `' . TABLE_PREFIX . 'gallery`' .
- (!$canEdit ? ' WHERE `hidden` != 1' : '') .
+ (!$canEdit ? ' WHERE `hide` != 1' : '') .
' ORDER BY `ordering`;')->fetchAll(PDO::FETCH_ASSOC);
});
@@ -204,15 +204,15 @@ class Gallery
return !count($errors);
}
- static public function toggleHidden($id, &$errors)
+ static public function toggleHide($id, &$errors)
{
if(isset($id))
{
$row = ModelsGallery::find($id);
if($row) {
- $row->hidden = $row->hidden == 1 ? 0 : 1;
+ $row->hide = $row->hide == 1 ? 0 : 1;
if (!$row->save()) {
- $errors[] = 'Fail during toggle hidden Gallery';
+ $errors[] = 'Fail during toggle hide Gallery';
}
} else
$errors[] = 'Image with id ' . $id . ' does not exists.';
diff --git a/system/pages/news.php b/system/pages/news.php
index 7dbd3f3c..0262163e 100644
--- a/system/pages/news.php
+++ b/system/pages/news.php
@@ -20,7 +20,7 @@ if(isset($_GET['archive']))
$title = 'News Archive';
$categories = array();
- foreach($db->query('SELECT id, name, icon_id FROM ' . TABLE_PREFIX . 'news_categories WHERE hidden != 1') as $cat)
+ foreach($db->query('SELECT id, name, icon_id FROM ' . TABLE_PREFIX . 'news_categories WHERE hide != 1') as $cat)
{
$categories[$cat['id']] = array(
'name' => $cat['name'],
@@ -37,7 +37,7 @@ if(isset($_GET['archive']))
if($id < 100000)
$field_name = 'id';
- $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . $id . '');
+ $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hide` != 1 AND `' . $field_name . '` = ' . $id . '');
if($news->rowCount() == 1)
{
$news = $news->fetch();
@@ -61,7 +61,7 @@ if(isset($_GET['archive']))
$admin_options = '';
if($canEdit) {
- $admin_options = '
' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hidden' => $news['hidden']]);
+ $admin_options = '
' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hide' => $news['hide']]);
}
$twig->display('news.html.twig', array(
@@ -84,7 +84,7 @@ if(isset($_GET['archive']))
query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE `type` = 1 AND `hidden` != 1 ORDER BY `date` DESC');
+ $news_DB = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE `type` = 1 AND `hide` != 1 ORDER BY `date` DESC');
foreach($news_DB as $news)
{
$newses[] = array(
@@ -114,7 +114,7 @@ if($cache->enabled())
if(!$news_cached)
{
$categories = array();
- foreach($db->query('SELECT `id`, `name`, `icon_id` FROM `' . TABLE_PREFIX . 'news_categories` WHERE `hidden` != 1') as $cat)
+ foreach($db->query('SELECT `id`, `name`, `icon_id` FROM `' . TABLE_PREFIX . 'news_categories` WHERE `hide` != 1') as $cat)
{
$categories[$cat['id']] = array(
'name' => $cat['name'],
@@ -122,7 +122,7 @@ if(!$news_cached)
);
}
- $tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .($canEdit ? '' : ' AND `hidden` != 1') .' ORDER BY `date` DESC LIMIT ' . setting('core.news_ticker_limit'));
+ $tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .($canEdit ? '' : ' AND `hide` != 1') .' ORDER BY `date` DESC LIMIT ' . setting('core.news_ticker_limit'));
$tickers_content = '';
if($tickers_db->rowCount() > 0)
{
@@ -130,6 +130,7 @@ if(!$news_cached)
foreach($tickers as &$ticker) {
$ticker['icon'] = $categories[$ticker['category']]['icon_id'];
$ticker['body_short'] = short_text(strip_tags($ticker['body']), 100);
+ $ticker['hidden'] = $ticker['hide'];
}
$tickers_content = $twig->render('news.tickers.html.twig', array(
@@ -141,7 +142,7 @@ if(!$news_cached)
if($cache->enabled() && !$canEdit)
$cache->set('news_' . $template_name . '_' . TICKER, $tickers_content, 60 * 60);
- $featured_article_db =$db->query('SELECT `id`, `title`, `article_text`, `article_image`, `hidden` FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . ARTICLE . ($canEdit ? '' : ' AND `hidden` != 1') .' ORDER BY `date` DESC LIMIT 1');
+ $featured_article_db =$db->query('SELECT `id`, `title`, `article_text`, `article_image`, `hide` FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . ARTICLE . ($canEdit ? '' : ' AND `hide` != 1') .' ORDER BY `date` DESC LIMIT 1');
$article = '';
if($featured_article_db->rowCount() > 0) {
$article = $featured_article_db->fetch();
@@ -154,7 +155,8 @@ if(!$news_cached)
'title' => $article['title'],
'text' => $article['article_text'],
'image' => $article['article_image'],
- 'hidden' => $article['hidden'],
+ 'hide' => $article['hide'],
+ 'hidden' => $article['hide'],
'read_more'=> getLink('news/archive/') . $article['id']
),
'canEdit' => $canEdit
@@ -173,7 +175,7 @@ else {
if(!$news_cached)
{
ob_start();
- $newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ($canEdit ? '' : ' AND hidden != 1') . ' ORDER BY date' . ' DESC LIMIT ' . setting('core.news_limit'));
+ $newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ($canEdit ? '' : ' AND hide != 1') . ' ORDER BY date' . ' DESC LIMIT ' . setting('core.news_limit'));
if($newses->rowCount() > 0)
{
foreach($newses as $news)
@@ -187,7 +189,7 @@ if(!$news_cached)
$admin_options = '';
if($canEdit) {
- $admin_options = '
' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hidden' => $news['hidden']]);
+ $admin_options = '
' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hide' => $news['hide']]);
}
$content_ = $news['body'];
@@ -209,7 +211,7 @@ if(!$news_cached)
'icon' => $categories[$news['category']]['icon_id'],
'author' => setting('core.news_author') ? $author : '',
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
- 'hidden'=> $news['hidden']
+ 'hide'=> $news['hide']
));
}
}
diff --git a/system/pages/spells.php b/system/pages/spells.php
index 28bcbb23..c3f18a45 100644
--- a/system/pages/spells.php
+++ b/system/pages/spells.php
@@ -37,7 +37,7 @@ else {
$order = 'name';
$spells = array();
-$spells_db = Spell::where('hidden', '!=', 1)->where('type', '<', 4)->orderBy($order)->get();
+$spells_db = Spell::where('hide', '!=', 1)->where('type', '<', 4)->orderBy($order)->get();
if((string)$vocation_id != 'all') {
foreach($spells_db as $spell) {
diff --git a/system/router.php b/system/router.php
index 0f90071d..53b3d9e4 100644
--- a/system/router.php
+++ b/system/router.php
@@ -221,7 +221,7 @@ else {
$content .= $tmp_content;
if (hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
$pageInfo = getCustomPageInfo($pageName);
- $content = $twig->render('admin.links.html.twig', ['page' => 'pages', 'id' => $pageInfo !== null ? $pageInfo['id'] : 0, 'hidden' => $pageInfo !== null ? $pageInfo['hidden'] : '0']
+ $content = $twig->render('admin.links.html.twig', ['page' => 'pages', 'id' => $pageInfo !== null ? $pageInfo['id'] : 0, 'hide' => $pageInfo !== null ? $pageInfo['hide'] : '0']
) . $content;
}
diff --git a/system/src/Admin/Pages.php b/system/src/Admin/Pages.php
index f906523d..bbac5c17 100644
--- a/system/src/Admin/Pages.php
+++ b/system/src/Admin/Pages.php
@@ -117,19 +117,19 @@ class Pages
return !count($errors);
}
- static public function toggleHidden($id, &$errors, &$status)
+ static public function toggleHide($id, &$errors, &$status)
{
if (isset($id)) {
$row = ModelsPages::find($id);
if ($row) {
- $row->hidden = $row->hidden == 1 ? 0 : 1;
+ $row->hide = $row->hide == 1 ? 0 : 1;
if (!$row->save()) {
- $errors[] = 'Fail during toggle hidden Page.';
+ $errors[] = 'Fail during toggle hide Page.';
}
else {
clearRouteCache();
}
- $status = $row->hidden;
+ $status = $row->hide;
}
else {
$errors[] = 'Page with id ' . $id . ' does not exists.';
diff --git a/system/src/Changelog.php b/system/src/Changelog.php
index c2827451..bd07c400 100644
--- a/system/src/Changelog.php
+++ b/system/src/Changelog.php
@@ -88,17 +88,17 @@ class Changelog
return true;
}
- static public function toggleHidden($id, &$errors, &$status)
+ static public function toggleHide($id, &$errors, &$status)
{
if(isset($id))
{
$row = ModelsChangelog::find($id);
if ($row) {
- $row->hidden = $row->hidden == 1 ? 0 : 1;
+ $row->hide = $row->hide == 1 ? 0 : 1;
if (!$row->save()) {
- $errors[] = 'Fail during toggle hidden Changelog.';
+ $errors[] = 'Fail during toggle hide Changelog.';
}
- $status = $row->hidden;
+ $status = $row->hide;
} else {
$errors[] = 'Changelog with id ' . $id . ' does not exists.';
}
diff --git a/system/src/Forum.php b/system/src/Forum.php
index 11427a14..ec9baee5 100644
--- a/system/src/Forum.php
+++ b/system/src/Forum.php
@@ -155,14 +155,14 @@ class Forum
return !count($errors);
}
- public static function toggleHidden_board($id, &$errors)
+ public static function toggleHide_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));
+ $db->update(TABLE_PREFIX . 'forum_boards', array('hide' => ($query['hide'] == 1 ? 0 : 1)), array('id' => $id));
else
$errors[] = 'Forum board with id ' . $id . ' does not exists.';
}
diff --git a/system/src/Models/Changelog.php b/system/src/Models/Changelog.php
index ec545d01..2fd03200 100644
--- a/system/src/Models/Changelog.php
+++ b/system/src/Models/Changelog.php
@@ -11,6 +11,6 @@ class Changelog extends Model {
public $timestamps = false;
public function scopeIsPublic($query) {
- $query->where('hidden', '!=', 1);
+ $query->where('hide', '!=', 1);
}
}
diff --git a/system/src/Models/FAQ.php b/system/src/Models/FAQ.php
index 098f9930..c1be9592 100644
--- a/system/src/Models/FAQ.php
+++ b/system/src/Models/FAQ.php
@@ -10,5 +10,5 @@ class FAQ extends Model {
public $timestamps = false;
- protected $fillable = ['question', 'answer', 'ordering', 'hidden'];
+ protected $fillable = ['question', 'answer', 'ordering', 'hide'];
}
diff --git a/system/src/Models/News.php b/system/src/Models/News.php
index ab07341e..61f52b5f 100644
--- a/system/src/Models/News.php
+++ b/system/src/Models/News.php
@@ -12,7 +12,7 @@ class News extends Model {
protected $fillable = [
'title', 'body', 'type', 'date', 'category', 'player_id',
'last_modified_by', 'last_modified_date', 'comments', 'article_text',
- 'article_image', 'hidden'
+ 'article_image', 'hide'
];
public function player()
diff --git a/system/src/Models/Pages.php b/system/src/Models/Pages.php
index 44e6b0f6..cadf9276 100644
--- a/system/src/Models/Pages.php
+++ b/system/src/Models/Pages.php
@@ -9,13 +9,13 @@ class Pages extends Model {
public $timestamps = false;
- protected $fillable = ['name', 'title', 'body', 'date', 'player_id', 'php', 'enable_tinymce', 'access', 'hidden'];
+ protected $fillable = ['name', 'title', 'body', 'date', 'player_id', 'php', 'enable_tinymce', 'access', 'hide'];
protected $casts = [
'player_id' => 'integer',
'enable_tinymce' => 'integer',
'access' => 'integer',
- 'hidden' => 'integer',
+ 'hide' => 'integer',
];
public function player()
@@ -24,7 +24,7 @@ class Pages extends Model {
}
public function scopeIsPublic($query) {
- $query->where('hidden', '!=', 1);
+ $query->where('hide', '!=', 1);
}
}
diff --git a/system/src/News.php b/system/src/News.php
index 1a6b88d2..02923837 100644
--- a/system/src/News.php
+++ b/system/src/News.php
@@ -101,18 +101,18 @@ class News
return true;
}
- static public function toggleHidden($id, &$errors, &$status)
+ static public function toggleHide($id, &$errors, &$status)
{
if(isset($id))
{
$row = ModelsNews::find($id);
if($row)
{
- $row->hidden = $row->hidden == 1 ? 0 : 1;
+ $row->hide = $row->hide == 1 ? 0 : 1;
if (!$row->save()) {
- $errors[] = 'Fail during toggle hidden News.';
+ $errors[] = 'Fail during toggle hide News.';
}
- $status = $row->hidden;
+ $status = $row->hide;
}
else
$errors[] = 'News with id ' . $id . ' does not exists.';
diff --git a/system/src/Spells.php b/system/src/Spells.php
index c187af2a..4438bd6e 100644
--- a/system/src/Spells.php
+++ b/system/src/Spells.php
@@ -81,7 +81,7 @@ class Spells {
'conjure_count' => $spell->getConjureCount(),
'conjure_id' => $spell->getConjureId(),
'reagent' => $spell->getReagentId(),
- 'hidden' => $spell->isEnabled() ? 0 : 1
+ 'hide' => $spell->isEnabled() ? 0 : 1
));
if($show) {
@@ -121,7 +121,7 @@ class Spells {
'premium' => $spell->isPremium() ? 1 : 0,
'vocations' => json_encode($spell->getVocations()),
'conjure_count' => 0,
- 'hidden' => $spell->isEnabled() ? 0 : 1
+ 'hide' => $spell->isEnabled() ? 0 : 1
));
if($show) {
@@ -159,7 +159,7 @@ class Spells {
'vocations' => json_encode($spell->getVocations()),
'conjure_count' => 0,
'item_id' => $spell->getID(),
- 'hidden' => $spell->isEnabled() ? 0 : 1
+ 'hide' => $spell->isEnabled() ? 0 : 1
));
if($show) {
diff --git a/system/templates/account.change_comment.html.twig b/system/templates/account.change_comment.html.twig
index 6c133d2b..04e20c0b 100644
--- a/system/templates/account.change_comment.html.twig
+++ b/system/templates/account.change_comment.html.twig
@@ -37,7 +37,7 @@ If you do not want to specify a certain field, just leave it blank.
Hide Account: |
-
+
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
|
diff --git a/system/templates/admin.changelog.html.twig b/system/templates/admin.changelog.html.twig
index e763c160..7581beef 100644
--- a/system/templates/admin.changelog.html.twig
+++ b/system/templates/admin.changelog.html.twig
@@ -51,7 +51,7 @@
{{ csrf() }}
-
+
diff --git a/system/templates/admin.links.html.twig b/system/templates/admin.links.html.twig
index ca2ca059..ac9b1134 100644
--- a/system/templates/admin.links.html.twig
+++ b/system/templates/admin.links.html.twig
@@ -19,7 +19,7 @@
{{ csrf() }}
-
+
diff --git a/system/templates/admin.news.table.html.twig b/system/templates/admin.news.table.html.twig
index 5e3633df..924b87b8 100644
--- a/system/templates/admin.news.table.html.twig
+++ b/system/templates/admin.news.table.html.twig
@@ -52,7 +52,7 @@
{{ csrf() }}
-
+
diff --git a/system/templates/admin.pages.html.twig b/system/templates/admin.pages.html.twig
index 5ee6e1db..b4c524ce 100644
--- a/system/templates/admin.pages.html.twig
+++ b/system/templates/admin.pages.html.twig
@@ -44,7 +44,7 @@
{{ csrf() }}
-
+
diff --git a/system/templates/changelog.html.twig b/system/templates/changelog.html.twig
index 4e2d584f..8133dc4a 100644
--- a/system/templates/changelog.html.twig
+++ b/system/templates/changelog.html.twig
@@ -25,7 +25,7 @@
{{ log.body|nl2br}} |
{% if canEdit %}
- {{ include('admin.links.html.twig', {page: 'changelog', id: log.id, hidden: log.hidden }) }}
+ {{ include('admin.links.html.twig', {page: 'changelog', id: log.id, hide: log.hide }) }}
|
{% endif %}
diff --git a/system/templates/characters.html.twig b/system/templates/characters.html.twig
index b4d8b359..ec00758e 100644
--- a/system/templates/characters.html.twig
+++ b/system/templates/characters.html.twig
@@ -328,7 +328,7 @@
{% endif %}
{{ hook(constant('HOOK_CHARACTERS_AFTER_SIGNATURE')) }}
- {% if not hidden %}
+ {% if not player.isHidden() %}
{% set rows = 0 %}
diff --git a/system/templates/commands.html.twig b/system/templates/commands.html.twig
index 381e0020..a68ae414 100644
--- a/system/templates/commands.html.twig
+++ b/system/templates/commands.html.twig
@@ -20,8 +20,8 @@
Delete
-
-
{% if command.hidden != 1 %}Hide{% else %}Show{% endif %}
+
+
{% if command.hide != 1 %}Hide{% else %}Show{% endif %}
{% if i != 1 %}
@@ -37,4 +37,4 @@
{% endif %}
{% endfor %}
-
\ No newline at end of file
+
diff --git a/system/templates/faq.html.twig b/system/templates/faq.html.twig
index c6ff405e..f4562fcf 100644
--- a/system/templates/faq.html.twig
+++ b/system/templates/faq.html.twig
@@ -29,8 +29,8 @@
Delete
-
-
{% if faq.hidden != 1 %}Hide{% else %}Show{% endif %}
+
+
{% if faq.hide != 1 %}Hide{% else %}Show{% endif %}
{% if i != 1 %}
@@ -67,4 +67,4 @@
expanded = !expanded;
}
-
\ No newline at end of file
+
diff --git a/system/templates/forum.boards.html.twig b/system/templates/forum.boards.html.twig
index ffaadc51..fe32c3d1 100644
--- a/system/templates/forum.boards.html.twig
+++ b/system/templates/forum.boards.html.twig
@@ -43,8 +43,8 @@
Delete
-
-
{% if board.hidden != 1 %}Hide{% else %}Show{% endif %}
+
+
{% if board.hide != 1 %}Hide{% else %}Show{% endif %}
{% if i != 1 %}
@@ -60,4 +60,4 @@
{% endif %}
{% endfor %}
-
\ No newline at end of file
+
diff --git a/system/templates/gallery.html.twig b/system/templates/gallery.html.twig
index f7121b48..49e8aafa 100644
--- a/system/templates/gallery.html.twig
+++ b/system/templates/gallery.html.twig
@@ -18,8 +18,8 @@ Click on the image to enlarge.
Delete
-
-
{% if image.hidden != 1 %}Hide{% else %}Show{% endif %}
+
+
{% if image.hide != 1 %}Hide{% else %}Show{% endif %}
{% if i != 1 %}
@@ -35,4 +35,4 @@ Click on the image to enlarge.
{% endif %}
-{% endfor %}
\ No newline at end of file
+{% endfor %}
diff --git a/templates/tibiacom/news.featured_article.html.twig b/templates/tibiacom/news.featured_article.html.twig
index 58b69a93..c78f61b1 100644
--- a/templates/tibiacom/news.featured_article.html.twig
+++ b/templates/tibiacom/news.featured_article.html.twig
@@ -20,7 +20,7 @@
{{ article.title|raw }}
{% if canEdit %}
- {{ include('admin.links.html.twig', {page: 'news', id: article.id, hidden: article.hidden }) }}
+ {{ include('admin.links.html.twig', {page: 'news', id: article.id, hide: article.hide }) }}
{% endif %}
diff --git a/templates/tibiacom/news.tickers.html.twig b/templates/tibiacom/news.tickers.html.twig
index 9cb54161..d005870c 100644
--- a/templates/tibiacom/news.tickers.html.twig
+++ b/templates/tibiacom/news.tickers.html.twig
@@ -20,7 +20,7 @@
{{ ticker.body_short|raw }}
{{ ticker.body|raw }}
{% if canEdit %}
- {{ include('admin.links.html.twig', {page: 'news', id: ticker.id, hidden: ticker.hidden }) }}
+ {{ include('admin.links.html.twig', {page: 'news', id: ticker.id, hide: ticker.hide }) }}
{% endif %}
diff --git a/tools/news_preview.php b/tools/news_preview.php
index 3330b0e8..7193b94d 100644
--- a/tools/news_preview.php
+++ b/tools/news_preview.php
@@ -20,7 +20,7 @@ if(isset($_GET['title'], $_GET['body'], $_GET['player_id'], $_GET['category'], $
{
$categories = array();
foreach($db->query(
- 'SELECT id, name, icon_id FROM ' . TABLE_PREFIX . 'news_categories WHERE hidden != 1') as $cat)
+ 'SELECT id, name, icon_id FROM ' . TABLE_PREFIX . 'news_categories WHERE hide != 1') as $cat)
{
$categories[$cat['id']] = array(
'name' => $cat['name'],
@@ -51,6 +51,7 @@ if(isset($_GET['title'], $_GET['body'], $_GET['player_id'], $_GET['category'], $
'title' => $_GET['title'],
'text' => $_GET['article_text'],
'image' => $_GET['article_image'],
+ 'hide' => 0,
'hidden' => 0,
'read_more'=> '#'
),
@@ -68,6 +69,7 @@ if(isset($_GET['title'], $_GET['body'], $_GET['player_id'], $_GET['category'], $
foreach($tickers as &$ticker) {
$ticker['icon'] = $categories[$ticker['category']]['icon_id'];
$ticker['body_short'] = short_text(strip_tags($ticker['body']), 100);
+ $ticker['hidden'] = $ticker['hide'];
}
$tickers_content = $twig->render('news.tickers.html.twig', array(
@@ -88,7 +90,8 @@ if(isset($_GET['title'], $_GET['body'], $_GET['player_id'], $_GET['category'], $
'author' => setting('core.news_author') ? $author : '',
'comments' => null,
'news_date_format' => setting('core.news_date_format'),
- 'hidden'=> 0
+ 'hide'=> 0,
+ 'hidden' => 0,
)));
}
}