mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
improve torrent-approval notice
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.23');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.23');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-08-25');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-08-26');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
+13
-12
@@ -2770,20 +2770,21 @@ if ($msgalert)
|
|||||||
msgalert("staffbox.php",$text, "blue");
|
msgalert("staffbox.php",$text, "blue");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//torrent approval
|
||||||
|
if (user_can('torrent-approval') && get_setting('torrent.approval_status_none_visible') == 'no') {
|
||||||
|
$cacheKey = 'TORRENT_APPROVAL_NONE';
|
||||||
|
$toApprovalCounts = $Cache->get_value($cacheKey);
|
||||||
|
if ($toApprovalCounts === false) {
|
||||||
|
$toApprovalCounts = get_row_count('torrents', 'where approval_status = 0');
|
||||||
|
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
|
||||||
|
}
|
||||||
|
if ($toApprovalCounts) {
|
||||||
|
msgalert('torrents.php?approval_status=0', sprintf($lang_functions['text_torrent_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (user_can('staffmem'))
|
if (user_can('staffmem'))
|
||||||
{
|
{
|
||||||
//torrent approval
|
|
||||||
if (get_setting('torrent.approval_status_none_visible') == 'no') {
|
|
||||||
$cacheKey = 'TORRENT_APPROVAL_NONE';
|
|
||||||
$toApprovalCounts = $Cache->get_value($cacheKey);
|
|
||||||
if ($toApprovalCounts === false) {
|
|
||||||
$toApprovalCounts = get_row_count('torrents', 'where approval_status = 0');
|
|
||||||
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
|
|
||||||
}
|
|
||||||
if ($toApprovalCounts) {
|
|
||||||
msgalert('torrents.php?approval_status=0', sprintf($lang_functions['text_torrent_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(($complaints = $Cache->get_value('COMPLAINTS_COUNT_CACHE')) === false){
|
if(($complaints = $Cache->get_value('COMPLAINTS_COUNT_CACHE')) === false){
|
||||||
$complaints = get_row_count('complains', 'WHERE answered = 0');
|
$complaints = get_row_count('complains', 'WHERE answered = 0');
|
||||||
|
|||||||
+2
-2
@@ -812,7 +812,7 @@ $approvalStatusIconEnabled = get_setting('torrent.approval_status_icon_enabled')
|
|||||||
$approvalStatus = null;
|
$approvalStatus = null;
|
||||||
$showApprovalStatusFilter = false;
|
$showApprovalStatusFilter = false;
|
||||||
//when enable approval status icon, all user can use this filter, otherwise only staff member and approval none visible is 'no' can use
|
//when enable approval status icon, all user can use this filter, otherwise only staff member and approval none visible is 'no' can use
|
||||||
if ($approvalStatusIconEnabled == 'yes' || (user_can('staffmem') && $approvalStatusNoneVisible == 'no')) {
|
if ($approvalStatusIconEnabled == 'yes' || (user_can('torrent-approval') && $approvalStatusNoneVisible == 'no')) {
|
||||||
$showApprovalStatusFilter = true;
|
$showApprovalStatusFilter = true;
|
||||||
}
|
}
|
||||||
//when user can use approval status filter, and pass `approval_status` parameter, will affect
|
//when user can use approval status filter, and pass `approval_status` parameter, will affect
|
||||||
@@ -820,7 +820,7 @@ if ($approvalStatusIconEnabled == 'yes' || (user_can('staffmem') && $approvalSta
|
|||||||
if ($showApprovalStatusFilter && isset($_REQUEST['approval_status']) && is_numeric($_REQUEST['approval_status'])) {
|
if ($showApprovalStatusFilter && isset($_REQUEST['approval_status']) && is_numeric($_REQUEST['approval_status'])) {
|
||||||
$approvalStatus = intval($_REQUEST['approval_status']);
|
$approvalStatus = intval($_REQUEST['approval_status']);
|
||||||
$wherea[] = "torrents.approval_status = $approvalStatus";
|
$wherea[] = "torrents.approval_status = $approvalStatus";
|
||||||
} elseif ($approvalStatusNoneVisible == 'no' && !user_can('staffmem')) {
|
} elseif ($approvalStatusNoneVisible == 'no' && !user_can('torrent-approval')) {
|
||||||
$wherea[] = "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
$wherea[] = "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user