phpBB3 MP3 Player with Attachments

MP3 Player - August 23rd, 2010

phpBB has a great attachment tool that gives users the ability to upload multiple files, if you have a podcast or own a music site, the most essential of these will be the MP3 extension. The code that you’re going to find on this page is not relevant to any other part of the attachment mod besides the MP3 file. I understand that the video support is not top notch either. The problem is that there is too many different extensions and they all need to be tackled individually.

What we are going to do is provide any user who decides to upload an MP3 file on your forum a flash player that plays the song and gives you a download link on the same page. A couple scripts that we borrowed from to do this very simple task were missing key parts.

For example, one had a less standard flash player, the other didn’t allow you download the MP3 file anymore, and there was a great one that only would add the flash player by clicking the inline option after you uploaded it. Mine is 100 percent automatic after you upload the file.

Almost all of them conflicted with other attachments to some degree, but were great ideas that only took me a few hours to improve on.

I’ve made sure to test this modification out. The instructions are perfect and all there. I can’t guarantee that it will work in future versions of phpBB3, but this page will surely have an update if that isn’t the case because this mod is very essential to one of my forums.

The MP3 Player is brilliant and a universally accepted one that allows you to playback, rewind, fast forward and displays the name of the track.

A cool feature that you might overlook is the ability to use the bbcode tag [mp3] anywhere on your site which makes it extremely simple for your users to move songs from one forum to another. If enough people request it, I can make this happen off the site as well.


*Fast MP3 Player
*Download MP3 & listen on the same page
*Use the MP3 tag anywhere on your forum to embed uploaded song
*Uses Attachment Mod
*Very simple to install
*Works with SubSilver2 and Prosilver
*Change Color of Flash Player, Loop, or Autostart

Step 1: Download the player

First you will need to download this player (right-click, Save as…). It is an .swf file; this is what will be used to allow you to playback your MP3 files.

Step 2: Upload Player

Upload the flash .swf file to your forums root directory. We will get back to that later in this easy tutorial that I promise will be done in 10 minutes.

Step 3: Code Changes




define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files

Add After

define('ATTACHMENT_CATEGORY_MP3', 7); // MP3 Files - Streaming




	// Windows Media Streams
					$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'];

Add After

    // 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'];





Add After

ATTACHMENT_CATEGORY_MP3         => $user->lang['CAT_MP3_FILES'],




