mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
inbox count cache etc.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-02-06');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-02-08');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -5776,7 +5776,7 @@ function list_require_search_box_id()
|
||||
return $maps[nexus()->getScript()] ?? [];
|
||||
}
|
||||
|
||||
function can_access_torrent($torrent)
|
||||
function can_access_torrent($torrent, $uid)
|
||||
{
|
||||
global $specialcatmode;
|
||||
if (get_setting('main.spsct') != 'yes') {
|
||||
@@ -5797,7 +5797,7 @@ function can_access_torrent($torrent)
|
||||
if ($searchBoxId != $specialcatmode) {
|
||||
return true;
|
||||
}
|
||||
if (get_user_class() >= get_setting('authority.view_special_torrent')) {
|
||||
if (user_can('view_special_torrent', false, $uid)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1053,6 +1053,16 @@ function clear_icon_cache()
|
||||
\Nexus\Database\NexusDB::cache_del("category_icon_content");
|
||||
}
|
||||
|
||||
function clear_inbox_count_cache($uid)
|
||||
{
|
||||
do_log("clear_inbox_count_cache");
|
||||
foreach (\Illuminate\Support\Arr::wrap($uid) as $id) {
|
||||
\Nexus\Database\NexusDB::cache_del('user_'.$id.'_inbox_count');
|
||||
\Nexus\Database\NexusDB::cache_del('user_'.$id.'_unread_message_count');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function user_can($permission, $fail = false, $uid = 0): bool
|
||||
{
|
||||
$log = "permission: $permission, fail: $fail, user: $uid";
|
||||
|
||||
Reference in New Issue
Block a user