/** * Show betingelser */ public function action_betingelser() { \ess::$b->page->add_title("Betingelser"); $user = \login::$logged_in ? \login::$user : null; // markere betingelsene som sett? $updated = false; if ($user && ($user->data['u_tos_version'] != intval(Settings::get('tos_version')) || empty($user->data['u_tos_accepted_time']))) { $updated = true; $user->data['u_tos_version'] = intval(Settings::get("tos_version")); $user->data['u_tos_accepted_time'] = time(); \Kofradia\DB::get()->exec("\n\t\t\t\tUPDATE users\n\t\t\t\tSET u_tos_version = " . $user->data['u_tos_version'] . ",\n\t\t\t\t\tu_tos_accepted_time = " . time() . "\n\t\t\t\tWHERE u_id = " . $user->id); } return View::forge("misc/betingelser", array("tos_version" => Settings::get("tos_version"), "tos_update" => Settings::get("tos_update"), "tos" => Settings::get("tos"), "user" => $user, "updated" => $updated)); }
<?php \Kofradia\Settings::reload();
/** * Get the current number for last change * * @return int */ public static function getSetting($name) { return (int) \Kofradia\Settings::get('github_' . $name, 0); }