mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 06:57:22 +08:00
change torrent pos_state to varchar, support more sticky level
This commit is contained in:
+1
-1
@@ -127,7 +127,7 @@ if (!$row) {
|
||||
else $download = "";
|
||||
|
||||
tr($lang_details['row_action'], $download. ($owned == 1 ? "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" /> <b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a> | " : ""). (get_user_class() >= $askreseed_class && $row['seeders'] == 0 ? "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\"> <b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a> | " : "") . "<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" /> <b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>", 1);
|
||||
tr($lang_details['torrent_dl_url'],sprintf('<b title="%s">%s/download.php?id=%u&passkey=%s</b>',$lang_details['torrent_dl_url_notice'], getSchemeAndHttpHost(),$id,$CURUSER['passkey']), 1);
|
||||
tr($lang_details['torrent_dl_url'],sprintf('<a title="%s" href="%s/download.php?id=%u&passkey=%s">%s</a>',$lang_details['torrent_dl_url_notice'],getSchemeAndHttpHost(),$id,$CURUSER['passkey'], $lang_details['torrent_dl_url_text']),1);
|
||||
|
||||
// ---------------- start subtitle block -------------------//
|
||||
$r = sql_query("SELECT subs.*, language.flagpic, language.lang_name FROM subs LEFT JOIN language ON subs.lang_id=language.id WHERE torrent_id = " . sqlesc($row["id"]). " ORDER BY subs.lang_id ASC") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
+5
-4
@@ -165,10 +165,11 @@ else {
|
||||
if ($pickcontent) {
|
||||
$pickcontent .= "<br />";
|
||||
}
|
||||
$pickcontent .= "<b>".$lang_edit['row_torrent_position'].": </b>"."<select name=\"sel_posstate\" style=\"width: 100px;\">" .
|
||||
"<option" . (($row["pos_state"] == "normal") ? " selected=\"selected\"" : "" ) . " value=\"0\">".$lang_edit['select_normal']."</option>" .
|
||||
"<option" . (($row["pos_state"] == "sticky") ? " selected=\"selected\"" : "" ) . " value=\"1\">".$lang_edit['select_sticky']."</option>" .
|
||||
"</select> ";
|
||||
$options = [];
|
||||
foreach (\App\Models\Torrent::listPosStates() as $key => $value) {
|
||||
$options[] = "<option" . (($row["pos_state"] == $key) ? " selected=\"selected\"" : "" ) . " value=\"" . $key . "\">".$value['text']."</option>";
|
||||
}
|
||||
$pickcontent .= "<b>".$lang_edit['row_torrent_position'].": </b>"."<select name=\"sel_posstate\" style=\"width: 100px;\">" . implode('', $options) . "</select> ";
|
||||
}
|
||||
if(get_user_class()>=$torrentmanage_class && $CURUSER["picker"] == 'yes')
|
||||
{
|
||||
|
||||
+2
-5
@@ -147,12 +147,9 @@ if(get_user_class()>=$torrentonpromotion_class)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(get_user_class()>=$torrentsticky_class)
|
||||
if(get_user_class()>=$torrentsticky_class && isset($_POST['sel_posstate']) && isset(\App\Models\Torrent::$posStates[$_POST['sel_posstate']]))
|
||||
{
|
||||
if(intval($_POST["sel_posstate"] ?? 0) == 0)
|
||||
$updateset[] = "pos_state = 'normal'";
|
||||
elseif(intval($_POST["sel_posstate"] ?? 0) == 1)
|
||||
$updateset[] = "pos_state = 'sticky'";
|
||||
$updateset[] = "pos_state = '" . $_POST['sel_posstate'] . "'";
|
||||
}
|
||||
|
||||
$pick_info = "";
|
||||
|
||||
Reference in New Issue
Block a user