I tried not to toy with it too much, i could see some areas were “in progress” so to speak…
The point of moving the code into a class is that you avoid the need to do any..
if( function_exists() )
…checks around your functions..
Ideally you should have just one around the class name..
if( class_exists() )
etc...
Although neither is a requirement, it’s always a good idea to check a function or class does not exist before declaring one, functions inside a class are less likely to cause naming conflicts though, because they are part of the class, and not regular named functions.
Additionally class functions can be marked as private, this means that particular function can only be called inside the scope of the class (ie. only another function in the class can call the function). Small things like this can be really handy if you want to write a function that can only used inside the context of the code you’re writing (ie. inside the class).
If you get stuck on something else, post back, i don’t mind helping if you need suggestions or guidance.