diff --git a/include/functions.php b/include/functions.php index ab4750e0..ff2f6df7 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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') { diff --git a/lang/chs/lang_functions.php b/lang/chs/lang_functions.php index adb07155..15325322 100644 --- a/lang/chs/lang_functions.php +++ b/lang/chs/lang_functions.php @@ -321,7 +321,8 @@ $lang_functions = array 'menu_claim' => '认领: ', 'text_complains' => '有%s%u个待处理的申诉%s', 'text_contactstaff' => '联系管理组', - 'full_site_promotion_in_effect' => '全站 [%s] 生效中!时间:%s', + 'full_site_promotion_in_effect' => '全站 [%s] 生效中!', + 'full_site_promotion_time_range' => '时间:%s ~ %s', 'text_torrent_to_approval' => '有 %s%u 个待审核的种子%s', 'std_confirm_remove' => '确定要删除吗?', 'select_an_user_class' => '选择一个用户等级', diff --git a/lang/cht/lang_functions.php b/lang/cht/lang_functions.php index 719b2569..6318b138 100644 --- a/lang/cht/lang_functions.php +++ b/lang/cht/lang_functions.php @@ -328,7 +328,8 @@ $lang_functions = array 'menu_claim' => '認領: ', 'text_complains' => '有%s%u個待處理的申诉%s', 'text_contactstaff' => '聯系管理組', - 'full_site_promotion_in_effect' => '全站 [%s] 生效中!時間:%s', + 'full_site_promotion_in_effect' => '全站 [%s] 生效中!', + 'full_site_promotion_time_range' => '時間:%s ~ %s', 'text_torrent_to_approval' => '有 %s%u 個待審核的種子%s', 'std_confirm_remove' => '確定要刪除嗎?', 'select_an_user_class' => '選擇一個用戶等級', diff --git a/lang/en/lang_functions.php b/lang/en/lang_functions.php index 166233b1..8bd3479c 100644 --- a/lang/en/lang_functions.php +++ b/lang/en/lang_functions.php @@ -329,7 +329,8 @@ $lang_functions = array 'menu_claim' => 'Claim: ', 'text_complains' => 'There %s %u pending complaint%s.', 'text_contactstaff' => 'Contact staff', - 'full_site_promotion_in_effect' => 'Full site [%s] in effect! Time range: %s', + 'full_site_promotion_in_effect' => 'Full site [%s] in effect!', + 'full_site_promotion_time_range' => 'Time range: %s ~ %s', 'text_torrent_to_approval' => 'There %s%u not approval torrent%s.', 'std_confirm_remove' => 'Are you sure you want to delete it?', 'select_an_user_class' => 'Select an user class',