Archive for the ‘ Programming ’ Category

COD 4 Punkbuster Server Message Generator v1.1

Updated the Call Of Duty PunkBuster Server Message Generator Code, added in some more in-depth explanations of how it all works and added in some tweaks and extra commands to call to have your PB Messages stream better within Call Of Duty.

COD 4 Punkbuster Server Message Generator

The all new PHP Browser Detection

UPDATED to v1.6

Detecting the user’s browser type and version is helpful in web applications that harness some of the newer bleeding edge concepts. With the browser type and version you can notify users about challenges they may experience and suggest they upgrade before using such application. Not a great idea on a large scale public site; but on a private application this type of check can be helpful. Read more

COD4 Punkbuster Server Message Generator

Managing a few COD4 servers and changing the message rotation every now and again can turn into a timely task if you need to calculate the times between messages and the overall refresh of each message. That’s why I came up with a COD4 Punkbuster server message generator.

Check it out here.

Update: http://mavrick.id.au/programming/2009/punkbuster-server-message-generator-upgraded/

mootools code examples

Check out the new and updated version of mavrick web design code examples web site.

As it stands there are a few mootools code examples of 3rd party scripts and code hacks and extensions to the mootools framework.

Soon to come are articles on php and css coding just like here at mavrick.id.au

mootools vs jquery

So, why mootools?

  1. Class support.
    JQuery’s SQL-like syntax is fine for quick and dirty javascripting, but eventually you’ll want real classes to structure your UI logic.
  2. It smells, feels and tastes like regular javascript.
    JQuery doesn’t even look like javascript, which isn’t necessarily a bad thing, since that’s kind of their goal. MooTools however, feels like just an extension of the language (more on this at point #9).
  3. Read more

MooTools Plugins Repository – Coming Soon

I am currently working on a project called: Mootools Plugin Repository. It’s the unofficial mootools plugin repository for all the mootoolers out there like me. I’ll give you a quick run-down on what we aim to achieve with the site:

  • Support for 3rd party plugins for v1.11 & v1.2
  • Project Profiles
    • Comments
    • Ratings
  • Search
    • Advanced Search
  • Member Accounts
  • Upload Previews and demos
  • Digg.com features
  • No Ads!
  • Run all by mootools <3 :)

We hope to have this up and running for you mootoolers soon.

PHP Browser Detection

Click here for the new version.

An old php class written by Gary White back in 2003 is still by far one of the best PHP Browser detection class’s I have come accross.

It should correctly identify all versions of:

  • Amaya
  • Galeon
  • iCab
  • Internet Explorer
    For AOL versions it will identify as Internet Explorer (AOL) and the version will be the AOL version instead of the IE version.
  • Konqueror
  • Lynx
  • Mozilla
  • Netscape Navigator/Communicator
  • OmniWeb
  • Opera
  • Pocket Internet Explorer for handhelds
  • Safari
  • WebTV

Click here to download browser.rar

Detect Google Chrome via JavaScript

As we all know Google has released their own web browser called: Chrome. As a web developer when I first heard about it my first thoughts where; “oh great, another browser to check for and to load certain style sheets etc etc etc”. However, that’s not the case, Google Chrome is built off the Apple WebKit just like Safari.

The only problem I for-see with Google using WebKit is that most browser detection done via javascript is going to return Safari not Chrome!

How do we overcome this?

var is_chrome = navigator.userAgent.toLowerCase().indexOf(‘chrome’) > -1;

Chrome’s full user agent:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13

JSMIN for PHP4

In my last post PHP Speedy for WordPress it only supported a php5 version of JSmin, I have sourced a php4 version for you to use in your script. I will also include an example of how to modify PHP Speedy to include this script. Read more

PHP Speedy for WordPress

If you’re not familiar with PHP Speedy and you run a wordpress blog then you should be. PHP Speedy is the ultimate tool in compressing and speeding up the load time and efficiency of your web site/blog.

I have incorporated this script into the FooBar CMS and recommend it too anyone who has a php built web site or WordPress blog with or without a lot of javascript and css includes. PHP Speedy will essentially grab all your javascript attachments and css attachments, open them, compress them (on the fly) with JSmin (php5) and then re-structure your html output to only include one attached javascript file and one attached css file, compressed and stored on your local web server ready for other potential visitors.

Sounds too good to be true? Then check it out for yourself.

PHP4 File Put Contents

Used in fooBar CMS – taken from the php.net web site in user contributed comments. This function is useful for people still running their websites on a php4 server as file_put_contents() is php5 only! Read more

Human Readable PHP File Size

Human readable PHP file size description function. Read more

PHP Time Since

Forum type time since function. Read more

Ultimate PHP Escape String

Handy to have, taken from fooBar CMS. Read more

PHP Check Email

A nifty little php email checker. Can be used for registrations or newsletter systems as well as an imap script used to receive email. Read more