1. Post #1
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    [release]
    Features

    * Players can choose from a list of songs to stream while playing on the server.
    * Administrators can stream a song to all players
    * Players may choose to ignore server-wide songs
    * Volume control for songs playing
    * Server-side song queue is preserved through map changes
    * Nomination system to allow non-admins to vote on songs to stream to all players. (optional)
    * Easy to use web interface allows server owners to add and delete songs. Changes take effect immediately.
    * Installs in just a few minutes
    * Password protected web-interface
    * New: Players playing songs locally can enable Radio Mode to play a new song after the current song finishes
    * New: Quicksearch allows players to easily find a song they want to play
    * New: Easy to customize options including keybinds, sources, nomination limits, and more

    Requirements

    * Web readable directory on a webserver
    * PHP5 with sqlite

    Installation Tutorial Video

    One of the drawbacks of previous versions of WolfDJ was the installation of the web-side code. Here's a simple video showing how easy version 3.0 is to install.


    Screenshots

    http://release.wolfcode.net/projects/wolfdj/1.png
    http://release.wolfcode.net/projects/wolfdj/2.png
    http://release.wolfcode.net/projects/wolfdj/3.png
    http://release.wolfcode.net/projects/wolfdj/4.png
    http://release.wolfcode.net/projects/wolfdj/5.png
    http://release.wolfcode.net/projects/wolfdj/6.png
    http://release.wolfcode.net/projects/wolfdj/7.png
    http://release.wolfcode.net/projects/wolfdj/8.png

    Download

    http://release.wolfcode.net/wolfdj
    [/release]
    I've had enough requests to put it back up recently that I decided to go ahead and release the current version of WolfDJ that I've been using on my own servers for a while.
    It boasts a few new features, and I've also completely redone the web-side code to be easier to install and manage.

    Let me know if there are any bugs that need fixing or feature you'd like added.

    Props to Skapocalypse for his original gStream which both inspired me to get this started, and served as the basis for version 1.

    Also thanks to the developers of WordPress Audio Player for the flash that drives the player. http://wpaudioplayer.com/
    JumpLoader is used for the file uploads. http://jumploader.com/

    Note: If you are encountering errors, be sure that you are using the latest revision
    Revision 15

    Common Issues
    Internal Server Error
    You messed up the htaccess file. The most common problem is an invalid path to the htpasswd file. It must be an absolute path from the root. Jailed users may have trouble with this, but it is usually /home/your-username/path/to/wolfdj/admin/.htpasswd

    Something about can't find sqlite blah blah blah
    You don't have sqlite installed. You should fix that or it won't work.

    None of my files will upload!
    You haven't set the permissions for the limbo and music folders. Make sure your webserver has permissions to write to it.
    I think I did forget to mention that in the video. My apologies. Setting them to chmod 775 is usually fine.

    magic_quotes messes up a lot of stuff
    There is a php setting called magic_quotes that messes up quite a lot of functions. It autoescapes all form data. The result is that strings get double escaped when inserted into the DB, since I am also manually escaping them. Therefore, if you get errors about "couldn't unlink file asdf''''''''''''.mp3", you have magic_quotes enabled, and you should disable it. If you can't disable it for whatever reason, then try deleting all of the escaping I am doing in the code instead.


    Having trouble with a Windows webserver and sqlite? Try the following: (Thanks ColdFusion)
    1. Enable sqllite by uncommenting
    extension=php_pdo.dll
    extension=php_sqlite.dll
    in php.ini

    2. Download the windows support files for getID3 else it will silently fail
    http://sourceforge.net/projects/geti...ows%20Support/

    3. Copy the files in the zip to random folder

    4. Specifie the folder location in wolfdj\admin\lib\getid3.php
    by addeding this line to the top of the file
    define('GETID3_HELPERAPPSDIR', 'C:/Your/Folder/'); //(No spaces end path with a / )
    Reply With Quote Edit / Delete Reply United States Show Events Lua King Lua King x 8Useful Useful x 1Winner Winner x 1Friendly Friendly x 1 (list)

  2. Post #2
    Reply With Quote Edit / Delete Reply Vietnam Show Events Agree Agree x 1 (list)

  3. Post #3
    Buggzie's Avatar
    December 2009
    965 Posts
    Do you need a mirror, space and bandwidth? I can supply if you wish.
    Reply With Quote Edit / Delete Reply Australia Show Events Dumb Dumb x 2 (list)

  4. Post #4
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Do you need a mirror, space and bandwidth? I can supply if you wish.
    Not really, the SVN is small and takes up very little space. I've only uploaded 4 songs to my sample site, and don't plan on uploading more. This is designed for people to set up their own servers and manage their own song lists. If you use mine, you'll only ever have the 4 songs.

    If other people need a mirror, I'm sure they'll be grateful though =)

  5. Post #5
    GuyRun01's Avatar
    March 2011
    48 Posts
    Not really, the SVN is small and takes up very little space. I've only uploaded 4 songs to my sample site, and don't plan on uploading more. This is designed for people to set up their own servers and manage their own song lists. If you use mine, you'll only ever have the 4 songs.

    If other people need a mirror, I'm sure they'll be grateful though =)
    The uploader. Does it have MIME protection? I could theoretically upload a shell and hax ur site if it doesn't.

  6. Post #6
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    The uploader. Does it have MIME protection? I could theoretically upload a shell and hax ur site if it doesn't.
    The java applet won't accept non-mp3 extensions. You could rename the extension, but then it gets kicked out when it doesn't have valid id3 data. If you can find a way to give an exe id3 data, then have at it.

    Also, the upload forms are password protected, so normal users can't upload files anyway. Only the site owner can unless they remove the password, in which case they are opening themselves up for attack.

    Edited:

    Also, just as an added security measure, I added additional htaccess files to deny access to the tmp and limbo directories, where the files wait before they are verified and copied into the music directory.
    Reply With Quote Edit / Delete Reply United States Show Events Winner Winner x 1Informative Informative x 1 (list)

  7. Post #7
    GuyRun01's Avatar
    March 2011
    48 Posts
    Hmm...

    Code:
    [@LuaCmd:1] Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
    SEEMS to appear once the HUD dissapears. (The Player hud, not the F7 menu.)

    Aesthetically, theres double spacing before the song name, [MogzDJ] (MG) Melon Wizard - LIFEGOESON wants to play Magic
    Kinda makes it look sloppy, I've fixed it in my edited version, you might want to too.

    Menu-wise, i see NO issues at all, works perfectly except for when you only press "Add to Queue" on its own. You'll get THIS error:
    Code:
    [@wolfdj\client\cl_menu.lua:212] bad argument #1 to 'gsub' (string expected, got nil)
    Might want to fix that + Might want to add the support of Double Click being 'Add to Queue' too, so peeps don't have to waste extra time. Also done in my edited version ;P

    "You'll need to install flash for Chrome or Firefox for it to work in-game" For one, chrome COMES with flash, and two, i think Steam uses its own rendering now, WebKit, you can always install it by using "Flash for Other Browsers" on the site, but I seriously think that it uses its own now, correct me if i'm wrong.

    Made myself a Web-Play app myself, lol. My own streamer etc, found at my site; http://mogzgaming.co.uk/misc.php?page=jukebox
    Looks shabby, but does the job.

    Good piece of kit. +1 Internetz.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Friendly Friendly x 1 (list)

  8. Post #8
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Yeah, not sure about the LuaCmd error. I've noticed it popping up recently. It seems to happen when the song changes while the menu is minimized. I'll see if I can track it down.

    I think the forums ate your spaces. The extra spaces are before the song name you say?

    Mind pasting your double-click code? It would save me some time.

    The flash thing is just from experience. Although it does use it's own webkit-based rendering engine, it seems as though installing flash for either firefox or chrome fixes any issues. Again, this is just from limited experiments and what has proven to fix people's problems.

    Nice web app. I made one myself: http://terminalshell.com/dj
    I need to modify the interface to use jumploader, since I wrote the fancy easy-to-use version after I made my get-it-done-quick version for my personal use =P

  9. Post #9
    Lolololololooooooooooo! La la la-laaaaaaaaaaah, la la laaaaaah, lol, haha.
    ^seth's Avatar
    January 2011
    294 Posts
    It looks useful. :frogbon:
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny Funny x 1 (list)

  10. Post #10
    GuyRun01's Avatar
    March 2011
    48 Posts
    Yeah, not sure about the LuaCmd error. I've noticed it popping up recently. It seems to happen when the song changes while the menu is minimized. I'll see if I can track it down.

    I think the forums ate your spaces. The extra spaces are before the song name you say?

    Mind pasting your double-click code? It would save me some time.

    The flash thing is just from experience. Although it does use it's own webkit-based rendering engine, it seems as though installing flash for either firefox or chrome fixes any issues. Again, this is just from limited experiments and what has proven to fix people's problems.

    Nice web app. I made one myself: http://terminalshell.com/dj
    I need to modify the interface to use jumploader, since I wrote the fancy easy-to-use version after I made my get-it-done-quick version for my personal use =P
    Code:
    Stream.MusicWindow.DoDoubleClick = Stream.QueueButton.DoClick
    cl_menu.lua (line 215 - after my edits, just after Stream.QueueButton.DoClick's function() )

    Code:
    Stream.QueueWindow.DoDoubleClick = Stream.RemoveButton.DoClick
    cl_menu.lua (line 237 - after my edits, just after Stream.RemoveButton.DoClick's function() )

    Edit:

    Just noticed, i ONLY have ONE song on that list, yet its returning TWO in the title:



    Any ideas why It could do that? It's not my site coding, v2 worked fine with it. (Yeah, your OLD one, the one with the site that allowed anything to be uploaded :P and was only in black and white, the one that used wolfdj.sqlite. I converted it to mysql. lol)

    Edit:

    I'll add another song. See if it DOES still do it, or if its to do with only one song being on. If it hops to 3, i know somethings up.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  11. Post #11
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Added doubleclick functionality. Thanks.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  12. Post #12
    ColdFusion's Avatar
    December 2009
    2,227 Posts
    all songs seem to do this

    I just checked and all files seem to arrive properly to the server.


  13. Post #13
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    all songs seem to do this
    Where are you getting your mp3's from? They need to be valid mp3's with metadata.

    If you REALLY want to bypass this, I just added an optional constant to limbo.php in /admin/.
    Set REQUIRE_METADATA to false, and it will only check the playtime_string metadata. If it is a valid mp3 file, it really needs to have playtime_string.

    Pull the latest revision if you want to play with the REQUIRE_METADATA option, but my advice would be to make sure you are using genuine mp3's, and not some shitty youtube rip or something. (No offense)

  14. Post #14
    ColdFusion's Avatar
    December 2009
    2,227 Posts
    Where are you getting your mp3's from? They need to be valid mp3's with metadata.

    If you REALLY want to bypass this, I just added an optional constant to limbo.php in /admin/.
    Set REQUIRE_METADATA to false, and it will only check the playtime_string metadata. If it is a valid mp3 file, it really needs to have playtime_string.

    Pull the latest revision if you want to play with the REQUIRE_METADATA option, but my advice would be to make sure you are using genuine mp3's, and not some shitty youtube rip or something. (No offense)
    I tried like 10 of them and 0 worked, all comming from different albums and sources.

  15. Post #15
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    I tried like 10 of them and 0 worked, all comming from different albums and sources.
    See if the REQUIRE_METADATA works. Also, can you link me one of those mp3's? It's possible they are using a different id3 version. I'd like to check them out.

    Any ideas why It could do that? It's not my site coding, v2 worked fine with it. (Yeah, your OLD one, the one with the site that allowed anything to be uploaded :P and was only in black and white, the one that used wolfdj.sqlite. I converted it to mysql. lol)

    Edit:

    I'll add another song. See if it DOES still do it, or if its to do with only one song being on. If it hops to 3, i know somethings up.
    If I had to guess, I'd say that the song list is returning an extra \n. Can I have the link to you song list please?

  16. Post #16
    ColdFusion's Avatar
    December 2009
    2,227 Posts


    Disabling the metadata check doesn't seem to help.

    Note: It might be IIS

  17. Post #17
    GuyRun01's Avatar
    March 2011
    48 Posts
    See if the REQUIRE_METADATA works. Also, can you link me one of those mp3's? It's possible they are using a different id3 version. I'd like to check them out.



    If I had to guess, I'd say that the song list is returning an extra \n. Can I have the link to you song list please?
    http://jukebox.mogzgaming.co.uk/gmod/songlist.php

    If ya perhance DO find out that it's to blame, I wouldn't have the foggiest how to fix it.

  18. Post #18
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Coldfusion, can you link me to one of those MP3's so I can take a look?

    GuyRun01, it was a trimming issue with songlist.php. Latest revision fixes it.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  19. Post #19
    GuyRun01's Avatar
    March 2011
    48 Posts
    Coldfusion, can you link me to one of those MP3's so I can take a look?

    GuyRun01, it was a trimming issue with songlist.php. Latest revision fixes it.
    Can't ya post meh the code, my versions a leetle edited. xD

  20. Post #20
    ColdFusion's Avatar
    December 2009
    2,227 Posts
    Its probably an error on my side. But here have this funky song anyway

    http://cold.netburst.co.uk/file/Aloe...A%20Dollar.mp3

  21. Post #21
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Can't ya post meh the code, my versions a leetle edited. xD
    Code:
    <?php
    # WolfDJ 3.0
    # Display the list of available songs
    require_once 'admin/lib/DB.php';
    $filter = (isset($_GET['filter'])) ? trim($_GET['filter']) : '';
    $songs = GetSongs( $filter );
    $output = array();
    foreach($songs as $row)
    {
    	$artist = str_replace('-','_',$row['Artist']);
    	$title = str_replace('-','_',$row['Title']);
    	$playtime = $row['Length'];
    	$file = md5($row['ID']);
    	$output[] = "$artist-$title-$playtime-$file";
    }
    echo implode("\n",$output);
    ?>
    Edited:

    Its probably an error on my side. But here have this funky song anyway

    http://cold.netburst.co.uk/file/Aloe...A%20Dollar.mp3
    I downloaded and uploaded the mp3, and it worked fine for me. My guess would be that IIS is doing something funky, which is odd, since the id3 libs should work regardless of the web-server....

    Edit Did a little research. IIS does screw with the ID3 tag access.... Searching for a workaround

    I might just make a fully manual form sometime soon. Slammed with work at the moment.
    Reply With Quote Edit / Delete Reply United States Show Events Lua King Lua King x 1 (list)

  22. Post #22
    GuyRun01's Avatar
    March 2011
    48 Posts
    The player doesn't seem to be playing songs with spaces in them. Any idea why?

    :L

  23. Post #23
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    The player doesn't seem to be playing songs with spaces in them. Any idea why?
    Are you modifying my script? The output can't contain dashes (-) except to delimit fields.

    The format should be Artist-Title-Min-Sec-Hash. Your songlist.php is all screwed up....

    Edited:

    Still no hashes. You should have an md5 hash of the ID as the last item on the line

  24. Post #24
    GuyRun01's Avatar
    March 2011
    48 Posts
    Are you modifying my script? The output can't contain dashes (-) except to delimit fields.

    The format should be Artist-Title-Min-Sec-Hash. Your songlist.php is all screwed up....

    Edited:

    Still no hashes. You should have an md5 hash of the ID as the last item on the line
    Yeah, my system is MySQL based, so totally different, i REALLY need some help converting my songlist.php geh. PHP is not my favourite/best language unfortunately.

  25. Post #25
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    I shouldn't be helping you debug your own code when you branch away from mine, but I'm feeling nice.

    In admin/lib/DB.php
    Code:
    function getSongs( $filter=null )
    {
    	$output = array();
    	if (empty($filter)) 
    	{
    		$sql = "SELECT * FROM `songs` ORDER BY `Artist` ASC, `Title` ASC";
    		$r = mysql_query($sql);
    		while($row = mysql_fetch_assoc($r)) $output[] = $row;
    	} else { 
    		$filter = mysql_real_escape_string($filter);
    		$sql = "SELECT * FROM `songs` WHERE `Title` LIKE '%$filter%' OR `Artist` LIKE '%$filter%' ORDER BY `Artist` ASC, `Title` ASC";
    		$r = mysql_query($sql);
    		while($row = mysql_fetch_assoc($r)) $output[] = $row;
    	}
    	return $output;
    }
    Leave the songlist.php file as it is defined in revision 8
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  26. Post #26
    GuyRun01's Avatar
    March 2011
    48 Posts
    I shouldn't be helping you debug your own code when you branch away from mine, but I'm feeling nice.

    In admin/lib/DB.php
    Code:
    function getSongs( $filter=null )
    {
    	$output = array();
    	if (empty($filter)) 
    	{
    		$sql = "SELECT * FROM `songs` ORDER BY `Artist` ASC, `Title` ASC";
    		$r = mysql_query($sql);
    		while($row = mysql_fetch_assoc($r)) $output[] = $row;
    	} else { 
    		$filter = mysql_real_escape_string($filter);
    		$sql = "SELECT * FROM `songs` WHERE `Title` LIKE '%$filter%' OR `Artist` LIKE '%$filter%' ORDER BY `Artist` ASC, `Title` ASC";
    		$r = mysql_query($sql);
    		while($row = mysql_fetch_assoc($r)) $output[] = $row;
    	}
    	return $output;
    }
    Leave the songlist.php file as it is defined in revision 8
    Are you online in Steam? Would like to talk.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Winner Winner x 1 (list)

  27. Post #27
    botuts's Avatar
    March 2011
    45 Posts
    I get an error on every wolfdj page.

    "Notice: Use of undefined constant DB_PATH - assumed 'DB_PATH' in C:\xampp\htdocs\wolfdj\admin\lib\DB.php on line 6"

    How can i fix this?

  28. Post #28
    ColdFusion's Avatar
    December 2009
    2,227 Posts
    Disable php notices.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Friendly Friendly x 1 (list)

  29. Post #29
    botuts's Avatar
    March 2011
    45 Posts
    Disable php notices.
    thanks :)

  30. Post #30
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    I get an error on every wolfdj page.

    "Notice: Use of undefined constant DB_PATH - assumed 'DB_PATH' in C:\xampp\htdocs\wolfdj\admin\lib\DB.php on line 6"

    How can i fix this?
    Forgot a quote around the define argument. Fixed now as of r9.

  31. Post #31
    botuts's Avatar
    March 2011
    45 Posts
    Also is there a way to fix the Invalid mp3 problem, because i'm getting that on every song i try.

  32. Post #32
    ''just wondering''
    Keegs's Avatar
    December 2008
    2,812 Posts
    Recommend Free Web host to try this on?

    Maybe it's just me but I'm failing to get this working on the current one I'm trying.

  33. Post #33
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Also is there a way to fix the Invalid mp3 problem, because i'm getting that on every song i try.
    Apparently the issue has to do with IIS not allowing PHP to read the MP3 metadata correctly. (Hehe 3 letter acronyms). So even though the MP3's are actually valid, the server kicks them out. I will work on an override right now. I'll post back when it's done.

    Edited:

    Alright, as of r10, if you are having trouble with the server kicking out all of your mp3's, set the REQUIRE_METADATA constant at the top of admin/limbo.php to false.

    This will allow any type of file to be uploaded, and you can manually set the title, artist, and song length. Be aware however, that any type of file can be uploaded in this case, including malicious ones. The directory is password protected still, but this does remove a layer of security, so only enable this feature if you have to.
    Reply With Quote Edit / Delete Reply United States Show Events Winner Winner x 1 (list)

  34. Post #34
    Gold Member
    Fleamonji's Avatar
    April 2010
    627 Posts
    Looks nice, much nicer than before. But wait, if there's a system to approve/deny music, why do you have to log into the admin area to upload? Sorry, I am confused.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)

  35. Post #35
    Gold Member
    Zargero's Avatar
    January 2010
    286 Posts
    Can anyone Skip and remove songs from the queue?
    Also very nice i got it setup in like 10 mins

  36. Post #36
    GuyRun01's Avatar
    March 2011
    48 Posts
    Can anyone Skip and remove songs from the queue?
    Also very nice i got it setup in like 10 mins
    Only Admin + Or those defined within the DJ Table.

  37. Post #37
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Looks nice, much nicer than before. But wait, if there's a system to approve/deny music, why do you have to log into the admin area to upload? Sorry, I am confused.
    The website side of things is password protected because anyone who has access can upload and delete songs. If it was open to the public, some random person could log on and delete all the songs.

    The confirmation step is used for two things. Vanilla WolfDJ uses it for the person uploading to confirm the songs they uploaded, and to double check that all the songs are saved with their proper names and artists. Not all mp3's have 100% valid metadata describing the title and artist, etc, so it bring you do a form where you can manually change them. It also allows you to change you mind.

    Also, if you wanted to make a public form for uploading music, then anyone who wanted to could upload a song, and then only an admin could approve the songs and add them to the database. This functionality isn't provided in WolfDJ by default, however it would be very easy to implement.

    For those of you who want to do this, make a copy of admin/upload.php somewhere public, and change the uc_uploadUrl parameter of the applet to point to uploadHandler.php under admin. If done correctly, anyone can upload a song using the same JumpLoader interface, but they won't get added to the DB until someone confirms them. It should be fairly simple to do.

    Edited:

    Only Admin + Or those defined within the DJ Table.
    Yes, by default you have to me admin or superadmin to Add, Skip, or Remove songs from the server queue.

    There is a function called HasDJRights in both config files. (As of r11. Previous revisions only had it in the sv_config. You should put it in both if you want to change the functionality.) Return true from that function to allow players to add, skip, and remove. It has some examples in the config file.

  38. Post #38
    botuts's Avatar
    March 2011
    45 Posts
    ok i finally got everything working except gmod. Came across these Lua errors when it was trying to load/refresh the songs.

    "Timer Error: [lua\includes\extensions\string.lua:146] attempt to index local 's' (a nil value)
    Timer Error: [lua\includes\extensions\string.lua:146] attempt to index local 's' "


    Theres probably an easy fix this, but i have no idea how to work with Lua. :(

  39. Post #39
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Can you paste me your songlist.php URL?

  40. Post #40
    Gold Member
    Fleamonji's Avatar
    April 2010
    627 Posts
    Without looking at the code, and based on that error, s is nil. I'm assuming s is song, so could you just add a check to see if it's nil?

    if !s then return end
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)