improve claim settle

This commit is contained in:
xiaomlove
2022-05-06 15:50:26 +08:00
parent c23cc1b441
commit f64834b594
18 changed files with 124 additions and 69 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ if (!$row) {
// ------------- start claim block ------------------//
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
if (\Carbon\Carbon::parse($row['added'])->addDays($claimTorrentTTL)->lte(\Carbon\Carbon::now())) {
if (\App\Models\Claim::getConfigIsEnabled() && \Carbon\Carbon::parse($row['added'])->addDays($claimTorrentTTL)->lte(\Carbon\Carbon::now())) {
$baseClaimQuery = \App\Models\Claim::query()->where('torrent_id', $id);
$claimCounts = (clone $baseClaimQuery)->count();
$isClaimed = (clone $baseClaimQuery)->where('uid', $CURUSER['id'])->exists();
+2 -1
View File
@@ -150,7 +150,7 @@ elseif($action == 'savesettings_torrent') // save account
'expirefree','expiretwoup','expiretwoupfree','expiretwouphalfleech', 'expirenormal','hotdays','hotseeder','halfleechbecome','freebecome',
'twoupbecome','twoupfreebecome', 'twouphalfleechbecome','normalbecome','uploaderdouble','deldeadtorrent', 'randomthirtypercentdown',
'thirtypercentleechbecome', 'expirethirtypercentleech', 'sticky_first_level_background_color', 'sticky_second_level_background_color',
'download_support_passkey', 'claim_torrent_ttl', 'claim_torrent_user_counts_up_limit', 'claim_user_torrent_counts_up_limit', 'claim_remove_deduct_user_bonus',
'download_support_passkey', 'claim_enabled', 'claim_torrent_ttl', 'claim_torrent_user_counts_up_limit', 'claim_user_torrent_counts_up_limit', 'claim_remove_deduct_user_bonus',
'claim_give_up_deduct_user_bonus', 'claim_bonus_multiplier', 'claim_reach_standard_seed_time', 'claim_reach_standard_uploaded'
);
GetVar($validConfig);
@@ -666,6 +666,7 @@ elseif ($action == 'torrentsettings')
</ul>".$lang_settings['text_promotion_timeout_note_two'], 1);
tr($lang_settings['claim_label'], "<ul>
<li>".$lang_settings['claim_enabled'] . sprintf('&nbsp;<label><input type="radio" name="claim_enabled" value="yes"%s/>Yes</label><label><input type="radio" name="claim_enabled" value="no"%s/>No</label>', $TORRENT['claim_enabled'] == 'yes' ? ' checked' : '', $TORRENT['claim_enabled'] == 'no' ? ' checked' : '')."</li>
<li>".sprintf($lang_settings['claim_torrent_ttl'], sprintf('<input type="number" name="claim_torrent_ttl" value="%s" style="width: 50px"/>', $TORRENT['claim_torrent_ttl'] ?? \App\Models\Claim::TORRENT_TTL))."</li>
<li>".sprintf($lang_settings['claim_torrent_user_counts_up_limit'], sprintf('<input type="number" name="claim_torrent_user_counts_up_limit" value="%s" style="width: 50px"/>', $TORRENT['claim_torrent_user_counts_up_limit'] ?? \App\Models\Claim::USER_UP_LIMIT))."</li>
<li>".sprintf($lang_settings['claim_user_torrent_counts_up_limit'], sprintf('<input type="number" name="claim_user_torrent_counts_up_limit" value="%s" style="width: 50px"/>', $TORRENT['claim_user_torrent_counts_up_limit'] ?? \App\Models\Claim::TORRENT_UP_LIMIT))."</li>
+3 -3
View File
@@ -294,8 +294,8 @@ tr_small($lang_userdetails['row_torrent_comment'], ($torrentcomments && ($user["
tr_small($lang_userdetails['row_forum_posts'], ($forumposts && ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) ? "<a href=\"userhistory.php?action=viewposts&amp;id=".$id."\" title=\"".$lang_userdetails['link_view_posts']."\">".$forumposts."</a>" : $forumposts), 1);
if ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) {
tr_small($lang_userdetails['row_karma_points'], htmlspecialchars($user['seedbonus']), 1);
tr_small($lang_functions['text_seed_points'], htmlspecialchars($user['seed_points']), 1);
tr_small($lang_userdetails['row_karma_points'], number_format($user['seedbonus'], 1), 1);
tr_small($lang_functions['text_seed_points'], number_format($user['seed_points'], 1), 1);
}
@@ -485,7 +485,7 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class())
{
tr($lang_userdetails['row_amount_uploaded'], "<input type=\"text\" size=\"60\" name=\"uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" /><input type=\"hidden\" name=\"ori_uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" />", 1);
tr($lang_userdetails['row_amount_downloaded'], "<input type=\"text\" size=\"60\" name=\"downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" /><input type=\"hidden\" name=\"ori_downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" />", 1);
tr($lang_userdetails['row_seeding_karma'], "<input type=\"text\" size=\"60\" name=\"bonus\" value=\"" .htmlspecialchars($user['seedbonus']) . "\" /><input type=\"hidden\" name=\"ori_bonus\" value=\"" .htmlspecialchars($user['seedbonus']) . "\" />", 1);
tr($lang_userdetails['row_seeding_karma'], "<input type=\"text\" size=\"60\" name=\"bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" /><input type=\"hidden\" name=\"ori_bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" />", 1);
tr($lang_userdetails['row_invites'], "<input type=\"text\" size=\"60\" name=\"invites\" value=\"" .htmlspecialchars($user['invites']) . "\" />", 1);
}
tr($lang_userdetails['row_passkey'], "<input name=\"resetkey\" value=\"yes\" type=\"checkbox\" />".$lang_userdetails['checkbox_reset_passkey'], 1);