diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 99120ef0..348f19a5 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -11,7 +11,7 @@ class Setting extends NexusModel public static function get($name = null, $default = null) { - $settings = NexusDB::remember("nexus_settings_in_laravel", 10, function () { + $settings = NexusDB::remember("nexus_settings_in_laravel", 600, function () { return self::getFromDb(); }); if (is_null($name)) { diff --git a/classes/class_cache_redis.php b/classes/class_cache_redis.php index 87120ef1..9fb037cc 100644 --- a/classes/class_cache_redis.php +++ b/classes/class_cache_redis.php @@ -19,10 +19,15 @@ class class_cache_redis { public $redis; function __construct() { - $this->connect(); // Connect to Redis + $connectResult = $this->connect(); // Connect to Redis + if ($connectResult) { + $this->isEnabled = true; + } else { + $this->isEnabled = false; + } } - private function connect() + private function connect(): bool { $config = nexus_config('nexus.redis'); $redis = new Redis(); @@ -47,6 +52,7 @@ class class_cache_redis { } else { throw new \RuntimeException("Redis connect fail."); } + return true; } function getIsEnabled() { diff --git a/include/globalfunctions.php b/include/globalfunctions.php index de655361..fa559307 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -284,7 +284,7 @@ function get_setting($name = null, $default = null): mixed { static $settings; if (is_null($settings)) { - $settings = \Nexus\Database\NexusDB::remember("nexus_settings_in_nexus", 10, function () { + $settings = \Nexus\Database\NexusDB::remember("nexus_settings_in_nexus", 600, function () { //get all settings from database return \App\Models\Setting::getFromDb(); }); diff --git a/public/invite.php b/public/invite.php index fe89dd83..db15ef3b 100644 --- a/public/invite.php +++ b/public/invite.php @@ -7,6 +7,7 @@ parked(); $id = intval($_GET["id"] ?? 0); $type = unesc($_GET["type"] ?? ''); $menuSelected = $_REQUEST['menu'] ?? 'invitee'; +$pageSize = 20; registration_check('invitesystem',true,false); @@ -71,17 +72,17 @@ if ($type == 'new'){ $rel = sql_query("SELECT COUNT(*) FROM users WHERE invited_by = ".mysql_real_escape_string($id)) or sqlerr(__FILE__, __LINE__); $arro = mysql_fetch_row($rel); $number = $arro[0]; - list($pagertop, $pagerbottom, $limit) = pager(1, $number, "?id=$id&menu=$menuSelected&"); - - $ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email FROM users WHERE invited_by = ".mysql_real_escape_string($id) . " $limit") or sqlerr(); - $num = mysql_num_rows($ret); print("