Fixed downloaded counter (#894)

This commit is contained in:
Roman Kelesidis 2023-09-07 21:45:04 +07:00 committed by GitHub
commit 559029a133
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -62,7 +62,7 @@ $bt_topic_id = $t_data['topic_id'];
$bt_user_id = $userdata['user_id'];
$attach_id = $attachments['_' . $post_id][$i]['attach_id'];
$tracker_status = $attachments['_' . $post_id][$i]['tracker_status'];
$download_count = $attachments['_' . $post_id][$i]['download_count'];
$download_count = declension((int)$attachments['_' . $post_id][$i]['download_count'], 'times');
$tor_file_size = humn_size($attachments['_' . $post_id][$i]['filesize']);
$tor_file_time = bb_date($attachments['_' . $post_id][$i]['filetime']);
@ -99,7 +99,7 @@ if (!$tor_reged) {
'U_DOWNLOAD_LINK' => $download_link,
'FILESIZE' => $tor_file_size,
'DOWNLOAD_COUNT' => declension((int)$download_count, 'times'),
'DOWNLOAD_COUNT' => $download_count,
'POSTED_TIME' => $tor_file_time,
]);
@ -138,6 +138,7 @@ if ($tor_auth) {
if ($tor_reged && $tor_info) {
$tor_size = ($tor_info['size']) ?: 0;
$tor_completed_count = declension((int)$tor_info['complete_count'], 'times');
$tor_id = $tor_info['topic_id'];
$tor_type = $tor_info['tor_type'];
@ -213,11 +214,11 @@ if ($tor_reged && $tor_info) {
'MAGNET' => $tor_magnet,
'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false,
'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false,
'DOWNLOAD_COUNT' => declension((int)$download_count, 'times'),
'REGED_TIME' => bb_date($tor_info['reg_time']),
'REGED_DELTA' => delta_time($tor_info['reg_time']),
'TORRENT_SIZE' => humn_size($tor_size),
'COMPLETED' => declension((int)$tor_info['complete_count'], 'times'),
'DOWNLOAD_COUNT' => $download_count,
'COMPLETED' => $tor_completed_count,
]);
if ($comment) {
@ -232,7 +233,8 @@ if ($tor_reged && $tor_info) {
'TOR_SIZE' => humn_size($tor_size),
'TOR_LONGEVITY' => delta_time($tor_info['reg_time']),
'TOR_COMPLETED' => declension((int)$tor_info['complete_count'], 'times'),
'TOR_DOWNLOAD_COUNT' => $download_count,
'TOR_COMPLETED' => $tor_completed_count,
]);
}

View file

@ -214,7 +214,7 @@
</tr>
<tr class="row1">
<td>{L_COMPLETED}:</td>
<td><span title="{L_DOWNLOADED}: {postrow.attach.tor_reged.DOWNLOAD_COUNT}">{postrow.attach.tor_reged.COMPLETED}</span></td>
<td><span title="Полных скачиваний: {postrow.attach.tor_reged.COMPLETED}">{postrow.attach.tor_reged.DOWNLOAD_COUNT}</span></td>
</tr>
<tr class="row1">
<td>{L_SIZE}:</td>

View file

@ -57,7 +57,7 @@ ajax.callback.callseed = function (data) {
<td colspan="2" class="borderless bCenter pad_8">
{L_SIZE}:&nbsp; <b>{TOR_SIZE}</b>&nbsp; &nbsp;|&nbsp; &nbsp;
{L_IS_REGISTERED}:&nbsp; <b>{TOR_LONGEVITY}</b>&nbsp; &nbsp;|&nbsp; &nbsp;
{L_COMPLETED}:&nbsp; <b>{TOR_COMPLETED}</b>
{L_COMPLETED}:&nbsp; <b title="Полных скачиваний: {TOR_COMPLETED}">{TOR_DOWNLOAD_COUNT}</b>
</td>
</tr>
<!-- ENDIF / SHOW_DL_LIST_TOR_INFO -->