torrents list show seedbox icon

This commit is contained in:
xiaomlove
2022-09-02 19:49:41 +08:00
parent 17b225424e
commit 875e8ea797
19 changed files with 180 additions and 39 deletions
+16
View File
@@ -217,6 +217,9 @@ function print_category_editor($type, $row='')
$showaudiocodec = $row['showaudiocodec'];
$catsperrow = $row['catsperrow'];
$catpadding = $row['catpadding'];
if (!empty($row['extra'])) {
$row['extra'] = json_decode($row['extra'], true);
}
}
else
{
@@ -233,6 +236,17 @@ function print_category_editor($type, $row='')
}
tr($lang_catmanage['row_searchbox_name']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"name\" value=\"".htmlspecialchars($name)."\" style=\"width: 300px\" /> " . $lang_catmanage['text_searchbox_name_note'], 1);
tr($lang_catmanage['row_show_sub_category'], "<input type=\"checkbox\" name=\"showsource\" value=\"1\"".($showsource ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_sources'] . "<input type=\"checkbox\" name=\"showmedium\" value=\"1\"".($showmedium ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_media'] . "<input type=\"checkbox\" name=\"showcodec\" value=\"1\"".($showcodec ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_codecs'] . "<input type=\"checkbox\" name=\"showstandard\" value=\"1\"".($showstandard ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_standards'] . "<input type=\"checkbox\" name=\"showprocessing\" value=\"1\"".($showprocessing ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_processings'] . "<input type=\"checkbox\" name=\"showteam\" value=\"1\"".($showteam ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_teams'] . "<input type=\"checkbox\" name=\"showaudiocodec\" value=\"1\"".($showaudiocodec ? " checked=\"checked\"" : "")." /> " . $lang_catmanage['text_audio_codecs']."<br />".$lang_catmanage['text_show_sub_category_note'], 1);
//extra
$extraCheckbox = "";
foreach (\App\Models\SearchBox::listExtraText() as $name => $text) {
$extraCheckbox .= sprintf(
'<label><input type="checkbox" name="extra[%s]" value="1"%s />%s</label>',
$name, !empty($row['extra'][$name]) ? ' checked' : '', $text
);
}
tr($lang_catmanage['row_searchbox_extras'], $extraCheckbox, 1);
tr($lang_catmanage['row_items_per_row']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catsperrow\" value=\"".$catsperrow."\" style=\"width: 100px\" /> " . $lang_catmanage['text_items_per_row_note'], 1);
tr($lang_catmanage['row_padding_between_items']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catpadding\" value=\"".$catpadding."\" style=\"width: 100px\" /> " . $lang_catmanage['text_padding_between_items_note'], 1);
$field = new \Nexus\Field\Field();
@@ -715,6 +729,8 @@ elseif($action == 'submit')
$updateset[] = "custom_fields=" . sqlesc(implode(',', $_POST['custom_fields'] ?? []));
$updateset[] = "custom_fields_display_name=" . sqlesc($_POST['custom_fields_display_name'] ?? '');
$updateset[] = "custom_fields_display=" . sqlesc($_POST['custom_fields_display'] ?? '');
$updateset[] = "extra=" . sqlesc(json_encode($_POST['extra'] ?? []));
if ($showsource || $showmedium || $showcodec || $showstandard || $showprocessing || $showteam || $showaudiocodec)
$updateset[] = "showsubcat=1";
else
+10 -3
View File
@@ -221,7 +221,13 @@ JS;
tr($lang_details['torrent_dl_url'],sprintf('<a title="%s" href="%s/download.php?downhash=%s|%s">%s</a>',$lang_details['torrent_dl_url_notice'], getSchemeAndHttpHost(), $CURUSER['id'], $torrentRep->encryptDownHash($row['id'], $CURUSER), $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__);
$subTorrentIdArr = [$row['id']];
$otherCopiesIdArr = [];
if ($imdb_id) {
$otherCopiesIdArr = \App\Models\Torrent::query()->where('url', $imdb_id)->where('id', '!=', $row['id'])->pluck('id')->toArray();
$subTorrentIdArr = array_merge($subTorrentIdArr, $otherCopiesIdArr);
}
$r = sql_query("SELECT subs.*, language.flagpic, language.lang_name FROM subs LEFT JOIN language ON subs.lang_id=language.id WHERE torrent_id in(" . implode(',', $subTorrentIdArr). ") ORDER BY subs.lang_id ASC") or sqlerr(__FILE__, __LINE__);
print("<tr><td class=\"rowhead\" valign=\"top\">".$lang_details['row_subtitles']."</td>");
print("<td class=\"rowfollow\" align=\"left\" valign=\"top\">");
print("<table border=\"0\" cellspacing=\"0\">");
@@ -366,9 +372,10 @@ JS;
$ptGen = new \Nexus\PTGen\PTGen();
$ptGen->updateTorrentPtGen($row);
}
if ($imdb_id)
if (!empty($otherCopiesIdArr))
{
$where_area = " url = " . sqlesc((int)$imdb_id) ." AND torrents.id != ".sqlesc($id);
// $where_area = " url = " . sqlesc((int)$imdb_id) ." AND torrents.id != ".sqlesc($id);
$where_area = sprintf('torrents.id in (%s)', implode(',', $otherCopiesIdArr));
$copies_res = sql_query("SELECT torrents.id, torrents.name, torrents.sp_state, torrents.size, torrents.added, torrents.seeders, torrents.leechers, torrents.hr,categories.id AS catid, categories.name AS catname, categories.image AS catimage, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name FROM torrents LEFT JOIN categories ON torrents.category=categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id WHERE " . $where_area . " ORDER BY torrents.id DESC") or sqlerr(__FILE__, __LINE__);
$copies_count = mysql_num_rows($copies_res);
+1 -1
View File
@@ -46,7 +46,7 @@ function maketable($res, $mode = 'seeding')
$showuploaded = true;
$showdownloaded = true;
$showratio = true;
$showsetime = false;
$showsetime = true;
$showletime = false;
$showcotime = false;
$showanonymous = false;
+3 -3
View File
@@ -1187,10 +1187,10 @@ if ($count) {
$rows = apply_filter('torrent_list', $rows, $page, $sectiontype);
print($pagertop);
if ($sectiontype == $browsecatmode)
torrenttable($rows, "torrents");
torrenttable($rows, "torrents", $sectiontype);
elseif ($sectiontype == $specialcatmode)
torrenttable($rows, "music");
else torrenttable($rows, "bookmarks");
torrenttable($rows, "music", $sectiontype);
else torrenttable($rows, "bookmarks", $sectiontype);
print($pagerbottom);
}
else {