$link_win = Filter::input('link_win'); $link_osx = Filter::input('link_osx'); $link_lin = Filter::input('link_lin'); if ($link_win) { sqlConfigSet('game-link-win', $link_win); } if ($link_osx) { sqlConfigSet('game-link-osx', $link_osx); } if ($link_lin) { sqlConfigSet('game-link-lin', $link_lin); } if ($game_news !== false) { if ($game_news <= 0) { $config['game_news'] = 0; } elseif (CategoryManager::ExistByID($game_news)) { $config['game_news'] = $game_news; } } if ($new_build) { sqlConfigSet('latest-game-build', $new_build); } if ($new_version_l) { sqlConfigSet('launcher-version', $new_version_l); } if ($link_win or $link_osx or $link_lin or $game_news or $new_build or $new_version_l) { if (MainConfig::SaveOptions()) { $info .= lng('OPTIONS_COMPLETE'); } else { $info .= lng('WRITE_FAIL') . ' ( ' . MCR_ROOT . 'config.php )'; }
public function Edit($cat_id, $title, $message, $message_full = false, $vote = true, $discus = true) { global $user; if (!$this->Exist() or empty($user) or !$user->getPermission('add_news')) { return false; } $cat_id = (int) $cat_id; if (!CategoryManager::ExistByID($cat_id)) { return false; } $sql = "UPDATE `{$this->db}` SET " . "`message`=:message," . "`title`=:title," . "`message_full`=:message_full," . "`category_id`=:category_id, " . "`discus`=:discus," . "`vote`=:vote WHERE `id`='" . $this->id . "'"; $result = getDB()->ask($sql, array('title' => $title, 'message' => TextBase::StringLen($message) ? (string) $message : '', 'message_full' => TextBase::StringLen($message_full) ? (string) $message_full : '', 'category_id' => $cat_id, 'discus' => $discus ? '1' : '0', 'vote' => $vote ? '1' : '0')); $this->category_id = (int) $cat_id; $this->title = $title; $this->discus = $discus ? true : false; $this->vote = $vote ? true : false; return true; }