Merge branch 'php8' into section

This commit is contained in:
xiaomlove
2022-09-07 03:28:18 +08:00
9 changed files with 17 additions and 6 deletions
+2
View File
@@ -25,6 +25,7 @@ class SearchBox extends NexusModel
const EXTRA_TAXONOMY_LABELS = 'taxonomy_labels'; const EXTRA_TAXONOMY_LABELS = 'taxonomy_labels';
const EXTRA_DISPLAY_COVER_ON_TORRENT_LIST = 'display_cover_on_torrent_list'; const EXTRA_DISPLAY_COVER_ON_TORRENT_LIST = 'display_cover_on_torrent_list';
const EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST = 'display_seed_box_icon_on_torrent_list';
public static array $subCatFields = [ public static array $subCatFields = [
'source', 'medium', 'codec', 'audiocodec', 'team', 'standard', 'processing' 'source', 'medium', 'codec', 'audiocodec', 'team', 'standard', 'processing'
@@ -32,6 +33,7 @@ class SearchBox extends NexusModel
public static array $extras = [ public static array $extras = [
self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => ['text' => 'Display cover on torrent list'], self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => ['text' => 'Display cover on torrent list'],
self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => ['text' => 'Display seed box icon on torrent list'],
]; ];
public static function listExtraText(): array public static function listExtraText(): array
+1 -1
View File
@@ -617,7 +617,7 @@ class TorrentRepository extends BaseRepository
$input = <<<HTML $input = <<<HTML
<div class="nexus-input-box" style="display: flex"> <div class="nexus-input-box" style="display: flex">
<div style="display: flex;flex-direction: column;flex-grow: 1"> <div style="display: flex;flex-direction: column;flex-grow: 1">
<input type="text" name="$name" value="{$value}"> <input type="text" id="$name" name="$name" value="{$value}">
$note $note
</div> </div>
$btn $btn
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.24'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.24');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-09-05'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-09-06');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+4 -1
View File
@@ -3320,14 +3320,17 @@ function torrenttable($rows, $variant = "torrent", $searchBoxId = 0) {
$tagKeyById = $tagCollection->keyBy('id'); $tagKeyById = $tagCollection->keyBy('id');
$torrentTagResult = $torrentTagCollection->groupBy('torrent_id'); $torrentTagResult = $torrentTagCollection->groupBy('torrent_id');
$showCover = false; $showCover = false;
$showSeedBoxIcon = get_setting('seed_box.enabled') == 'yes';
if ($searchBoxId) { if ($searchBoxId) {
$searchBoxExtra = get_searchbox_value($searchBoxId, "extra"); $searchBoxExtra = get_searchbox_value($searchBoxId, "extra");
if (!empty($searchBoxExtra[\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST])) { if (!empty($searchBoxExtra[\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST])) {
$showCover = true; $showCover = true;
} }
if (empty($searchBoxExtra[\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST])) {
$showSeedBoxIcon = false;
}
} }
//seedBoxIcon //seedBoxIcon
$showSeedBoxIcon = get_setting('seed_box.enabled') == 'yes';
if ($showSeedBoxIcon) { if ($showSeedBoxIcon) {
$seedBoxRep = new \App\Repositories\SeedBoxRepository(); $seedBoxRep = new \App\Repositories\SeedBoxRepository();
$ownerPeerInfo = \App\Models\Peer::query() $ownerPeerInfo = \App\Models\Peer::query()
+1
View File
@@ -250,6 +250,7 @@ class Update extends Install
$this->runMigrate('database/migrations/2022_09_02_031539_add_extra_to_searchbox_table.php'); $this->runMigrate('database/migrations/2022_09_02_031539_add_extra_to_searchbox_table.php');
SearchBox::query()->update(['extra' => [ SearchBox::query()->update(['extra' => [
SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 1, SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 1,
SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => 1,
]]); ]]);
} }
+5 -3
View File
@@ -11,6 +11,7 @@ header("Pragma: no-cache" );
$torrentRep = new \App\Repositories\TorrentRepository(); $torrentRep = new \App\Repositories\TorrentRepository();
$claimRep = new \App\Repositories\ClaimRepository(); $claimRep = new \App\Repositories\ClaimRepository();
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
$id = intval($_GET['userid'] ?? 0); $id = intval($_GET['userid'] ?? 0);
$type = $_GET['type']; $type = $_GET['type'];
if (!in_array($type,array('uploaded','seeding','leeching','completed','incomplete'))) if (!in_array($type,array('uploaded','seeding','leeching','completed','incomplete')))
@@ -21,7 +22,7 @@ if(!user_can('torrenthistory') && $id != $CURUSER["id"])
function maketable($res, $mode = 'seeding') function maketable($res, $mode = 'seeding')
{ {
global $lang_getusertorrentlistajax,$CURUSER,$smalldescription_main, $lang_functions, $id; global $lang_getusertorrentlistajax,$CURUSER,$smalldescription_main, $lang_functions, $id;
global $torrentRep, $claimRep; global $torrentRep, $claimRep, $claimTorrentTTL;
$showActionClaim = false; $showActionClaim = false;
switch ($mode) switch ($mode)
{ {
@@ -213,11 +214,12 @@ function maketable($res, $mode = 'seeding')
$ret .= "<td class=\"rowfollow\" align=\"center\">"."". str_replace("&nbsp;", "<br />", gettime($arr['completedat'],false)). "</td>"; $ret .= "<td class=\"rowfollow\" align=\"center\">"."". str_replace("&nbsp;", "<br />", gettime($arr['completedat'],false)). "</td>";
if ($showanonymous) if ($showanonymous)
$ret .= "<td class=\"rowfollow\" align=\"center\">".$arr['anonymous']."</td>"; $ret .= "<td class=\"rowfollow\" align=\"center\">".$arr['anonymous']."</td>";
if ($showActionClaim) { $claimButton = '';
if ($showActionClaim && \App\Models\Claim::getConfigIsEnabled() && \Carbon\Carbon::parse($arr['added'])->addDays($claimTorrentTTL)->lte(\Carbon\Carbon::now())) {
$claim = $claimData->get($arr['torrent']); $claim = $claimData->get($arr['torrent']);
$claimButton = $claimRep->buildActionButtons($arr['torrent'], $claim); $claimButton = $claimRep->buildActionButtons($arr['torrent'], $claim);
$ret .= sprintf('<td class="rowfollow" align="center">%s</td>', $claimButton);
} }
$ret .= sprintf('<td class="rowfollow" align="center">%s</td>', $claimButton);
$ret .="</tr>\n"; $ret .="</tr>\n";
} }
+1
View File
@@ -11,5 +11,6 @@ return [
'sub_category_audio_codec_label' => 'AudioCodec', 'sub_category_audio_codec_label' => 'AudioCodec',
'extras' => [ 'extras' => [
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 'Display cover on torrent list', \App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 'Display cover on torrent list',
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => 'Display seed box icon on torrent list',
], ],
]; ];
+1
View File
@@ -11,5 +11,6 @@ return [
'sub_category_audio_codec_label' => '音频编码', 'sub_category_audio_codec_label' => '音频编码',
'extras' => [ 'extras' => [
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '种子列表页展示封面', \App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '种子列表页展示封面',
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => '种子列表页展示 SeedBox 图标',
], ],
]; ];
+1
View File
@@ -11,5 +11,6 @@ return [
'sub_category_audio_codec_label' => '音頻編碼', 'sub_category_audio_codec_label' => '音頻編碼',
'extras' => [ 'extras' => [
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '種子列表頁展示封面', \App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '種子列表頁展示封面',
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => '種子列表頁展示 SeedBox 圖標',
], ],
]; ];