Various modifications for phpBB3Mp3 attachment/bbcode

Snippets for phpBB3
Previous topicNext topic
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Online
Posts: 5975
Joined: Jan 13th, '14, 20:45
    Windows 10 Firefox

Mp3 attachment/bbcode

Post by dmzx »

Mp3 attachment/bbcode

Open: includes/constants.php
Find This may be a partial find and not the whole line

Code: Select all

define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

define('ATTACHMENT_CATEGORY_MP3', 7); // MP3 Files - Streaming
Open: includes/functions_content.php
Find This may be a partial find and not the whole line

Code: Select all

 // 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)
                   // $download_link = $filename;

                   $block_array += array(
                      'U_FORUM'      => generate_board_url(),
                      'ATTACH_ID'      => $attachment['attach_id'],
                      'S_WM_FILE'      => true,
                   );

                   // Viewed/Heared File ... update the download count
                   $update_count[] = $attachment['attach_id'];
                break;
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

// MP3 Streams
                   case ATTACHMENT_CATEGORY_MP3:
                      $l_downloaded_viewed = 'VIEWED_COUNT';
       
                      $block_array += array(
                         'U_FORUM'      => generate_board_url(),
                         'ATTACH_ID'      => $attachment['attach_id'],
                         'S_MP3_FILE'      => true,
                      );
       
                      // Viewed/Heared File ... update the download count
                      $update_count[] = $attachment['attach_id'];
                   break;
Open: includes/acp/acp_attachments.php
Find This may be a partial find and not the whole line

Code: Select all

$cat_lang = array(
                   ATTACHMENT_CATEGORY_NONE      => $user->lang['NO_FILE_CAT'],
                   ATTACHMENT_CATEGORY_IMAGE      => $user->lang['CAT_IMAGES'],
                   ATTACHMENT_CATEGORY_WM         => $user->lang['CAT_WM_FILES'],
                   ATTACHMENT_CATEGORY_RM         => $user->lang['CAT_RM_FILES'],
                   ATTACHMENT_CATEGORY_FLASH      => $user->lang['CAT_FLASH_FILES'],
                   ATTACHMENT_CATEGORY_QUICKTIME   => $user->lang['CAT_QUICKTIME_FILES'],
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

ATTACHMENT_CATEGORY_MP3         => $user->lang['CAT_MP3_FILES'],
Find This may be a partial find and not the whole line

Code: Select all

$types = array(
             ATTACHMENT_CATEGORY_NONE      => $user->lang['NO_FILE_CAT'],
             ATTACHMENT_CATEGORY_IMAGE      => $user->lang['CAT_IMAGES'],
             ATTACHMENT_CATEGORY_WM         => $user->lang['CAT_WM_FILES'],
             ATTACHMENT_CATEGORY_RM         => $user->lang['CAT_RM_FILES'],
             ATTACHMENT_CATEGORY_FLASH      => $user->lang['CAT_FLASH_FILES'],
             ATTACHMENT_CATEGORY_QUICKTIME   => $user->lang['CAT_QUICKTIME_FILES'],
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

ATTACHMENT_CATEGORY_MP3         => $user->lang['CAT_MP3_FILES'],
Open: language/en/acp/attachments.php
Find This may be a partial find and not the whole line

Code: Select all

 'CAT_QUICKTIME_FILES'      => 'Quicktime media files',
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

'CAT_MP3_FILES' => 'MP3',
Open: styles/prosilver/template/attachment.html
Find This may be a partial find and not the whole line

Code: Select all

<script type="text/javascript">
                   // <![CDATA[
                       if (document.rmstream_{_file.ATTACH_ID}.GetClipWidth)
                       {
                           while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth())
                           {
                           }
       
                           var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth();
                           var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight();
       
                           document.rmstream_{_file.ATTACH_ID}.width = width;
                           document.rmstream_{_file.ATTACH_ID}.height = height;
                           document.ctrls_{_file.ATTACH_ID}.width = width;
                       }
                   // ]]>
                   </script>
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

<!-- ELSEIF _file.S_MP3_FILE -->
       
       <object type="application/x-shockwave-flash" data="mediaplayer/mp3player/player.swf" id="audioplayer1" height="24" width="290">
       <param name="movie" value="mediaplayer/mp3player/player.swf" />
       <param name="FlashVars" value="playerID=1&soundFile={_file.U_DOWNLOAD_LINK}" />
       <param name="quality" value="high" />
       <param name="menu" value="true" />
       <param name="wmode" value="transparent" />
       </object><br/>
       <span class="gensmall">
           <!-- IF _file.UPLOAD_ICON -->{_file.UPLOAD_ICON} <!-- ENDIF -->
       
       <a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a><br/> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ] </span>
The easiest part!

Open phpBB3 Admin Control Panel

Go to the posting tab

Under “Manage Extension Groups” add “Files MP3″, select the “MP3″ for a special category and any other settings that you like.

Under “Manage Extensions” add “mp3″ under the group “files MP3″.

Under “Manage Extensions” verify that the “MP3″ extension is filed under “Files MP3”.

Step 5: MP3 BBCode

Not necessary, only if you want to be able to move the flash player to different forums.
Navigate to Posting BBcodes.

BBCode usage

Code: Select all

[mp3]{URL}[/mp3]
HTML replacement

Code: Select all

<object type="application/x-shockwave-flash" data="http://yourwebsiteurl.com/player.swf" id="audioplayer1" height="24" width="290">
       <param name="movie" value="http://yourwebsiteurl.com/player.swf" />
       <param name="FlashVars" value="playerID=1&soundFile={URL}" />
       <param name="quality" value="high" />
       <param name="menu" value="true" />
       <param name="wmode" value="transparent" />
       </object>
Help Line

Code: Select all

 [mp3]URL to file[/mp3]
That’s it!

place this folder in root
root(1).zip
You do not have the required permissions to view the files attached to this post.
binance.com ;) try it!
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4796
Joined: Apr 6th, '14, 14:12
    Windows 10 Chrome

Re: Mp3 attachment/bbcode

Post by martin »

I'l update this for 3.2 if it needs it as the site it come from is now gone.
Use this to install an ext on your board no more ftp or path making.
Path too install this ext is ext/boardtools/upload
Download is here Make it easy for us to solve your issues
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Online
Posts: 5975
Joined: Jan 13th, '14, 20:45
    Windows 10 Firefox

Re: Mp3 attachment/bbcode

Post by dmzx »

martin wrote: Jun 28th, '16, 22:45 I'l update this for 3.2 if it needs it as the site it come from is now gone.
:thumbup:
User avatar

zardos
Users
Users
Magic user status: Offline
Posts: 178
Joined: Feb 26th, '16, 22:20
    Windows 10 Firefox

Re: Mp3 attachment/bbcode

Post by zardos »

Thanks martin and DM :thumbup:
You do not have the required permissions to view the files attached to this post.
Image
Previous topicNext topic