diff --git a/app/Repositories/TorrentRepository.php b/app/Repositories/TorrentRepository.php
index 8b619243..12b9676c 100644
--- a/app/Repositories/TorrentRepository.php
+++ b/app/Repositories/TorrentRepository.php
@@ -605,4 +605,25 @@ class TorrentRepository extends BaseRepository
return Torrent::query()->whereIn('id', $idArr)->update(['pos_state' => $posState]);
}
+ public function buildUploadFieldInput($name, $value, $noteText, $btnText): string
+ {
+ $btn = $note = '';
+ if ($btnText) {
+ $btn = '
';
+ }
+ if ($noteText) {
+ $note = ''.$noteText.'';
+ }
+ $input = <<
+
+
+ $note
+
+ $btn
+
+HTML;
+ return $input;
+ }
+
}
diff --git a/include/constants.php b/include/constants.php
index d4690a2a..e1d5ff46 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -1,6 +1,6 @@
" . number_format($row["times_completed"]) . "\n");
- if ($row["anonymous"] == "yes" && user_can('torrentmanage'))
- {
+ if (
+ $row["anonymous"] == "yes"
+ && (user_can('torrentmanage') || (isset($row['owner']) && $row['owner'] == $CURUSER['id']))
+ ) {
print("".$lang_functions['text_anonymous']." ".(isset($row["owner"]) ? "(" . get_username($row["owner"]) .")" : "".$lang_functions['text_orphaned']."") . " | \n");
}
elseif ($row["anonymous"] == "yes")
diff --git a/lang/chs/lang_edit.php b/lang/chs/lang_edit.php
index 1b23c009..e77b5351 100644
--- a/lang/chs/lang_edit.php
+++ b/lang/chs/lang_edit.php
@@ -68,6 +68,7 @@ $lang_edit = array
'text_audio_codec' => "音频编码",
'row_content' => "内容",
'ban_reason_label' => '原因',
+ 'fill_quality' => '填写质量',
);
?>
diff --git a/lang/chs/lang_upload.php b/lang/chs/lang_upload.php
index 0532d65a..773cc5af 100644
--- a/lang/chs/lang_upload.php
+++ b/lang/chs/lang_upload.php
@@ -40,6 +40,7 @@ $lang_upload = array
'text_chinese_title' => "中文名:",
'text_english_title' => "英文名:",
'text_titles_note' => "(如果英文名不存在,使用拼音或不填写)",
+ 'fill_quality' => '填写质量',
);
?>
diff --git a/lang/cht/lang_edit.php b/lang/cht/lang_edit.php
index affeb331..667648f3 100644
--- a/lang/cht/lang_edit.php
+++ b/lang/cht/lang_edit.php
@@ -68,6 +68,7 @@ $lang_edit = array
'text_audio_codec' => "音頻編碼",
'row_content' => "內容",
'ban_reason_label' => '原因',
+ 'fill_quality' => '填寫質量',
);
?>
diff --git a/lang/cht/lang_upload.php b/lang/cht/lang_upload.php
index 40efdabd..705d00ca 100644
--- a/lang/cht/lang_upload.php
+++ b/lang/cht/lang_upload.php
@@ -40,6 +40,7 @@ $lang_upload = array
'text_chinese_title' => "中文名:",
'text_english_title' => "英文名:",
'text_titles_note' => "(如果英文名不存在,請使用拼音或不填寫)",
+ 'fill_quality' => '填寫質量',
);
?>
diff --git a/lang/en/lang_edit.php b/lang/en/lang_edit.php
index 4f1177ea..8f4607d6 100644
--- a/lang/en/lang_edit.php
+++ b/lang/en/lang_edit.php
@@ -68,6 +68,7 @@ $lang_edit = array
'text_audio_codec' => "Audio Codec",
'row_content' => "Content",
'ban_reason_label' => 'Reason',
+ 'fill_quality' => 'Fill quality',
);
?>
diff --git a/lang/en/lang_upload.php b/lang/en/lang_upload.php
index d0dc1bef..341b9f8f 100644
--- a/lang/en/lang_upload.php
+++ b/lang/en/lang_upload.php
@@ -40,6 +40,7 @@ $lang_upload = array
'text_chinese_title' => "Chinese Name:",
'text_english_title' => "English Name:",
'text_titles_note' => "(If no English Name exists, use pinyin or leave it blank)",
+ 'fill_quality' => 'Fill quality',
);
?>
diff --git a/public/getusertorrentlistajax.php b/public/getusertorrentlistajax.php
index d0a9adae..1fc617ab 100644
--- a/public/getusertorrentlistajax.php
+++ b/public/getusertorrentlistajax.php
@@ -226,7 +226,7 @@ switch ($type)
case 'seeding':
{
// $res = sql_query("SELECT torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='yes' ORDER BY torrents.id DESC") or sqlerr();
- $fields = "torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers";
+ $fields = "torrent,added,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers,snatched.seedtime,snatched.uploaded";
$tableWhere = "peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='yes'";
$order = "torrents.id DESC";
break;
@@ -236,7 +236,7 @@ switch ($type)
case 'leeching':
{
// $res = sql_query("SELECT torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='no' ORDER BY torrents.id DESC") or sqlerr();
- $fields = "torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added";
+ $fields = "torrent,snatched.uploaded,snatched.downloaded,torrents.name as torrentname, torrents.small_descr, torrents.sp_state, torrents.banned, torrents.approval_status, categories.name as catname,size,torrents.hr,image,category,seeders,leechers, torrents.added,snatched.seedtime,snatched.uploaded";
$tableWhere = "peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN snatched ON torrents.id = snatched.torrentid WHERE peers.userid=$id AND snatched.userid = $id AND peers.seeder='no'";
$order = "torrents.id DESC";
break;
@@ -246,7 +246,7 @@ switch ($type)
case 'completed':
{
// $res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime, snatched.leechtime, snatched.completedat FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='yes' AND torrents.owner != $id AND userid=$id ORDER BY snatched.id DESC") or sqlerr();
- $fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime, snatched.leechtime, snatched.completedat";
+ $fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, torrents.banned, torrents.approval_status, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.seedtime,snatched.uploaded, snatched.leechtime, snatched.completedat";
$tableWhere = "torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='yes' AND userid=$id AND torrents.owner != $id";
$order = "snatched.id DESC";
break;
@@ -256,7 +256,7 @@ switch ($type)
case 'incomplete':
{
$res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='no' AND userid=$id AND torrents.owner != $id ORDER BY snatched.id DESC") or sqlerr();
- $fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime";
+ $fields = "torrents.id AS torrent, torrents.name AS torrentname, small_descr, torrents.banned, torrents.approval_status, categories.name AS catname, categories.image, category, sp_state, size, torrents.hr, torrents.added,snatched.uploaded, snatched.downloaded, snatched.leechtime,snatched.seedtime,snatched.uploaded";
$tableWhere = "torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='no' AND userid=$id AND torrents.owner != $id";
$order = "snatched.id DESC";
break;
diff --git a/public/js/ptgen.js b/public/js/ptgen.js
index 15da033e..798db0da 100644
--- a/public/js/ptgen.js
+++ b/public/js/ptgen.js
@@ -27,3 +27,47 @@ jQuery('.btn-get-pt-gen').on('click', function () {
}
}, 'json')
})
+
+
+function autoSelect(value) {
+ // console.log(`autoSelect: ${value}`)
+ let names = ["source_sel", "medium_sel", "codec_sel", "audiocodec_sel", "standard_sel", "processing_sel", "team_sel"];
+ for (let i = 0; i < names.length; i++) {
+ const name = names[i];
+ const select = jQuery("select[name="+name+"]")
+ // console.log("check name: " + name)
+ select.children("option").each(function (index, option) {
+ let _option = jQuery(option)
+ let optionText = _option.text();
+ // console.log("check option text: " + optionText + " match value: " + value)
+ let pattern = new RegExp(value, "i");
+ if (optionText.match(pattern)) {
+ console.log(`name: ${name}, optionText: ${optionText} match value: ${value}, break`)
+ select.val(option.getAttribute('value'))
+ return false
+ }
+ })
+ }
+}
+jQuery("#compose").on("click", ".nexus-action-btn",function () {
+ let box = jQuery(this).closest(".nexus-input-box")
+ let inputValue = box.find("[name=name]").val();
+ if (inputValue.trim() == '') {
+ return
+ }
+ let parts = inputValue.split(/[\s]+/i)
+ let count = parts.length;
+ for (let i = 0; i < count; i++) {
+ if (i < count - 1) {
+ autoSelect(parts[i])
+ } else {
+ let arr = parts[i].split("-")
+ if (arr[0]) {
+ autoSelect(arr[0])
+ }
+ if (arr[1]) {
+ autoSelect(arr[1])
+ }
+ }
+ }
+})
diff --git a/public/upload.php b/public/upload.php
index 60d23050..3ad21b07 100644
--- a/public/upload.php
+++ b/public/upload.php
@@ -20,6 +20,7 @@ if ($enableoffer == 'yes') {
$has_allowed_offer = false;
}
$uploadfreely = user_can_upload("torrents");
+do_log("uploadfreely: $uploadfreely, has_allowed_offer: $has_allowed_offer");
$allowtorrents = ($has_allowed_offer || $uploadfreely);
$allowspecial = user_can_upload("music");
@@ -38,7 +39,7 @@ $showteam = (($allowtorrents && get_searchbox_value($brsectiontype, 'showteam'))
$showaudiocodec = (($allowtorrents && get_searchbox_value($brsectiontype, 'showaudiocodec')) || ($allowspecial && get_searchbox_value($spsectiontype, 'showaudiocodec'))); //whether show languages or not
$settingMain = get_setting('main');
-
+$torrentRep = new \App\Repositories\TorrentRepository();
stdhead($lang_upload['head_upload']);
?>