Kaynağa Gözat

! Add MB size to attachments, its 2012

Spuds 13 yıl önce
ebeveyn
işleme
475c6ce5f4

+ 1 - 1
Sources/Display.php

@@ -1448,7 +1448,7 @@ function loadAttachmentContext($id_msg)
 				'id' => $attachment['id_attach'],
 				'name' => preg_replace('~&#(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '&#\\1;', htmlspecialchars($attachment['filename'])),
 				'downloads' => $attachment['downloads'],
-				'size' => round($attachment['filesize'] / 1024, 2) . ' ' . $txt['kilobyte'],
+				'size' => ($attachment['filesize'] < 1024000) ? round($attachment['filesize'] / 1024, 2) . ' ' . $txt['kilobyte'] : round($attachment['filesize'] / 1024 / 1024, 2) . ' ' . $txt['megabyte'],
 				'byte_size' => $attachment['filesize'],
 				'href' => $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attachment['id_attach'],
 				'link' => '<a href="' . $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attachment['id_attach'] . '">' . htmlspecialchars($attachment['filename']) . '</a>',

+ 1 - 0
Themes/default/languages/index.english.php

@@ -397,6 +397,7 @@ $txt['delete'] = 'Delete';
 $txt['your_pms'] = 'Your Personal Messages';
 
 $txt['kilobyte'] = 'kB';
+$txt['megabyte'] = 'MB';
 
 $txt['more_stats'] = '[More Stats]';