protected function post_forum_ranks()
{
global $aidlink;
if (isset($_POST['save_rank'])) {
$this->data = array('rank_id' => isset($_GET['rank_id']) && isnum($_GET['rank_id']) ? intval($_GET['rank_id']) : 0, 'rank_title' => form_sanitizer($_POST['rank_title'], '', 'rank_title'), 'rank_image' => form_sanitizer($_POST['rank_image'], "", "rank_image"), 'rank_language' => form_sanitizer($_POST['rank_language'], "", "rank_language"), 'rank_posts' => isset($_POST['rank_posts']) && isnum($_POST['rank_posts']) ? $_POST['rank_posts'] : 0, 'rank_type' => isset($_POST['rank_type']) && isnum($_POST['rank_type']) ? $_POST['rank_type'] : 0, 'rank_apply_normal' => isset($_POST['rank_apply_normal']) && isnum($_POST['rank_apply_normal']) ? $_POST['rank_apply_normal'] : USER_LEVEL_MEMBER, 'rank_apply_special' => isset($_POST['rank_apply_special']) && isnum($_POST['rank_apply_special']) ? $_POST['rank_apply_special'] : 1);
$this->data += array('rank_apply' => $this->data['rank_type'] == 2 ? $this->data['rank_apply_special'] : $this->data['rank_apply_normal']);
if (\defender::safe()) {
if (!empty($this->data['rank_id']) && !$this->check_duplicate_ranks()) {
/**
* Update
*/
dbquery_insert(DB_FORUM_RANKS, $this->data, "update");
addNotice('info', self::$locale['411']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
} elseif (!$this->check_duplicate_ranks()) {
/**
* Save New
*/
dbquery_insert(DB_FORUM_RANKS, $this->data, "save");
addNotice('info', self::$locale['410']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
}
}
}
if (isset($_GET['delete']) && isnum($_GET['delete'])) {
$result = dbquery("DELETE FROM " . DB_FORUM_RANKS . " WHERE rank_id='" . $_GET['delete'] . "'");
if ($result) {
addNotice("success", self::$locale['412']);
redirect(FUSION_SELF . $aidlink . '§ion=fr');
}
}
}