Playback Spelförening v3

I’ve been planning and working on Playback’s new site for ages but never made any real progress, but one day earlier this year after a few (pretty huge) database failures I realized: we need a new site – and we need it now!

The new system (which I call Marwin AMS) is still under development, but is stable and has enough features to be released. It’s written from scratch by me with PHP, bash scripts and a MySQL database on the backend and XHTML, CSS and JavaScript (jQuery) on the frontend. New and improved features (implemented or planned) on the site includes, but is not limited to:

  • Play-Penis Points™
  • Advanced Forums System
  • Notifications API
  • FTP / Image Uploader integration
  • Game Server Management
  • Event Planner / Calendar
  • Minecraft Statistics and Achivements
  • User Quote Database
  • Photo Gallery

Playback Spelförening is a non-profit association founded in 2008 which I’ve been the chairman of during 2008, 2009 and 2011. Our main purpose is to host LAN Parties and other gaming related events, and since most of the members are old buddies from high school, it’s a great way to keep in touch!

During 2010 Playback bought a server (to host game servers, user-uploaded files etc.), which greatly boosted the user activity online, so the main focus of the new site was to help the members to interact with the server and develop new features which integrated with our various services.

As I said above, the site is still under active development – so check back often to see our new awesome site come to life!

Internet is br0ken! Updatez plx?

Currently the site is kinda outdated and ugly looking / unoptimized, but I’d like to give it some love in the near future. I’ve tried to get a new version up for like six months now but lately the anything webdev related part of my heart have been on vacation or something so I haven’t really found the spark to do stuff. My latest work is facEngine (Frequently Abused Canvas Engine) from our project during the last weeks of the education, which is supermegafoxyawesomhot: Continue reading

Minify – compress your files on the fly!

Are you, like me, one of those who keeps JavaScript and CSS in multiple files for better structure and who don’t compress the code because you want to have the readability intact in your development environment? Well, then this script is for you!

I give you Minify, a script which combines and compress your files on the fly. This way the files get smaller and the client only have to make one request to the server. Just include the class in the top of the page, somewhere before you include your CSS/JavaScript, give it a few parameters and it will do everything for you. Now you can have how many files you want and edit whenever you want as long as you include the CSS/JavaScript file generated by Minify. Continue reading

Store your passwords in a secure way!

I was writing a basic register- and login script yesterday, and when I did the part where it hashes the password with a salt I realized that there should be a more secure way to store passwords than just running them through md5() or sha1(), so I wrote this function:

function password($password, $username, $saltglob = '2c62f9eb917de737b8184b8e5a793c89') {   
 
	/* save string length of username, password and salt */
	$userlen = strlen($username);
	$passlen = strlen($password);
	$saltlen = strlen($saltglob);
 
	/* split username, password and salt into string length + 1 */
	$user = ($userlen < 4) ? array($username, $username) : str_split($username, ($userlen/2)+1);
	$pass = ($passlen < 4) ? array($password, $password) : str_split($password, ($passlen/2)+1);
	$salt = ($saltlen < 4) ? array($saltglob, $saltglob) : str_split($saltglob, ($saltlen/2)+1);
 
	/* save ascii value of username, password and salt */
	$userval = ord($username);
	$passval = ord($password);
	$saltval = ord($saltglob);
 
	/* prepare an array of arguments and a format for vsprintf */
	$format = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s';
	$args   = array($username, $userlen, $passlen, $saltlen, $saltglob, $user[0], $user[1], $pass[0], $pass[1], $salt[0], $salt[1], $userval, $password, $passval, $saltval);
 
	/* vsprintf the arguments */
	$string[] = vsprintf($format, $args);
 
	/* rsort the arguments and run vsprinf again */
	rsort($args);
	$string[] = vsprintf($format, $args);
 
	/* sort the arguments and run vsprintf again */
	sort($args);
	$string[] = vsprintf($format, $args);
 
	/* hash each vsprintf result with md5 (raw) */
	foreach($string as $value)
		$password = hash_hmac('md5', $value, $password, true);
 
	/* hash	with sha512 (raw) */
	$password = hash_hmac('sha512', $password, $saltglob, true);
 
	/* return an md5 hash */
	return hash_hmac('md5', $password, $username);
 
}

This way, even if someone can produce a bruteforce against the algorithm they will never know where in the hash the salt pieces where placed. And of course we’ll salt it with a global salt (third parameter) which is hidden deep in a configuration file on our server, which requires the script kiddie to actually access your files to get it.

One thing’s for sure, I’ll use this for all my projects :) .

Edit: This function has been updated several times since the initial post because I like to make stuff more complicated than they actually have to be. The most recent one is the one above though (and is kinda overkill) :)

Tour 4 Dead

Tour 4 Dead is a tournament site/system for Valve Software’s two games Left 4 Dead and Left 4 Dead 2. As a logged in user you can create tournaments, create teams with other users and participate in tournaments with that team. There is also a few community features on the site such as forums, profiles etc.

This site is not finished yet, but will be in the upcoming weeks. The plan is to test the system a few months and then, if the site gets popular, expand to more games such as Modern Warfare 2 and Counter-Strike. Design is once again done by Fredrik Larsson.

Playback Spelförening v2

Playback is a non-profit gaming association which I was am the chairman of. The main purpose for this association is to host LAN Parties and other gaming related things. Since most of the members are old friends from the ninth grade, it’s also a nice way to stay in touch with each other after the “split up”.

This is one of my first released php sites so I feel some kind of proudness over it, even though it’s kind of messy and un-optimized. Design, XHTML and CSS made by Fredrik Larsson, who is the secretary of the association.

  • URL: not available
  • Released: June 6, 2008

serieous.se

serieous.se was a school project created in early 2009 by me and Fredrik Larsson; he made the design and I coded it. The site is (was) almost complete but is put on hold for the moment because we’re both busy with other stuff.

serieous.se is mainly a Swedish news site which post news and rumors about (mostly) American TV-shows e.g. Lost, Heroes, Family Guy. Around this news site we’ve build up a community with profiles, guest books, forums etc. There’s also an archive with downloadable files, an information page about every show and much more!

  • URL: not available
  • Released: March 2, 2009