Exposition
in the late afternoon on Saturday, the 19th of July 2003 by Chad
Here is the link for the Windows Media Player 9 - Currently Playing modification for the B2 blog. (Right click Save As on the link, or else you will probably just get a button to stare at!)
What this does for bloggers using B2, Internet Explorer, and WMP9 with the Blog Plugin to add to their blog entry just what song is playing as you edit.
Example follows:
Currently Playing :: Freak On A Leash :: 04:15 :: Korn
INSTRUCTIONS: Simply save the text file above in the b2-include folder as music.php. Then, in the b2edit.form.php file, add the following line:
<?php include(’music.php’); ?>
in between the other buttons. I currently add it between the spellcheck button code and the upload a file/image code, so that section will look like this:
ton” value=”Spellcheck” onclick=”DoSpell (’post’,'content’,”);” class=”search” tabindex=”9″/>
<?php } ?>
< ?php include(’music.php’); ?>
<?php if ( ($use_fileupload) && ($user_level >upload_minlevel) && ((ereg(” “.$user_login.” “, $fileupload_allowedusers)) || (trim($fileupload_allowedusers)==”")) ) { ?>
This loads an unsigned ActiveX control. It is wscript.exe, so you have to have Windows Scripting Host installed. There is no way to read the registry from Javascript without it. So you’ll need to do the following to your security settings. In Tools/Internet Options/Security/Trusted Sites/Sites, add your website that you edit the blog on. You will still get a security warning but you can get past that by clicking Custom Level and changing Initialize and Script ActiveX controls not marked as Safe from Prompt to Enable.
Its setup so that it uses a CSS class called music. You can also change things to use a DIV tag, or even always include the song by modifying your Blog This button to call displaySong() before it gets to submit.
The code I use is a modification to the sample code available from the Microsoft site listed above…
![]()
![[del.icio.us]](http://pirate-king.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://pirate-king.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://pirate-king.com/wp-content/plugins/bookmarkify/facebook.png)
![[MySpace]](http://pirate-king.com/wp-content/plugins/bookmarkify/myspace.png)
![[Sphere]](http://pirate-king.com/wp-content/plugins/bookmarkify/sphere.png)
![[StumbleUpon]](http://pirate-king.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://pirate-king.com/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://pirate-king.com/wp-content/plugins/bookmarkify/windowslive.png)
![[Email]](http://pirate-king.com/wp-content/plugins/bookmarkify/email.png)

July 20th, 2003 at 11:46 am
This post has been updated. Now, instead of making many changes to the b2edit.form.php file, you just add a new file and add a single include line. This is more inline with the guidelines for b2 modifications. It also makes this much more generic for use with other blogs. All you would need to do is change the line:
document.forms[0].content.value = document.forms[0].content.value + strDisplayString;
to change the word content in each case to the field name that you want the song to go.
September 9th, 2003 at 3:58 am
I only have a b2edit.php file, but no b2edit.form.php file….
How do I do it then?