Saturday, January 17, 2009

The Worst Christmas Present Ever

It's hard to understand my father. On top of his regular psychosis, he also is disadvantaged when it comes to present giving. He never really understood the old adage: "It's the thought that counts." Instead, he compulsively buys random items like dolls and candy; anything as long as its at a discounted price, and give them away as presents. This year, however, my father truly outdid himself. This year, I received a Miller Lite Talking Beer Opener, as seen below. It has the wonderful feature that every time you want to relax with a bottle of beer, some cartoony voice actor announces proudly "IT'S MILLER TIME!," followed by the sound of some imaginary beer filling up a glass.

As charming as that is, I have to say I prefer my bottle openers to not talk. Now, you may be thinking that I particularly like Miller. You could not be farther from the truth. "Well," you say, "maybe you mentioned needing a beer bottle opener." That is just an outright lie! I have two bottle openers, and I don't even drink often enough to notice.

It gets better, however. The picture you see is only a stock photo; the real opener has long since gone to the trash. The one I actually received had already been opened out of the packaging, then placed back inside the package. To give it that truly "loved in" feel.

You may think I'm a heartless son, that my dad did what he could and that I can't even appreciate it. The truth is that I would have been perfectly satisfied not receiving any gift in lieu of one that had no thought or consideration. A card would have been nice.

So next time you receive a lousy gift, just remember me and my talking bottle opener. "IT'S MILLER TIME! fwoooooshhhh!"

Tuesday, January 13, 2009

Easy MP3 Streaming with Attachments in phpBB3

I wanted my forum users to be able to upload mp3's and have a little flash player show up so that other users could stream them directly from the site (see screenshot).



After a few hours of scouring forums and googling, it seemed that nobody had the solution I wanted (just a bunch of less appealing alternatives). So, even though I don't know javascript or php, I managed to put together this little hack and to my surprise it gets the job done! When it's finished, you'll be able to upload an mp3, and when you click the "place inline" button, it will embed mp3's in our flash player BBCode tag.Note: If you are using something other than the default prosilver style, you will need to edit the files that are in those style folders.

Part 1: Install Flash Player
I use the Dewplayer Multi BBCode. If you want to install a different flash player, you just need to make sure you install that one and replace all appropriate references to the BBCode. Get the files and original instructions here.

1. First thing is to download the attachment in the link, unzip it, and upload the contents to your forum root (ie: /home/yourusername/public_html/phpBB3/ on a default install on a linux server running apache).

2. Next go to the Admin Control Panel >> Select "Posting" Tab >> Select "BBCodes" from left menu

3. Select "Add a new BBCode"

4. Enter the following into the boxes:

BBCode Usage


HTML Replacement


Helpline


Then select the box that says "Display on Posting Page" if you want it there for convenience to your forum users.

Part 2: The Coding Hack

There are three files that each need one small edit. I highly recommend making a backup copy of each file, something like filename_backup, in case something goes wrong and your forum becomes dysfunctional.

First file: "forum_root/cache/tpl_prosilver_posting_editor.html.php"

Edit line 121
Change from this:

To this (Ctrl+A to select All):


Second file: "forum_root/styles/prosilver/template/posting_editor.html"
Line in file: 168

Replace:


With this:


Last file: "forum_root/styles/prosilver/template/editor.js"
Function starting on line: 189

Replace this:


With this:


That should do it, you're all done! Now when you upload an mp3 file and click "Place Inline," it should wrap the appropriate URL in the dewplayer tag. Hope you find this helpful!