mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
improve userdetails page claim btn display
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
@@ -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(" ", "<br />", gettime($arr['completedat'],false)). "</td>";
|
$ret .= "<td class=\"rowfollow\" align=\"center\">"."". str_replace(" ", "<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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user