mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
add torrent pos_state_until
This commit is contained in:
@@ -462,6 +462,28 @@ function docleanup($forceAll = 0, $printProgress = false) {
|
||||
if ($printProgress) {
|
||||
printProgress($log);
|
||||
}
|
||||
|
||||
//expire torrent sticky
|
||||
$toBeExpirePosStates = [
|
||||
\App\Models\Torrent::POS_STATE_STICKY_FIRST,
|
||||
\App\Models\Torrent::POS_STATE_STICKY_SECOND,
|
||||
];
|
||||
$update = [
|
||||
'pos_state' => \App\Models\Torrent::POS_STATE_STICKY_NONE,
|
||||
'pos_state_until' => null,
|
||||
];
|
||||
\App\Models\Torrent::query()
|
||||
->whereIn('pos_state', $toBeExpirePosStates)
|
||||
->whereNotNull('pos_state_until')
|
||||
->where('pos_state_until', '<', now())
|
||||
->update($update);
|
||||
$log = "expire torrent pos state";
|
||||
do_log($log);
|
||||
if ($printProgress) {
|
||||
printProgress($log);
|
||||
}
|
||||
|
||||
|
||||
//automatically pick hot
|
||||
if ($hotdays_torrent)
|
||||
{
|
||||
|
||||
@@ -5872,4 +5872,24 @@ function calculate_harem_addition($uid)
|
||||
return $addition;
|
||||
}
|
||||
|
||||
function datetimepicker_input($name, $value = '', $label = '')
|
||||
{
|
||||
\Nexus\Nexus::css('vendor/jquery-datetimepicker/jquery.datetimepicker.min.css', 'footer', true);
|
||||
\Nexus\Nexus::js('vendor/jquery-datetimepicker/jquery.datetimepicker.full.min.js', 'footer', true);
|
||||
$id = "datetime-picker-$name";
|
||||
$input = sprintf('%s<input type="text" id="%s" name="%s" value="%s" autocomplete="off" >', $label, $id, $name, $value);
|
||||
$lang = get_langfolder_cookie(true);
|
||||
if ($lang == 'zh_CN') {
|
||||
$lang = 'zh';
|
||||
}
|
||||
$lang = str_replace('_', '-', $lang);
|
||||
$js = <<<JS
|
||||
jQuery.datetimepicker.setLocale('{$lang}');
|
||||
jQuery("#{$id}").datetimepicker({
|
||||
format: 'Y-m-d H:i'
|
||||
})
|
||||
JS;
|
||||
\Nexus\Nexus::js($js, 'footer', false);
|
||||
return $input;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user