mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[ticket/10345] Make use of the plural function in some basic places
PHPBB3-10345
This commit is contained in:
committed by
Oleg Pudeyev
parent
0734dd3c42
commit
88ae40a4b1
@@ -938,12 +938,12 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
}
|
||||
|
||||
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
|
||||
$l_downloaded_viewed = 'VIEWED_COUNTS';
|
||||
|
||||
switch ($display_cat)
|
||||
{
|
||||
// Images
|
||||
case ATTACHMENT_CATEGORY_IMAGE:
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
|
||||
$download_link .= '&mode=view';
|
||||
|
||||
@@ -957,7 +957,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
|
||||
// Images, but display Thumbnail
|
||||
case ATTACHMENT_CATEGORY_THUMB:
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
$thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1');
|
||||
$download_link .= '&mode=view';
|
||||
|
||||
@@ -971,7 +970,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
|
||||
// Windows Media Streams
|
||||
case ATTACHMENT_CATEGORY_WM:
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
// Giving the filename directly because within the wm object all variables are in local context making it impossible
|
||||
// to validate against a valid session (all params can differ)
|
||||
@@ -990,7 +988,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
// Real Media Streams
|
||||
case ATTACHMENT_CATEGORY_RM:
|
||||
case ATTACHMENT_CATEGORY_QUICKTIME:
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false,
|
||||
@@ -1007,8 +1004,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
case ATTACHMENT_CATEGORY_FLASH:
|
||||
list($width, $height) = @getimagesize($filename);
|
||||
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_FLASH_FILE' => true,
|
||||
'WIDTH' => $width,
|
||||
@@ -1021,7 +1016,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
break;
|
||||
|
||||
default:
|
||||
$l_downloaded_viewed = 'DOWNLOAD_COUNT';
|
||||
$l_downloaded_viewed = 'DOWNLOAD_COUNTS';
|
||||
|
||||
$block_array += array(
|
||||
'S_FILE' => true,
|
||||
@@ -1029,11 +1024,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
break;
|
||||
}
|
||||
|
||||
$l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $attachment['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $attachment['download_count']));
|
||||
if (!isset($attachment['download_count']))
|
||||
{
|
||||
$attachment['download_count'] = 0;
|
||||
}
|
||||
|
||||
$block_array += array(
|
||||
'U_DOWNLOAD_LINK' => $download_link,
|
||||
'L_DOWNLOAD_COUNT' => $l_download_count
|
||||
'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $attachment['download_count']),
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user