2020-12-26 01:42:23 +08:00
< ? php
2021-01-13 19:32:26 +08:00
require_once ( " ../include/bittorrent.php " );
2020-12-26 01:42:23 +08:00
dbconn ();
require_once ( get_langfile_path ());
loggedinorreturn ();
2021-01-06 01:31:21 +08:00
$id = intval ( $_GET [ 'id' ] ? ? 0 );
2020-12-26 01:42:23 +08:00
if ( ! $id )
die ();
2025-05-16 02:43:45 +07:00
$res = sql_query ( " SELECT torrents.*, categories.mode as cat_mode, torrent_extras.media_info as technical_info, torrent_extras.descr, torrent_extras.pt_gen FROM torrents LEFT JOIN categories ON category = categories.id left join torrent_extras on torrents.id = torrent_extras.torrent_id WHERE torrents.id = $id " );
2022-10-27 20:21:54 +08:00
$row = mysql_fetch_assoc ( $res );
2020-12-26 01:42:23 +08:00
if ( ! $row ) die ();
2021-03-03 19:29:29 +08:00
/**
* custom fields
* @ since v1 . 6
*/
2021-03-04 02:27:39 +08:00
$customField = new \Nexus\Field\Field ();
2022-10-01 00:11:22 +08:00
$hitAndRunRep = new \App\Repositories\HitAndRunRepository ();
2022-10-30 17:30:24 +08:00
$tagRep = new \App\Repositories\TagRepository ();
2022-03-08 15:08:56 +08:00
$tagIdArr = \App\Models\TorrentTag :: query () -> where ( 'torrent_id' , $id ) -> get () -> pluck ( 'tag_id' ) -> toArray ();
2022-09-14 19:05:29 +08:00
$searchBoxRep = new \App\Repositories\SearchBoxRepository ();
2022-08-20 19:11:28 +08:00
if ( $enablespecial == 'yes' && user_can ( 'movetorrent' ))
2020-12-26 01:42:23 +08:00
$allowmove = true ; //enable moving torrent to other section
else $allowmove = false ;
$sectionmode = $row [ 'cat_mode' ];
if ( $sectionmode == $browsecatmode )
{
$othermode = $specialcatmode ;
$movenote = $lang_edit [ 'text_move_to_special' ];
}
else
{
$othermode = $browsecatmode ;
$movenote = $lang_edit [ 'text_move_to_browse' ];
}
2022-09-14 19:05:29 +08:00
/*
2020-12-26 01:42:23 +08:00
$showsource = ( get_searchbox_value ( $sectionmode , 'showsource' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showsource' ))); //whether show sources or not
$showmedium = ( get_searchbox_value ( $sectionmode , 'showmedium' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showmedium' ))); //whether show media or not
$showcodec = ( get_searchbox_value ( $sectionmode , 'showcodec' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showcodec' ))); //whether show codecs or not
$showstandard = ( get_searchbox_value ( $sectionmode , 'showstandard' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showstandard' ))); //whether show standards or not
$showprocessing = ( get_searchbox_value ( $sectionmode , 'showprocessing' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showprocessing' ))); //whether show processings or not
$showteam = ( get_searchbox_value ( $sectionmode , 'showteam' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showteam' ))); //whether show teams or not
$showaudiocodec = ( get_searchbox_value ( $sectionmode , 'showaudiocodec' ) || ( $allowmove && get_searchbox_value ( $othermode , 'showaudiocodec' ))); //whether show audio codecs or not
2022-09-14 19:05:29 +08:00
*/
2021-01-15 22:13:46 +08:00
$settingMain = get_setting ( 'main' );
2020-12-26 01:42:23 +08:00
stdhead ( $lang_edit [ 'head_edit_torrent' ] . " \" " . $row [ " name " ] . " \" " );
2022-08-20 19:11:28 +08:00
if ( ! isset ( $CURUSER ) || ( $CURUSER [ " id " ] != $row [ " owner " ] && ! user_can ( 'torrentmanage' ))) {
2020-12-26 01:42:23 +08:00
print ( " <h1 align= \" center \" > " . $lang_edit [ 'text_cannot_edit_torrent' ] . " </h1> " );
2025-04-19 02:06:51 +07:00
echo sprintf ( " <p> " . $lang_edit [ 'text_cannot_edit_torrent_note' ] . " </p> " , $_SERVER [ " REQUEST_URI " ] ? ? '' );
2020-12-26 01:42:23 +08:00
}
else {
print ( " <form method= \" post \" id= \" compose \" name= \" edittorrent \" action= \" takeedit.php \" enctype= \" multipart/form-data \" > " );
print ( " <input type= \" hidden \" name= \" id \" value= \" $id\ " /> " );
if ( isset ( $_GET [ " returnto " ]))
print ( " <input type= \" hidden \" name= \" returnto \" value= \" " . htmlspecialchars ( $_GET [ " returnto " ]) . " \" /> " );
2021-05-26 21:38:39 +08:00
print ( " <table border= \" 1 \" cellspacing= \" 0 \" cellpadding= \" 5 \" width= \" 97% \" > \n " );
2020-12-26 01:42:23 +08:00
print ( " <tr><td class='colhead' colspan='2' align='center'> " . htmlspecialchars ( $row [ " name " ]) . " </td></tr> " );
2022-04-01 23:13:42 +08:00
tr ( $lang_edit [ 'row_torrent_name' ] . " <font color= \" red \" >*</font> " , " <input type= \" text \" style= \" width: 99%; \" name= \" name \" value= \" " . htmlspecialchars ( $row [ " name " ]) . " \" /> " , 1 );
2020-12-26 01:42:23 +08:00
if ( $smalldescription_main == 'yes' )
2022-04-01 23:13:42 +08:00
tr ( $lang_edit [ 'row_small_description' ], " <input type= \" text \" style= \" width: 99%; \" name= \" small_descr \" value= \" " . htmlspecialchars ( $row [ " small_descr " ]) . " \" /> " , 1 );
2020-12-26 01:42:23 +08:00
get_external_tr ( $row [ " url " ]);
2021-01-15 22:13:46 +08:00
if ( $settingMain [ 'enable_pt_gen_system' ] == 'yes' ) {
$ptGen = new \Nexus\PTGen\PTGen ();
echo $ptGen -> renderUploadPageFormInput ( $row [ 'pt_gen' ]);
}
2020-12-26 01:42:23 +08:00
if ( $enablenfo_main == 'yes' )
tr ( $lang_edit [ 'row_nfo_file' ], " <font class= \" medium \" ><input type= \" radio \" name= \" nfoaction \" value= \" keep \" checked= \" checked \" /> " . $lang_edit [ 'radio_keep_current' ] .
" <input type= \" radio \" name= \" nfoaction \" value= \" remove \" /> " . $lang_edit [ 'radio_remove' ] .
" <input id= \" nfoupdate \" type= \" radio \" name= \" nfoaction \" value= \" update \" /> " . $lang_edit [ 'radio_update' ] . " </font><br /><input type= \" file \" name= \" nfo \" onchange= \" document.getElementById('nfoupdate').checked=true \" /> " , 1 );
2023-02-11 16:08:48 +08:00
//price
2023-04-29 12:57:46 +08:00
if ( user_can ( 'torrent-set-price' ) && get_setting ( " torrent.paid_torrent_enabled " ) == " yes " ) {
$maxPrice = get_setting ( " torrent.max_price " );
$pricePlaceholder = " " ;
if ( $maxPrice > 0 ) {
$pricePlaceholder = nexus_trans ( " label.torrent.max_price_help " , [ " max_price " => $maxPrice ]);
}
tr ( nexus_trans ( 'label.torrent.price' ), '<input type="number" min="0" name="price" value="' . $row [ 'price' ] . '" placeholder="' . $pricePlaceholder . '" /> ' . nexus_trans ( 'label.torrent.price_help' , [ 'tax_factor' => ( floatval ( get_setting ( 'torrent.tax_factor' , 0 )) * 100 ) . '%' ]), 1 );
2023-02-11 16:08:48 +08:00
}
print ( " <tr><td class= \" rowhead \" > " . $lang_edit [ 'row_description' ] . " <font color= \" red \" >*</font></td><td class= \" rowfollow \" > " );
2022-04-01 23:13:42 +08:00
textbbcode ( " edittorrent " , " descr " ,( $row [ " descr " ]), false , 130 , true );
2020-12-26 01:42:23 +08:00
print ( " </td></tr> " );
2021-03-18 20:32:35 +08:00
if ( $settingMain [ 'enable_technical_info' ] == 'yes' ) {
2022-04-01 23:13:42 +08:00
tr ( $lang_functions [ 'text_technical_info' ], '<textarea name="technical_info" rows="8" style="width: 99%;">' . $row [ 'technical_info' ] . '</textarea><br/>' . $lang_functions [ 'text_technical_info_help_text' ], 1 );
2021-03-18 20:32:35 +08:00
}
2022-09-19 16:27:04 +08:00
$s = " <select name= \" type \" id= \" oricat \" data-mode=' $sectionmode '> " ;
2020-12-26 01:42:23 +08:00
$cats = genrelist ( $sectionmode );
foreach ( $cats as $subrow ) {
$s .= " <option value= \" " . $subrow [ " id " ] . " \" " ;
if ( $subrow [ " id " ] == $row [ " category " ])
$s .= " selected= \" selected \" " ;
$s .= " > " . htmlspecialchars ( $subrow [ " name " ]) . " </option> \n " ;
}
$s .= " </select> \n " ;
if ( $allowmove ){
2022-09-19 16:27:04 +08:00
$s2 = " <select name= \" type \" id=newcat disabled data-mode=' $othermode '> \n " ;
2020-12-26 01:42:23 +08:00
$cats2 = genrelist ( $othermode );
foreach ( $cats2 as $subrow ) {
$s2 .= " <option value= \" " . $subrow [ " id " ] . " \" " ;
if ( $subrow [ " id " ] == $row [ " category " ])
$s2 .= " selected= \" selected \" " ;
$s2 .= " > " . htmlspecialchars ( $subrow [ " name " ]) . " </option> \n " ;
}
$s2 .= " </select> \n " ;
$movecheckbox = " <input type= \" checkbox \" id=movecheck name= \" movecheck \" value= \" 1 \" onclick= \" disableother2('oricat','newcat') \" /> " ;
}
tr ( $lang_edit [ 'row_type' ] . " <font color= \" red \" >*</font> " , $s . ( $allowmove ? " " . $movecheckbox . $movenote . $s2 : " " ), 1 );
2022-09-14 19:05:29 +08:00
/*
2020-12-26 01:42:23 +08:00
if ( $showsource || $showmedium || $showcodec || $showaudiocodec || $showstandard || $showprocessing ){
if ( $showsource ){
$source_select = torrent_selection ( $lang_edit [ 'text_source' ], " source_sel " , " sources " , $row [ " source " ]);
}
else $source_select = " " ;
if ( $showmedium ){
$medium_select = torrent_selection ( $lang_edit [ 'text_medium' ], " medium_sel " , " media " , $row [ " medium " ]);
}
else $medium_select = " " ;
if ( $showcodec ){
$codec_select = torrent_selection ( $lang_edit [ 'text_codec' ], " codec_sel " , " codecs " , $row [ " codec " ]);
}
else $codec_select = " " ;
if ( $showaudiocodec ){
$audiocodec_select = torrent_selection ( $lang_edit [ 'text_audio_codec' ], " audiocodec_sel " , " audiocodecs " , $row [ " audiocodec " ]);
}
else $audiocodec_select = " " ;
if ( $showstandard ){
$standard_select = torrent_selection ( $lang_edit [ 'text_standard' ], " standard_sel " , " standards " , $row [ " standard " ]);
}
else $standard_select = " " ;
if ( $showprocessing ){
$processing_select = torrent_selection ( $lang_edit [ 'text_processing' ], " processing_sel " , " processings " , $row [ " processing " ]);
}
else $processing_select = " " ;
tr ( $lang_edit [ 'row_quality' ], $source_select . $medium_select . $codec_select . $audiocodec_select . $standard_select . $processing_select , 1 );
}
if ( $showteam ){
if ( $showteam ){
$team_select = torrent_selection ( $lang_edit [ 'text_team' ], " team_sel " , " teams " , $row [ " team " ]);
}
else $showteam = " " ;
tr ( $lang_edit [ 'row_content' ], $team_select , 1 );
}
2022-09-14 19:05:29 +08:00
*/
2022-10-27 20:21:54 +08:00
$sectionCurrent = $searchBoxRep -> renderTaxonomySelect ( $sectionmode , $row );
tr ( $lang_edit [ 'row_quality' ], $sectionCurrent , 1 , " mode_ $sectionmode " );
2022-10-25 19:16:56 +08:00
echo $customField -> renderOnUploadPage ( $id , $sectionmode );
echo $hitAndRunRep -> renderOnUploadPage ( $row [ 'hr' ], $sectionmode );
2022-10-30 17:30:24 +08:00
tr ( $lang_functions [ 'text_tags' ], $tagRep -> renderCheckbox ( $sectionmode , $tagIdArr ), 1 , " mode_ $sectionmode " );
2022-09-14 19:05:29 +08:00
if ( $allowmove && $othermode ) {
2022-10-27 20:21:54 +08:00
$selectOther = $searchBoxRep -> renderTaxonomySelect ( $othermode , $row );
tr ( $lang_edit [ 'row_quality' ], $selectOther , 1 , " mode_ $othermode " );
2022-10-25 19:16:56 +08:00
echo $customField -> renderOnUploadPage ( $id , $othermode );
echo $hitAndRunRep -> renderOnUploadPage ( $row [ 'hr' ], $othermode );
2022-10-30 17:30:24 +08:00
tr ( $lang_functions [ 'text_tags' ], $tagRep -> renderCheckbox ( $othermode , $tagIdArr ), 1 , " mode_ $othermode " );
2022-09-14 19:05:29 +08:00
}
2022-06-14 01:07:05 +08:00
$rowChecks = [];
2022-08-20 19:11:28 +08:00
if ( user_can ( 'beanonymous' ) || user_can ( 'torrentmanage' )) {
2022-06-14 01:07:05 +08:00
$rowChecks [] = " <label><input type= \" checkbox \" name= \" anonymous \" " . ( $row [ " anonymous " ] == " yes " ? " checked= \" checked \" " : " " ) . " value= \" 1 \" /> " . $lang_edit [ 'checkbox_anonymous_note' ] . " </label> " ;
}
2022-08-20 19:11:28 +08:00
if ( user_can ( 'torrentmanage' )) {
2022-06-14 13:50:50 +08:00
array_unshift ( $rowChecks , " <label><input id='visible' type= \" checkbox \" name= \" visible \" " . ( $row [ " visible " ] == " yes " ? " checked= \" checked \" " : " " ) . " value= \" 1 \" /> " . $lang_edit [ 'checkbox_visible' ] . " </label> " );
2022-06-14 01:07:05 +08:00
}
if ( ! empty ( $rowChecks )) {
tr ( $lang_edit [ 'row_check' ], implode ( ' ' , $rowChecks ), 1 );
}
2022-08-20 19:11:28 +08:00
if ( user_can ( 'torrentsticky' ) || ( user_can ( 'torrentmanage' ) && $CURUSER [ " picker " ] == 'yes' )){
2021-05-26 20:56:03 +08:00
$pickcontent = $pickcontentPrefix = " " ;
2022-08-21 17:00:14 +08:00
if ( user_can ( 'torrentonpromotion' ))
2021-05-26 20:56:03 +08:00
{
$pickcontent .= " <b> " . $lang_edit [ 'row_special_torrent' ] . " : </b> " . " <select name= \" sel_spstate \" style= \" width: 100px; \" > " . promotion_selection ( $row [ " sp_state " ], 0 ) . " </select> " . '<select name="promotion_time_type" onchange="if (this.value == \'2\') {document.getElementById(\'promotion_until_note\').style.display = \'\';} else {document.getElementById(\'promotion_until_note\').style.display = \'none\';}"><option value="0"' . ( $row [ 'promotion_time_type' ] == 0 ? ' selected="selected"' : '' ) . '>' . $lang_edit [ 'select_use_global_setting' ] . '</option><option value="1"' . ( $row [ 'promotion_time_type' ] == 1 ? ' selected="selected"' : '' ) . '>' . $lang_edit [ 'select_forever' ] . '</option><option value="2"' . ( $row [ 'promotion_time_type' ] == 2 ? ' selected="selected"' : '' ) . '>' . $lang_edit [ 'select_until' ] . '</option></select><span id="promotion_until_note"' . ( $row [ 'promotion_time_type' ] == 2 ? '' : ' style="display: none;"' ) . '>' ;
$pickcontent .= '<input type="text" id="promotionuntiltime" name="promotionuntil" style="width: 120px;" value="' . ( $row [ 'promotion_until' ] > $row [ 'added' ] ? $row [ 'promotion_until' ] : '' ) . '" />' ;
$pickcontent .= ' (' . $lang_edit [ 'text_ie_for' ] . '<select name="promotionaddedtime" onchange="document.getElementById(\'promotionuntiltime\').value=this.value;"><option value="' . ( $row [ 'promotion_until' ] > $row [ 'added' ] ? $row [ 'promotion_until' ] : '' ) . '">' . $lang_edit [ 'text_keep_current' ] . '</option>' ;
foreach ( array ( 900 , 1800 , 3600 , 5400 , 7200 , 14400 , 21600 , 28800 , 43200 , 64800 , 86400 , 129600 , 259200 , 604800 , 1296000 , 2592000 , 7776000 , 15552000 , 31104000 ) as $seconds ) {
$pickcontent .= getAddedTimeOption ( strtotime ( $row [ 'added' ]), $seconds );
}
$pickcontent .= '</select>) ' . $lang_edit [ 'text_promotion_until_note' ] . '</span> ' ;
}
2022-08-20 19:11:28 +08:00
if ( user_can ( 'torrentsticky' ))
2020-12-26 01:42:23 +08:00
{
2021-05-26 20:56:03 +08:00
if ( $pickcontent ) {
$pickcontent .= " <br /> " ;
}
2021-06-01 01:28:46 +08:00
$options = [];
foreach ( \App\Models\Torrent :: listPosStates () as $key => $value ) {
$options [] = " <option " . (( $row [ " pos_state " ] == $key ) ? " selected= \" selected \" " : " " ) . " value= \" " . $key . " \" > " . $value [ 'text' ] . " </option> " ;
}
2022-09-17 18:55:26 +08:00
$pickcontent .= " <b> " . $lang_edit [ 'row_torrent_position' ] . " : </b> " . " <select name= \" pos_state \" style= \" width: 100px; \" > " . implode ( '' , $options ) . " </select> " ;
2022-12-20 22:24:31 +08:00
$pickcontent .= datetimepicker_input ( 'pos_state_until' , $row [ 'pos_state_until' ], nexus_trans ( 'label.deadline' ) . " : " , [ 'require_files' => true ]);
2020-12-26 01:42:23 +08:00
}
2022-08-20 19:11:28 +08:00
if ( user_can ( 'torrentmanage' ) && ( $CURUSER [ " picker " ] == 'yes' || get_user_class () >= \App\Models\User :: CLASS_SYSOP ))
2020-12-26 01:42:23 +08:00
{
2021-05-26 20:56:03 +08:00
if ( $pickcontent ) $pickcontent .= '<br />' ;
2020-12-26 01:42:23 +08:00
$pickcontent .= " <b> " . $lang_edit [ 'row_recommended_movie' ] . " : </b> " . " <select name= \" sel_recmovie \" style= \" width: 100px; \" > " .
" <option " . (( $row [ " picktype " ] == " normal " ) ? " selected= \" selected \" " : " " ) . " value= \" 0 \" > " . $lang_edit [ 'select_normal' ] . " </option> " .
" <option " . (( $row [ " picktype " ] == " hot " ) ? " selected= \" selected \" " : " " ) . " value= \" 1 \" > " . $lang_edit [ 'select_hot' ] . " </option> " .
" <option " . (( $row [ " picktype " ] == " classic " ) ? " selected= \" selected \" " : " " ) . " value= \" 2 \" > " . $lang_edit [ 'select_classic' ] . " </option> " .
" <option " . (( $row [ " picktype " ] == " recommended " ) ? " selected= \" selected \" " : " " ) . " value= \" 3 \" > " . $lang_edit [ 'select_recommended' ] . " </option> " .
" </select> " ;
}
tr ( $lang_edit [ 'row_pick' ], $pickcontent , 1 );
}
print ( " <tr><td class= \" toolbox \" colspan= \" 2 \" align= \" center \" ><input id= \" qr \" type= \" submit \" value= \" " . $lang_edit [ 'submit_edit_it' ] . " \" /> <input type= \" reset \" value= \" " . $lang_edit [ 'submit_revert_changes' ] . " \" /></td></tr> \n " );
print ( " </table> \n " );
print ( " </form> \n " );
2024-03-03 00:49:18 +08:00
if ( user_can ( 'torrent-delete' ) && user_can ( 'torrentmanage' )) {
2022-08-24 14:31:34 +08:00
print ( " <br /><br /> " );
print ( " <form method= \" post \" action= \" delete.php \" > \n " );
print ( " <input type= \" hidden \" name= \" id \" value= \" $id\ " /> \n " );
if ( isset ( $_GET [ " returnto " ]))
print ( " <input type= \" hidden \" name= \" returnto \" value= \" " . htmlspecialchars ( $_GET [ " returnto " ]) . " \" /> \n " );
print ( " <table border= \" 1 \" cellspacing= \" 0 \" cellpadding= \" 5 \" > \n " );
print ( " <tr><td class= \" colhead \" align= \" left \" style='padding-bottom: 3px' colspan= \" 2 \" > " . $lang_edit [ 'text_delete_torrent' ] . " </td></tr> " );
tr ( " <input name= \" reasontype \" type= \" radio \" value= \" 1 \" /> " . $lang_edit [ 'radio_dead' ], $lang_edit [ 'text_dead_note' ], 1 );
tr ( " <input name= \" reasontype \" type= \" radio \" value= \" 2 \" /> " . $lang_edit [ 'radio_dupe' ], " <input type= \" text \" style= \" width: 200px \" name= \" reason[] \" /> " , 1 );
tr ( " <input name= \" reasontype \" type= \" radio \" value= \" 3 \" /> " . $lang_edit [ 'radio_nuked' ], " <input type= \" text \" style= \" width: 200px \" name= \" reason[] \" /> " , 1 );
tr ( " <input name= \" reasontype \" type= \" radio \" value= \" 4 \" /> " . $lang_edit [ 'radio_rules' ], " <input type= \" text \" style= \" width: 200px \" name= \" reason[] \" /> " . $lang_edit [ 'text_req' ], 1 );
tr ( " <input name= \" reasontype \" type= \" radio \" value= \" 5 \" checked= \" checked \" /> " . $lang_edit [ 'radio_other' ], " <input type= \" text \" style= \" width: 200px \" name= \" reason[] \" /> " . $lang_edit [ 'text_req' ], 1 );
print ( " <tr><td class= \" toolbox \" colspan= \" 2 \" align= \" center \" ><input type= \" submit \" style='height: 25px' value= \" " . $lang_edit [ 'submit_delete_it' ] . " \" /></td></tr> \n " );
print ( " </table> " );
print ( " </form> \n " );
}
2021-05-26 20:56:03 +08:00
$json_sticky_series = json_encode ( array ( 4 , 6 , 12 , 24 , 36 , 48 , 72 , 168 , 360 ));
echo <<< EOT
< script >
jQuery ( function ( $ ){
var date_format = function ( date ) {
var seperator1 = " - " ;
var seperator2 = " : " ;
var month = date . getMonth () + 1 ;
var strDate = date . getDate ();
var strHour = date . getHours ();
var strMinute = date . getMinutes ();
var strSecond = date . getSeconds ();
if ( month >= 1 && month <= 9 ) {
month = " 0 " + month ;
}
if ( strDate >= 0 && strDate <= 9 ) {
strDate = " 0 " + strDate ;
}
if ( strHour >= 0 && strHour <= 9 ) strHour = " 0 " + strHour ;
if ( strMinute >= 0 && strMinute <= 9 ) strMinute = " 0 " + strMinute ;
if ( strSecond >= 0 && strSecond <= 9 ) strSecond = " 0 " + strSecond ;
return date . getFullYear () + seperator1 + month + seperator1 + strDate
+ " " + strHour + seperator2 + strMinute
+ seperator2 + strSecond ;
}
var pos_until_select = $ ( " #pos_until_select " );
var pos_until = $ ( " #pos_until " );
$ ( " #pos_group " ) . change ( function (){
if ( $ ( this ) . val () == 0 ){
pos_until . hide ();
pos_until_select . hide ();
} else {
pos_until . show ();
pos_until_select . show ();
}
}) . change ();
var series = $json_sticky_series ;
series . forEach ( function ( elem ){
var label = elem >= 72 ? parseInt ( parseInt ( elem ) / 24 ) + " { $lang_functions [ 'text_day' ] } " : elem + " { $lang_functions [ 'text_hour' ] } " ;
pos_until_select . append ( '<option value="' + elem + '">' + label + '</option>' );
});
pos_until_select . change ( function (){
var value = $ ( this ) . val ();
if ( value == - 1 ){
pos_until . val ( " 0000-00-00 00:00:00 " ) . attr ( " readonly " , true );
} else if ( value == 0 ){
pos_until . attr ( " readonly " , false );
} else if ( value > 0 ){
var curr = pos_until . val ();
var d = new Date ( Date . now () + 3600000 * value );
pos_until . attr ( " readonly " , true ) . val ( date_format ( d ));
}
}) . change ();
});
</ script >
EOT ;
2020-12-26 01:42:23 +08:00
}
2022-04-14 00:52:28 +08:00
\Nexus\Nexus :: js ( 'vendor/jquery-loading/jquery.loading.min.js' , 'footer' , true );
\Nexus\Nexus :: js ( 'js/ptgen.js' , 'footer' , true );
2022-09-19 16:27:04 +08:00
$customFieldJs = <<< JS
jQuery ( " #movecheck " ) . on ( " change " , function () {
let _this = jQuery ( this );
let checked = _this . prop ( " checked " );
let activeSelect
if ( checked ) {
activeSelect = jQuery ( " #newcat " );
} else {
activeSelect = jQuery ( " #oricat " );
}
let mode = activeSelect . attr ( " data-mode " );
console . log ( mode )
jQuery ( " tr[relation] " ) . hide ();
jQuery ( " tr[relation=mode_ " + mode + " ] " ) . show ();
})
jQuery ( " tr[relation] " ) . hide ();
jQuery ( " tr[relation=mode_ { $sectionmode } ] " ) . show ();
JS ;
\Nexus\Nexus :: js ( $customFieldJs , 'footer' , false );
2020-12-26 01:42:23 +08:00
stdfoot ();
2021-05-26 20:56:03 +08:00
function getAddedTimeOption ( $timeStamp , $addSeconds ) {
$timeStamp += $addSeconds ;
$timeString = date ( " Y-m-d H:i:s " , $timeStamp );
return '<option value="' . $timeString . '">' . mkprettytime ( $addSeconds ) . '</option>' ;
}