mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Change hidden to hide (Eloquent blocked keyword)
This commit is contained in:
@@ -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();
|
||||
|
@@ -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()
|
||||
|
@@ -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', '<p> </p>
|
||||
<p> </p>
|
||||
<div style=\"text-align: center;\">We''re using official Tibia Client <strong>{{ config.client / 100 }}</strong><br />
|
||||
@@ -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', '<table style=\"border-collapse: collapse; width: 87.8471%; height: 57px;\" border=\"1\">
|
||||
<tbody>
|
||||
<tr style=\"height: 18px;\">
|
||||
|
@@ -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\").
|
||||
|
15
system/migrations/39.php
Normal file
15
system/migrations/39.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// 2024-01-27
|
||||
// change hidden to hide (Eloquent model reserved keyword)
|
||||
|
||||
$db->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;");
|
@@ -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 <b>' . $player->name . '</b>.');
|
||||
|
@@ -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(),
|
||||
|
@@ -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)
|
||||
|
@@ -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.';
|
||||
|
@@ -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(
|
||||
|
@@ -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') {
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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.';
|
||||
|
@@ -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 = '<br/><br/>' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hidden' => $news['hidden']]);
|
||||
$admin_options = '<br/><br/>' . $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']))
|
||||
<?php
|
||||
|
||||
$newses = array();
|
||||
$news_DB = $db->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 = '<br/><br/>' . $twig->render('admin.links.html.twig', ['page' => 'news', 'id' => $news['id'], 'hidden' => $news['hidden']]);
|
||||
$admin_options = '<br/><br/>' . $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']
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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.';
|
||||
|
@@ -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.';
|
||||
}
|
||||
|
@@ -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.';
|
||||
}
|
||||
|
@@ -11,6 +11,6 @@ class Changelog extends Model {
|
||||
public $timestamps = false;
|
||||
|
||||
public function scopeIsPublic($query) {
|
||||
$query->where('hidden', '!=', 1);
|
||||
$query->where('hide', '!=', 1);
|
||||
}
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@ class FAQ extends Model {
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = ['question', 'answer', 'ordering', 'hidden'];
|
||||
protected $fillable = ['question', 'answer', 'ordering', 'hide'];
|
||||
}
|
||||
|
@@ -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()
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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.';
|
||||
|
@@ -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) {
|
||||
|
@@ -37,7 +37,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
|
||||
<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.hidden %}checked="checked"{% endif %}>
|
||||
<input type="checkbox" name="accountvisible" id="accountvisible" value="1" {% if player.hide %}checked="checked"{% endif %}>
|
||||
<label for="accountvisible"> check to hide your account information</label>
|
||||
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
|
||||
</td>
|
||||
|
@@ -51,7 +51,7 @@
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="hide" />
|
||||
<input type="hidden" name="id" value="{{ log.id }}" />
|
||||
<button type="submit" class="btn btn-{{ (log.hidden != 1) ? 'info' : 'default' }} btn-sm" title="{% if log.hidden != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (log.hidden != 1) ? '' : '-slash' }}"></i></button>
|
||||
<button type="submit" class="btn btn-{{ (log.hide != 1) ? 'info' : 'default' }} btn-sm" title="{% if log.hide != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (log.hide != 1) ? '' : '-slash' }}"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
|
@@ -19,7 +19,7 @@
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="hide" />
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
<button type="submit" title="{% if hidden != 1 %}Hide{% else %}Show{% endif %}"><img src="images/{{ hidden != 1 ? 'success' : 'error' }}.png"/>{{ hidden != 1 ? 'Hide' : 'Show' }}</button>
|
||||
<button type="submit" title="{% if hide != 1 %}Hide{% else %}Show{% endif %}"><img src="images/{{ hide != 1 ? 'success' : 'error' }}.png"/>{{ hide != 1 ? 'Hide' : 'Show' }}</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -52,7 +52,7 @@
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="hide" />
|
||||
<input type="hidden" name="id" value="{{ news.id }}" />
|
||||
<button type="submit" class="btn btn-{{ (news.hidden != 1) ? 'info' : 'default' }} btn-sm" title="{% if news.hidden != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (news.hidden != 1) ? '' : '-slash' }}"></i></button>
|
||||
<button type="submit" class="btn btn-{{ (news.hide != 1) ? 'info' : 'default' }} btn-sm" title="{% if news.hide != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (news.hide != 1) ? '' : '-slash' }}"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
|
@@ -44,7 +44,7 @@
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="action" value="hide" />
|
||||
<input type="hidden" name="id" value="{{ page.id }}" />
|
||||
<button type="submit" class="btn btn-{{ (page.hidden != 1) ? 'info' : 'default' }} btn-sm" title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (log.hidden != 1) ? '' : '-slash' }}"></i></button>
|
||||
<button type="submit" class="btn btn-{{ (page.hide != 1) ? 'info' : 'default' }} btn-sm" title="{% if page.hide != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (log.hide != 1) ? '' : '-slash' }}"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
|
@@ -25,7 +25,7 @@
|
||||
<td>{{ log.body|nl2br}}</td>
|
||||
{% if canEdit %}
|
||||
<td>
|
||||
{{ 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 }) }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
@@ -328,7 +328,7 @@
|
||||
<!-- SIGNATURE_END -->
|
||||
{% endif %}
|
||||
{{ hook(constant('HOOK_CHARACTERS_AFTER_SIGNATURE')) }}
|
||||
{% if not hidden %}
|
||||
{% if not player.isHidden() %}
|
||||
{% set rows = 0 %}
|
||||
<!-- ACCOUNT_INFORMATION -->
|
||||
<br/><br/>
|
||||
|
@@ -20,8 +20,8 @@
|
||||
<a id="delete" href="?subtopic=commands&action=delete&id={{ command.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="?subtopic=commands&action=hide&id={{ command.id }}" title="{% if command.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if command.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if command.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
<a href="?subtopic=commands&action=hide&id={{ command.id }}" title="{% if command.hide != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if command.hide != 1 %}success{% else %}error{% endif %}.png"/>{% if command.hide != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
{% if i != 1 %}
|
||||
<a href="?subtopic=commands&action=moveup&id={{ command.id }}" title="Move up">
|
||||
@@ -37,4 +37,4 @@
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</table>
|
||||
|
@@ -29,8 +29,8 @@
|
||||
<a id="delete" href="?subtopic=faq&action=delete&id={{ faq.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="?subtopic=faq&action=hide&id={{ faq.id }}" title="{% if faq.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if faq.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if faq.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
<a href="?subtopic=faq&action=hide&id={{ faq.id }}" title="{% if faq.hide != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if faq.hide != 1 %}success{% else %}error{% endif %}.png"/>{% if faq.hide != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
{% if i != 1 %}
|
||||
<a href="?subtopic=faq&action=moveup&id={{ faq.id }}" title="Move up">
|
||||
@@ -67,4 +67,4 @@
|
||||
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
@@ -43,8 +43,8 @@
|
||||
<a id="delete" href="?subtopic=forum&action=delete_board&id={{ board.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="?subtopic=forum&action=hide_board&id={{ board.id }}" title="{% if board.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if board.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if board.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
<a href="?subtopic=forum&action=hide_board&id={{ board.id }}" title="{% if board.hide != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if board.hide != 1 %}success{% else %}error{% endif %}.png"/>{% if board.hide != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
{% if i != 1 %}
|
||||
<a href="?subtopic=forum&action=moveup_board&id={{ board.id }}" title="Move up">
|
||||
@@ -60,4 +60,4 @@
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</table>
|
||||
|
@@ -18,8 +18,8 @@ Click on the image to enlarge.<br/><br/>
|
||||
<a id="delete" href="?subtopic=gallery&action=delete&id={{ image.id }}" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="?subtopic=gallery&action=hide&id={{ image.id }}" title="{% if image.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if image.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if image.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
<a href="?subtopic=gallery&action=hide&id={{ image.id }}" title="{% if image.hide != 1 %}Hide{% else %}Show{% endif %}">
|
||||
<img src="images/{% if image.hide != 1 %}success{% else %}error{% endif %}.png"/>{% if image.hide != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
{% if i != 1 %}
|
||||
<a href="?subtopic=gallery&action=moveup&id={{ image.id }}" title="Move up">
|
||||
@@ -35,4 +35,4 @@ Click on the image to enlarge.<br/><br/>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</table>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user