diff --git a/include/functions.php b/include/functions.php index 561f6c6d..31367ce2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5957,9 +5957,9 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array $torrentIdArr = [-1]; } $idStr = implode(',', \Illuminate\Support\Arr::wrap($torrentIdArr)); - $sql = "select torrents.id, torrents.added, torrents.size, torrents.seeders, 'NO_PEER_ID' as peerID from torrents WHERE id in ($idStr)"; + $sql = "select torrents.id, torrents.added, torrents.size, torrents.seeders, 'NO_PEER_ID' as peerID, '' as last_action from torrents WHERE id in ($idStr)"; } else { - $sql = "select torrents.id, torrents.added, torrents.size, torrents.seeders, peers.id as peerID from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $uid AND peers.seeder ='yes' group by peers.torrent, peers.peer_id"; + $sql = "select torrents.id, torrents.added, torrents.size, torrents.seeders, peers.id as peerID, peers.last_action from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $uid AND peers.seeder ='yes' group by peers.torrent, peers.peer_id"; } $tagGrouped = []; $torrentResult = \Nexus\Database\NexusDB::select($sql); @@ -5975,8 +5975,12 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array $zeroBonusTag = \App\Models\Setting::get('bonus.zero_bonus_tag'); $zeroBonusFactor = \App\Models\Setting::get('bonus.zero_bonus_factor'); do_log("$logPrefix, sql: $sql, count: " . count($torrentResult) . ", officialTag: $officialTag, officialAdditionalFactor: $officialAdditionalFactor, zeroBonusTag: $zeroBonusTag, zeroBonusFactor: $zeroBonusFactor"); + $last_action = ""; foreach ($torrentResult as $torrent) { + if ($torrent['last_action'] > $last_action) { + $last_action = $torrent['last_action']; + } $size = bcadd($size, $torrent['size']); $weeks_alive = ($timenow - strtotime($torrent['added'])) / $sectoweek; $gb_size = $gb_size_raw = $torrent['size'] / 1073741824; @@ -6005,7 +6009,7 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array //Official addition don't think about the minimum value $official_bonus = $valuetwo * atan($official_a / $l_bonus); $result = compact( - 'seed_points','seed_bonus', 'A', 'count', 'torrent_peer_count', 'size', + 'seed_points','seed_bonus', 'A', 'count', 'torrent_peer_count', 'size', 'last_action', 'official_bonus', 'official_a', 'official_torrent_peer_count', 'official_size' ); $result['donor_times'] = $donortimes_bonus; diff --git a/lang/chs/lang_invite.php b/lang/chs/lang_invite.php index 97f4b674..36e13820 100644 --- a/lang/chs/lang_invite.php +++ b/lang/chs/lang_invite.php @@ -51,6 +51,12 @@ $lang_invite = array 'harem_addition' => '后宫加成', 'signup_link_help' => '右键复制', 'signup_link' => '注册链接', + 'text_seed_torrent_count' => '当前做种数', + 'text_seed_torrent_size' => '当前做种体积', + 'text_seed_torrent_bonus_per_hour' => '当前纯做种时魔', + 'text_seed_torrent_bonus_per_hour_help' => '即做种积分,单纯做种的值,不考虑捐赠、官种、后宫等任何加成', + 'text_seed_torrent_last_announce_at' => '最后做种汇报时间', + 'text_enabled' => '启用', ); ?> diff --git a/lang/cht/lang_invite.php b/lang/cht/lang_invite.php index bfe290c5..6351cdde 100644 --- a/lang/cht/lang_invite.php +++ b/lang/cht/lang_invite.php @@ -51,6 +51,12 @@ $lang_invite = array 'harem_addition' => '後宮加成', 'signup_link_help' => '右鍵復製', 'signup_link' => '註冊鏈接', + 'text_seed_torrent_count' => '當前做種數', + 'text_seed_torrent_size' => '當前做種體積', + 'text_seed_torrent_bonus_per_hour' => '當前純做種時魔', + 'text_seed_torrent_bonus_per_hour_help' => '即做種積分,單純做種的值,不考慮捐贈、官種、後宮等任何加成', + 'text_seed_torrent_last_announce_at' => '最後做種匯報時間', + 'text_enabled' => '啟用', ); ?> diff --git a/lang/en/lang_invite.php b/lang/en/lang_invite.php index 4185e322..92a759c4 100644 --- a/lang/en/lang_invite.php +++ b/lang/en/lang_invite.php @@ -54,6 +54,12 @@ Best Regards, 'harem_addition' => 'Harem addition', 'signup_link_help' => 'Right click to copy', 'signup_link' => 'Signup link', + 'text_seed_torrent_count' => 'Seeding counts', + 'text_seed_torrent_size' => 'Seeding size', + 'text_seed_torrent_bonus_per_hour' => 'Seeding bonus per hour', + 'text_seed_torrent_bonus_per_hour_help' => 'That is, seed points, do not consider donations, official torrent, harems and any other additions', + 'text_seed_torrent_last_announce_at' => 'Last announce time', + 'text_enabled' => 'Enabled', ); ?> diff --git a/public/invite.php b/public/invite.php index 01efb9bd..db211012 100644 --- a/public/invite.php +++ b/public/invite.php @@ -70,11 +70,61 @@ if ($type == 'new'){ } else { inviteMenu($menuSelected); if ($menuSelected == 'invitee') { - $rel = sql_query("SELECT COUNT(*) FROM users WHERE invited_by = ".mysql_real_escape_string($id)) or sqlerr(__FILE__, __LINE__); + $whereStr = "invited_by = " . sqlesc($id); + if (!empty($_GET['status'])) { + $whereStr .= " and status = " . sqlesc($_GET['status']); + } + if (!empty($_GET['enabled'])) { + $whereStr .= " and enabled = " . sqlesc($_GET['enabled']); + } + $rel = sql_query("SELECT COUNT(*) FROM users WHERE $whereStr") or sqlerr(__FILE__, __LINE__); $arro = mysql_fetch_row($rel); $number = $arro[0]; - - print("