$cat_lang = array(
'CAT_QUICKTIME_FILES'		=> 'Quicktime media files',

Add After

'CAT_MP3_FILES' => 'MP3',




Works for Subsilver2 and Prosilver

<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;
			// ]]>

Add After

Replace with your forums address.

	<!-- ELSEIF _file.S_MP3_FILE -->

<object type="application/x-shockwave-flash" data="" id="audioplayer1" height="24" width="290">
<param name="movie" value="" />
<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" />
<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>


Only if you want to change the color, autostart or loop for the flash player.


Add After


Step 4: Extension Settings

The easiest part!

Open phpBB3 Admin Control Panel

Go to the posting tab.

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

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

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

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

Add New


HTML replacement

Add New

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

Help Line

Add New

[mp3]URL to file[/mp3]

That’s it!


Thanks 404 Tech Support especially and this non english forum for giving us the tools to make this mod possible.

If you feel that any work that you might have contributed to this small mod was not acknowledged in this article feel free to leave a comment with a link to your website. Feel free to ask for improvements, I’d be glad to consider them.

Posted in Tips & Code
Tags: ,

58 ResponsesComments Feed

  1. Vinnie

    Thank you so much for the instruction. I use this player for phpBB 3.0.7-PL1. It works !

    09/10/10, 10:28 am
  2. Robin

    I try to install this mod today, but i got a problem until step 4…

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

    But i have no “files MP3” in my list of the extension group. And the strangest thing… I can only select from some german points from the quick menu (i running a german board on my server). I set my admin profile to the english lang. but it’s still in german there. I check my modifications three times now, but all is fine until the point 4.

    Any idea?

    09/12/10, 2:55 pm
  3. I am able to go through most of the steps except for Step 4. I do not see the special category: mp3 under the options for the group extensions management option. Please help me troubleshoot this. My website is

    Thank you.


    09/13/10, 8:11 pm
  4. Robin

    My problem is solved…I was only a bit irritated around the “Manage extension” and “Manage extension group”. I also found the “problem” with my german description. They are safed under the “Manage extension groups” (only on localized versions of phpBB).

    1. Under “Manage extensions groups” at the “POSTING” tab ad under “Create new group” the word “MP3” or “MP3 files” (what you prefer). Click on “Submit” to safe it.
    2. Select under the “Special category” something else from the quick menu. I choose “None”. Than select what you will allowed (Posting on the board / posting on PM), select your max. upload size for MP3’s (I think 5 MB is good) and as least select on wich boards you will allow an MP3 upload (all boards or only your selected one). Click now on “Submit” if you are done with your settings.
    3. Select now in the “POSTING” tab the point “Manage extension”. Search for the suffix “MP3” who’s placed at the moment under “Loadable files” (I’m not sure if this the exactly word in english for this point). Now you can change it from this status to “MP3” over the quick menu. Click on “Submit” to safe your new settings.

    With this settings i have now access to the MP3 flash player. But at the moment only for direct linked mp3’s. Uploaded MP3’s are still didn’t work for me. Not sure what’s the problem at the moment. If i understand it right, this must work with this plugin/concept.

    09/15/10, 2:32 pm
  5. Robin

    Oh… i forget one important information for step 2!!!

    Under “Assigned extension” you will see something who suggest a list, but you can’t insert anything or choosing anything… There is only a link who named “Go to extension management screen”. If you do this, you will lost your settings if you didn’t click on “Submit” before and you didn’t will get an access on your new group category named “MP3”.
    But if you safe your settings now and make the settings under step 3, this will put automatically the assigned extension to the “Manage extension group” settings. You can recheck it if you click after all steps who i wrote down, if you edit (green icon) now the MP3 settings.

    I hope you understand what i would say… I’m not absolutely perfect with my english 😉

    09/15/10, 2:39 pm
  6. I’m still having problems. Any response from qkin?

    09/15/10, 9:21 pm
  7. Thanks Robin. I’m able to get the BBcode player to work now, but not the attachment MP3 player. I think it’s because we can’t select “MP3” as an option under the special category for group extension managements.

    Any thoughts, qkin?

    09/16/10, 2:11 am
  8. Ok. I figured how to make it work. There are two sections in the acp_attachments.php file where you need to add this line:

    ATTACHMENT_CATEGORY_MP3 => $user->lang[‘CAT_MP3_FILES’],

    Make sure to add the line to both sections so you will see “MP3” on the drop-down menu for special category selection under the group extensions management area.

    09/16/10, 3:08 am
  9. Now, is there a way to remove the download link from the MP3 player so people can’t download the file easily?

    09/16/10, 3:10 am
  10. i m having the problem, now i can upload the mp3 files but the problem is that player is not getting visible in the discussion forum

    10/08/10, 5:38 pm
  11. The player doesn’t show up in the attachment
    I have followed the instructions.
    What could be wrong ?

    10/10/10, 2:43 am
  12. Thanks Carlos for explaining that & Robin.


    Here’s how to remove the download link.

    phpBB3 Mp3 Fix

    Frank please check functions_content.php and make sure that the edits you made were correct.

    10/11/10, 2:31 am
  13. Thank You qkin for posting this article.
    I’ve followed all the steps instructed, mp3 icon’s showing next to font colour. [ Font Colour mp3 ]
    Here the code i’ve inserted:

    The result: Test [which is topic name]
    No player’s showing, no song play…

    What did i do wrong?
    Your assistance is hightly appreciated.

    Best Regards,

    12/02/10, 6:17 pm
  14. Issues Resolved.
    It’s Working now.
    Thank You!


    12/03/10, 12:24 am
  15. on your bbcode don’t forget to change the “yoururl” to your URL
    after uploading your files purge your templates.

    12/04/10, 7:55 pm
  16. on your language/en/acp/attachments.php
    don’t forget to make those changes to your other languages you are using.

    also do the same changes to all your templates.

    12/04/10, 8:37 pm
  17. Nelson

    i got as far as the step “styles/template/attachments.html”..i am using a rocket theme and that file does not exist. how can i add this to my template?

    02/07/11, 3:28 am
  18. I wish I could do it on a smf forum

    02/25/11, 5:17 am
  19. qkinweb

    @ Nelson. Template means Rocket!

    02/25/11, 2:30 pm
  20. Nhaw-T

    oh man! i cant really follow the steps from step 1… just newly to configure phpbb..just hoping if u can make a video tutorial.. thanks in advance!

    02/26/11, 5:29 am
  21. this_sux

    you cant download the .swf file in win 7 bummer

    can some one post a link to it ?

    03/12/11, 11:25 am
  22. qkinweb

    Hope this works for you, if not, I have an instant messenger listed on

    03/16/11, 2:12 am
  23. Hey there,

    Having issues getting the flash player to show under the attachment window. Have spent hours on this, checking the URL of the .swf, checking the code in attachments.html, etc etc.

    I’ve basically set this up and gone through the guide about 3 times with no help, including the hints of the comments page here and on the mods forum.

    Any ideas?

    03/25/11, 3:45 pm
  24. ihng

    is there a way by using the bbcode to show the link (url) under the player. now if you only add the player per bbcode you dont what do you hear and you don’t know a link to download the mp3.

    03/25/11, 8:16 pm
  25. Hey guys,

    If any of you are having issues with the player not showing, make sure you purge your cache in the admin panel before mucking around too much.

    Finally figured out that is was the issue with my forum.

    03/27/11, 7:29 pm
  26. includes/acp/acp_attachments.php


    Need to find twice!!

    04/17/11, 7:21 am
  27. Jeppe

    Thanks for the mod – difficult to install but perfect once installed 🙂

    05/10/11, 5:13 pm
  28. qkinweb

    @ Jeppe. How about you just use pastebin for your addon? Please, and thank you for the addition.

    05/11/11, 12:59 pm
  29. I had the player working for a while, now all it does is buffer and doesn’t play anymore. Anybody know what may be causing this. Can anyone here fix it for me?

    05/13/11, 11:26 am
  30. swapvn

    I had the same Joesph’s problem the player working for a while, now the player not showing.
    Some one helps me please. Thanks

    09/14/11, 2:47 am
  31. roliignorne

    Here i entertain organize some awesome clarinets for richest prices. Soprano clarinets incorporate the timeless rich, harmonious tones people typically keep flock with this most bountiful myself in the woodwind family.

    10/14/11, 10:01 pm
  32. alydhiends

    Hi, how do I put back the comments in the attachment? It seems to be gone.


    11/15/11, 10:41 am
  33. alydhiends

    nvm, I got it working now.



    below that, find

    Before the “”, insert this:

    Purge your cache in the ACP & That’s it 🙂

    11/15/11, 11:04 am
  34. alydhiends

    Oh Well, there seems to be a problem posting codes here. Let me explain it again.



    Copy that whole line

    ELSEIF _file.S_MP3_FILE

    Further down you will find:
    span class=”gensmall”

    Before the Span closing tag, insert the line you just copied.

    Purge the cache in your ACP & that’s it.

    11/15/11, 11:11 am
  35. Ok, I have read, and re-read and then re-read again, everything on this post and I did everything as you guys are saying… It doesn’t do anything! I cannot for the life of me get the player to appear! It doesn’t with attachments or URLs… Nothing!
    My only difference is in the template where I use a different than Subsilver2 or Prosilver, I use Acidtech yellow but I did edit correctly its own attachment.html.
    Any help would be greatly appreciated!

    12/13/11, 6:27 pm
  36. QKin, please forgive me and disregard or better yet kill my last post… I guess I wasn’t reading well enough! It now works!
    Thank you again for the great post!!! 😉

    12/13/11, 6:46 pm
  37. alfred beilin

    hi happy new year to yous all
    alf beilin

    01/02/12, 5:05 pm
  38. achim82

    Happy new year to all of you…
    I had no proplem including this to my forum. All works fine, except that when i push play it’s buffering for 2 seconds and the message “Error opening file” appears.
    Any suggestions?

    01/05/12, 7:54 am
  39. revjombo

    I know this is old but I stumbled on it trying to figure out how to stop the download link appear when I post an attachment for the player I have that does work. I never could get this one to play it always errors and file not found.

    I have a mod that does this fine but I want to stop the showing of the download link for the mp3 lol. But I hacked at a test forum here for 4 hours and all I got from it was same as achim82. Besides this mp3player has no volume control that makes it bad IMO, I use Dewplayer and a different mod. But darn them download links.

    04/13/12, 3:18 am
  40. i know .. this is an old post last posting was on 2012.

    But i need the player.swf
    The link shown here .. it said : ” ERROR 404 – NOT FOUND ”

    anyone can provide me with a working link ??
    or maybe … email me the file ?? Thanks.

    09/04/19, 1:55 am
  41. In fact , Texas Hold’em could be learned in just a few minutes. I also such as the fact that this online bingo hall is very user friendly. Lastly we will look at two techniques and you must choose the one which you will adopt.

    10/22/19, 8:55 am
  42. Добрый день!
    Такой интересный сайт.

    Море приколов…
    На данном сайте Вы можете найти массу отзывов о компаниях
    Жми на сайт:


    10/24/19, 3:59 am
  43. nurDum

    Istanbul seks iscisi ariyorsun guncel bilgileri dogru tören yardimiyla arastirmak isaret atesin veya seksi hatun kisi metalik yanit sevisme calisma verdigi yayinlamak nesriyat duzenlemek su sayfa yardimiyla bulmak yansimak fatih sarisin escort
    escort sorgulamak guncel olgun hak tasvir sebebiyle ozlemek arz atesin veya seksi eksik etek mani bedel iliski gorev katmak internette eser gecirmek o sayfa sayesinde

    04/27/20, 10:04 am
  44. – интернет доход, заработок денег

    05/19/20, 9:34 pm
  45. check my site

    07/19/20, 9:52 pm
  46. Aw, this was an exceptionally good post. Taking a few minutes and actual effort to make a good article… but what can I say… I put things off a whole lot and don’t seem to get anything done.

    09/25/20, 11:10 pm
  47. Darrelemutt

    casino du liban evenements a venir



    casino royale movie game
    casino royale background music
    casino rewards action
    casino online revenue
    casino baden baden spielautomaten
    parimatch casino android
    slot casino lines
    70 free spins no deposit extra vegas
    casino las vegas circus circus
    joker casino promo code


    12/07/20, 1:07 pm
  48. Amazing! Its actually amazing piece of writing, I have got much clear idea on the topic of from this piece of writing.

    12/08/20, 12:09 am
  49. click here now

    12/15/20, 4:01 am
  50. It is not my first time to pay a visit this web site, i am visiting this site dailly and take pleasant facts from here daily.

    12/19/20, 7:18 am
  51. What’s up, its nice piece of writing regarding media print, we all understand media is a wonderful source of information.

    12/19/20, 10:51 am
  52. I’ve learn some excellent stuff here. Certainly price bookmarking for revisiting. I surprise how a lot attempt you put to make this type of fantastic informative site.

    12/22/20, 3:01 am
  53. visit this page

    01/01/21, 12:55 pm
  54. from this source

    01/01/21, 1:04 pm
  55. click site

    01/01/21, 1:12 pm
  56. Click This Link

    01/05/21, 1:08 pm
  57. Hi there everyone, it’s my first go to see at this web site, and paragraph is truly fruitful in favor of me, keep up posting these articles or reviews.

    01/28/21, 8:55 am

Leave a Reply

Your email address will not be published. Required fields are marked *

anti fatigue mats