improve userdetails page claim btn display

This commit is contained in:
xiaomlove
2022-09-06 20:56:08 +08:00
parent fb329f72cc
commit 0e7b5adf76
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<?php
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('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -11,6 +11,7 @@ header("Pragma: no-cache" );
$torrentRep = new \App\Repositories\TorrentRepository();
$claimRep = new \App\Repositories\ClaimRepository();
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
$id = intval($_GET['userid'] ?? 0);
$type = $_GET['type'];
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')
{
global $lang_getusertorrentlistajax,$CURUSER,$smalldescription_main, $lang_functions, $id;
global $torrentRep, $claimRep;
global $torrentRep, $claimRep, $claimTorrentTTL;
$showActionClaim = false;
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>";
if ($showanonymous)
$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']);
$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";
}