Archive for the ‘ Programming ’ Category

PHP Browser Detection Script v1.6

Chris Schuld has upgraded the PHP Browser Detection Script to version 1.6 to fully support PHP5.3 – and as always I have ported it back to PHP4 :)

Download for PHP5.3

Download for PHP4.4.x (.rar | .zip)

Change Log

Calling parent window from an iframe

When loading an iframe inside your parent window using lightbox / multibox, etc you would think window.opener would be the most suitable use to call your parent window; However this won’t work in most circumstances. The following should get your out of trouble:

Read more

Things looking grim for PC release of MW2!

As the launch date gets closer and closer, IW and FourZeroTwo haven’t replied to rumors about the PC version being delayed a few weeks after the official launch date. In saying that IW may be trying to put a rush on it to get the deadline however that’s bad news for us PC heads as we’ve seen in the past with WaW; buggy, not ready for release game!

I personally would wait a few more weeks to make sure the PC version is right but game-server hosts and James Landi have their doubts as well Read more

Useful Plugins and Resources For MooTools

MooTools is a fantastic object oriented JavaScript framework; It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API. Most of us who have ever used MooTools will testify that it is as good as jQuery if not better. But if you compare the popularity levels between the two frameworks, jQuery is far ahead of MooTools.

Read more

Alternative Rows Colors With CSS and Mootools


/* load alternate row colors in a table */
function loadAltRowColors() {
if($$('table.myStyle')) {
var count = 0;
$$('tr.dynRow').each(function(elm) {
(elm.hasClass('odd') ? elm.removeClass('odd') : elm.removeClass('even'));
});
$$('tr.dynRow').each(function(elm) {
elm.addClass(count++ % 2 == 0 ? 'odd' : 'even');
});
};
};

Mootools, Ajax forms and tinyMCE

Submitting a form via ajax but using tinyMCE at the same time? Run into the problem where tinyMCE content won’t post via ajax? I may have the solution for you! ;)

Read more

PHP Browser Detection Upgraded

The PHP Browser detection script has been upgraded and ported to PHP4 from PHP5.

http://mavrick.id.au/programming/2008/the-all-new-php-browser-detection/

5 Great MooTools Plugin Resources

One of the strengths of the MooTools javascript library is that the code is so flexible. This flexibility allows almost anyone to download the core and create plugins to their heart’s content. Why reinvent the wheel if you don’t have to though? Check out these fine websites which are loaded with easy to implement plugins.
Read more

What JavaScript Is Good For

Part of making this choice is asking what you want to do with JavaScript. Let’s consider vanilla JavaScript. No framework; just plain old JS. JavaScript gives you native objects like Strings, Numbers, Functions, Arrays, Dates, Regular Expressions, and more. JavaScript also gives you an inheritance model – a somewhat esoteric model called prototypal inheritance (which I’ll talk about more later). These building blocks and the concept of inheritance are the bread and butter of any programming language and they have absolutely nothing to do with browsers or the web or CSS or HTML. You could write anything you wanted to in JavaScript. Tic-tac-toe, chess, photoediting, a web server, whatever. It just so happens that 99% of all the JavaScript out there is run in browsers and that’s what we think of it as. The programming language for browsers.

Understanding that the browser, the DOM, is just where we happen to use JS most of the time but that it’s actually a very robust and expressive programming language will help you understand the difference between MooTools and jQuery.

Read the rest at jqueryVSmootools.com

MooTools TwitterGitter Plugin

Everyone loves Twitter. Everyone loves MooTools. That’s why everyone should love TwitterGitter, a MooTools plugin that retrieves a user’s recent tweets and allows the user to format them however the user would like. TwitterGitter allows the user to choose the number of tweets to retrieve and returns an object containing the data provided by Twitter.

http://davidwalsh.name/mootools-twitter-plugin

Punkbuster Server Message Generator Upgraded

A long overdue upgrade has been completed on the Punkbuster Server/Console Message Generator for Call of Duty 4/5. I fixed a few bugs in the system that related to the comma and quotes being put within the string of the messages. Also I fixed the Select All feature and added a Save function.

The Save feature offers you a way to store your messages on a public accessible list where you will be emailed a specific link and message ID so you can edit it at a later date without having to re-enter in your messages over and over again each time you wish to make a change. Now I said publicly accessible, and yes everyones messages will display in a rotating window at the bottom of the page. This is a trial and I am open to feedback on this new system.

Be sure to check it out: COD4/WaW Punkbuster Server Message Generator v1.4

Read more

Multitude3 Stay Away Dodgy Web Host

Who would let thier host talk to them like this, Not Me!

Okay here is the first of many emails from Multitude3. Clearly this one is automated because I don’t host with these guys (and never will). I have posted the entire transcript. Read more

mooplugins.com goes beta!

The mooplugins.com website is now live for mootools developers t signup and for members to get their accounts registered. The site is still in beta but once we get a few registrations on board and test the site out and add more features along the way it will go live.

Check it out: mooplugins.com

shuffle array with keys

The php4 version of shuffle does not keep the array keys intact, here is a nifty function to add to your list Read more

php geocoding with google maps xml

A new project I am working on requires the use of Google Maps and location distances. I wrote a php function to pull apart the xml output from the Google Maps API.

Check it out here: php geocoding with google maps api