mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 02:51:35 +02:00
[ticket/14771] Support playing audio attachments
Add Audio attachments category, Audio attachments group. add most audio supported extensions to the audio group. presserve audio extensions MIMEtypes. modify the attachment style file to view the audio attachment in AUDIO HTML5 tag. PHPBB3-14771
This commit is contained in:
committed by
Marc Alexander
parent
2f8e5b7248
commit
8fab32abd7
@@ -1410,6 +1410,7 @@ class acp_attachments
|
||||
$types = array(
|
||||
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
|
||||
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
|
||||
ATTACHMENT_CATEGORY_AUDIO => $user->lang['CAT_AUDIO_FILES'],
|
||||
);
|
||||
|
||||
if ($group_id)
|
||||
|
@@ -161,6 +161,7 @@ define('CONFIRM_REPORT', 4);
|
||||
define('ATTACHMENT_CATEGORY_NONE', 0);
|
||||
define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images
|
||||
define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts
|
||||
define('ATTACHMENT_CATEGORY_AUDIO', 7); // Browser-playable audio files
|
||||
|
||||
// BBCode UID length
|
||||
define('BBCODE_UID_LEN', 8);
|
||||
|
@@ -1228,6 +1228,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
|
||||
$block_array += array(
|
||||
'UPLOAD_ICON' => $upload_icon,
|
||||
'FILESIZE' => $filesize['value'],
|
||||
'MIMETYPE' => $attachment['mimetype'],
|
||||
'SIZE_LANG' => $filesize['unit'],
|
||||
'DOWNLOAD_NAME' => utf8_basename($attachment['real_filename']),
|
||||
'COMMENT' => $comment,
|
||||
@@ -1315,6 +1316,19 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
|
||||
$update_count_ary[] = $attachment['attach_id'];
|
||||
break;
|
||||
|
||||
// Audio files
|
||||
case ATTACHMENT_CATEGORY_AUDIO:
|
||||
$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
|
||||
$block_array += array(
|
||||
'S_AUDIO_FILE' => true,
|
||||
'U_FORUM' => generate_board_url(),
|
||||
'ATTACH_ID' => $attachment['attach_id'],
|
||||
);
|
||||
|
||||
// Heard File ... update the download count
|
||||
$update_count_ary[] = $attachment['attach_id'];
|
||||
break;
|
||||
|
||||
default:
|
||||
$l_downloaded_viewed = 'DOWNLOAD_COUNTS';
|
||||
|
||||
|
Reference in New Issue
Block a user