Skip to content

Commit

Permalink
置顶处理
Browse files Browse the repository at this point in the history
  • Loading branch information
nova2018 committed May 18, 2019
1 parent 50de7e1 commit 018e612
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
10 changes: 9 additions & 1 deletion details.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,15 @@
}
$pickcontent .= '<label id="sp-expire"><b>促销截止:&nbsp;</b><input type="text" name="promotionuntil" id="promotionuntil" value="' . (($row ["promotion_time_type"] == 0) ? $promotionuntil_time : $row ["promotion_until"]) . '" /></label>&nbsp;&nbsp;&nbsp;';
$pickcontent .= '</br>';
$pickcontent .= "<b>" . $lang_pickup ['row_torrent_position'] . ":&nbsp;</b>" . "<select name=\"sel_posstate\" style=\"width: 100px;\">" . "<option" . (($row ["pos_state"] == "normal") ? " selected=\"selected\"" : "") . " value=\"0\">" . $lang_pickup ['select_normal'] . "</option>" . "<option" . (($row ["pos_state"] == "sticky") ? " selected=\"selected\"" : "") . " value=\"1\">" . $lang_pickup ['select_sticky'] . "</option>" . "</select>&nbsp;&nbsp;&nbsp;";
// 置顶处理 beg
$pickcontent .= "<b>" . $lang_pickup ['row_torrent_position'] . ":&nbsp;</b>";
$pickcontent .= "<select name=\"sel_posstate\" style=\"width: 100px;\">";
$pickcontent .= "<option" . (($row ["pos_state"] == "normal") ? " selected=\"selected\"" : "") . " value=\"0\">" . $lang_pickup ['select_normal'] . "</option>";
$pickcontent .= "<option" . (($row ["pos_state"] == "sticky") ? " selected=\"selected\"" : "") . " value=\"1\">" . $lang_pickup ['select_sticky'] . "</option>";
$pickcontent .= "<option" . (($row ["pos_state"] == "double_sticky") ? " selected=\"selected\"" : "") . " value=\"2\">" . $lang_pickup ['select_double_sticky'] . "</option>";
$pickcontent .= "<option" . (($row ["pos_state"] == "triple_sticky") ? " selected=\"selected\"" : "") . " value=\"3\">" . $lang_pickup ['select_triple_sticky'] . "</option>";
$pickcontent .= "</select>&nbsp;&nbsp;&nbsp;";
// 置顶处理 end
$pickcontent .= '<label id="pos-expire"><b>置顶截止:&nbsp;</b><input type="text" name="posstateuntil" id="posstateuntil" value="' . (($row ["pos_state"] != "sticky") ? date("Y-m-d H:i:s", time() + 2 * 24 * 3600) : $row ["pos_state_until"]) . '" /></label>&nbsp;&nbsp;&nbsp;';

$pickcontent .= "<b>" . $lang_pickup ['row_recommended_movie'] . ":&nbsp;</b>" . "<select name=\"sel_recmovie\" style=\"width: 100px;\">" . "<option" . (($row ["picktype"] == "normal") ? " selected=\"selected\"" : "") . " value=\"0\">" . $lang_pickup ['select_normal'] . "</option>" . "<option" . (($row ["picktype"] == "hot") ? " selected=\"selected\"" : "") . " value=\"1\">" . $lang_pickup ['select_hot'] . "</option>" . "<option" . (($row ["picktype"] == "classic") ? " selected=\"selected\"" : "") . " value=\"2\">" . $lang_pickup ['select_classic'] . "</option>" . "<option" . (($row ["picktype"] == "recommended") ? " selected=\"selected\"" : "") . " value=\"3\">" . $lang_pickup ['select_recommended'] . "</option>" . "<option" . (($row ["picktype"] == "0day") ? " selected=\"selected\"" : "") . " value=\"4\">0day</option>" . "<option" . (($row ["picktype"] == "IMDB") ? " selected=\"selected\"" : "") . " value=\"5\">IMDB TOP 250</option>" . "</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . "<a href=\"JAVAscript:document.pickup.submit();\"><b>" . $lang_pickup ['submit_edit_it'] . "</b></a>" . "</form>\n";
Expand Down
2 changes: 2 additions & 0 deletions lang/chs/lang_pickup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
'select_classic' => "经典",
'select_recommended' => "推荐",
'select_sticky' => "置顶",
'select_double_sticky' => '二级置顶',
'select_triple_sticky' => '三级置顶',
'submit_edit_it' => "确认设置",
'submit_revert_changes' => "重置",
'row_pick' => "设置促销",
Expand Down
20 changes: 20 additions & 0 deletions pickup.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,26 @@ function bark($msg)
$updateset [] = "pos_state = 'normal'";
$updateset [] = "pos_state_until = '0000-00-00 00:00:00'";
}
}elseif ((0 + $_POST ["sel_posstate"]) == 2) {
if ($_POST ["posstateuntil"] && strtotime($torrentAddedTimeString) <= strtotime($_POST ["posstateuntil"])) {
$updateset [] = "pos_state = 'double_sticky'";
$updateset [] = "pos_state_until = " . sqlesc($_POST ["posstateuntil"]);
if ($row ["pos_state"] != 'sticky')
$posstate = "二级置顶 ";
} else {
$updateset [] = "pos_state = 'normal'";
$updateset [] = "pos_state_until = '0000-00-00 00:00:00'";
}
}elseif ((0 + $_POST ["sel_posstate"]) == 3) {
if ($_POST ["posstateuntil"] && strtotime($torrentAddedTimeString) <= strtotime($_POST ["posstateuntil"])) {
$updateset [] = "pos_state = 'triple_sticky'";
$updateset [] = "pos_state_until = " . sqlesc($_POST ["posstateuntil"]);
if ($row ["pos_state"] != 'sticky')
$posstate = "三级置顶 ";
} else {
$updateset [] = "pos_state = 'normal'";
$updateset [] = "pos_state_until = '0000-00-00 00:00:00'";
}
}
}

Expand Down

0 comments on commit 018e612

Please sign in to comment.