Kevin Pirnie' Articles

UPDATE 2.0!!! Wow, just realized it's been awhile since i posted anything... well kiddies, time for some new code. Although I have grown up loveing, carressing, and mutilating Visual Basic, I have decided to take a stab at some C# since most of my projects lately have comes across in the form of PHP.  While I do love VB still, I am starting to fall hard for some C# sexyness (<- spelling). I have a VB version of what I am about to post as well, and though the language structure is different, there really aren't very many differences between the 2.  I thought I may get some sort of performance boost out of this "conversion" but alas, I was mistaken.  Both languages performed admirably… Read More
This is a neat and tidy way to have multiple TLDs for one installation of MODx. Within MODx Go to System > Contexts and Create New for each domain. Name each one using camelCase (e.g. websiteOne) as you can't use spaces here. This name will be seen in the site tree within the Manager and you will also refer to it later on. Once finished refresh the manager and they will appear down the left. Right click each one and then Quick Create > Document Here to make a home page. Add a small piece of text on each of the pages so when you test you know it's reaching the right destination. Now add content settings by clicking on each heading and add the following: site_start –… Read More
Hey folks, since PDO is taking over, I figured it was prime time for me to jump the bandwagon of direct db access, and take the plunge into PDO.As a result, I have built myself a nice and simple PDO Wrapper class and some extra functions to do all the work that one would need to do against a MySQL database.So we are going to split this up into the 2 files I have setup for my testing and environment, all are commented, and if you 'do not get it', well, maybe you should seek other hand holders to guide you through the basics of programming for the web ;-PWithout any further ado: db.class.php <?phpclass o7thDB { /* ------------------------------------------------------------------ */ // Public Properties /* ------------------------------------------------------------------… Read More
Today, boys and girls we'll be talking about how to do a Zip Code Radius Search in MySQL; how to set it up, and how to use it.This has been tested in MySQL 5.1+, so please do not try it in anything lower than this, because it probably will not work.Now, you may ask... 'Why do I need a ZipCode Radius Search?', even though I do not know the answer to your question, I do know why I needed it.  Simply put as a store locator service for a client.  Since there are a few ways to do this, I will only be showing you how I did it (as I found and tested other methods, this method seemed to be the most accurate while… Read More