improve global promotion tips

This commit is contained in:
xiaomlove
2022-08-26 18:10:23 +08:00
parent e6888c043c
commit 5a4e8ddc1a
4 changed files with 12 additions and 8 deletions

View File

@@ -2690,11 +2690,12 @@ if ($msgalert)
$spStateGlobal = get_global_sp_state();
if ($spStateGlobal != \App\Models\Torrent::PROMOTION_NORMAL) {
$torrentGlobalStateRow = \Nexus\Database\NexusDB::cache_get(\App\Models\Setting::TORRENT_GLOBAL_STATE_CACHE_KEY);
$timeRange = sprintf('%s ~ %s', $torrentGlobalStateRow['begin'] ?? '', $torrentGlobalStateRow['deadline'] ?? '');
msgalert("torrents.php", sprintf(
$lang_functions['full_site_promotion_in_effect'],
\App\Models\Torrent::$promotionTypes[$spStateGlobal]['text'], $timeRange
), "green");
$msg = sprintf($lang_functions['full_site_promotion_in_effect'], \App\Models\Torrent::$promotionTypes[$spStateGlobal]['text']);
if (!empty($torrentGlobalStateRow['begin']) || !empty($torrentGlobalStateRow['deadline'])) {
$timeRange = sprintf($lang_functions['full_site_promotion_time_range'], $torrentGlobalStateRow['begin'] ?? '-∞', $torrentGlobalStateRow['deadline'] ?? '∞');
$msg .= $timeRange;
}
msgalert("torrents.php", $msg, "green");
}
if($CURUSER['leechwarn'] == 'yes')
{