WordPress, source code, and smart quotes

Turns out WordPress tries to make your posts look a little better by swapping out all normal quotes with smart quotes. That’s great for typography, but really bad when you’re posting source code like I often do on here. Trying to run pasted code with smart quotes in it will bring PHP down [...]

SMF and StopForumSpam.com

Found a great site over at StopForumSpam.com. Over the past few weeks I’ve been checking registrations on a couple of my forums against their database. What I’ve found is that most of the registrations have been spammers and they’ve gotten the axe. But after deleting 15-20 per day I wanted a little more [...]

isDivisible function for PHP

A quick function to check if a number is divisible by another.
PLAIN TEXT
PHP:

function isDivisible($number, $divisibleBy)

    {

    if ($number % $divisibleBy == 0)

        return true;

    return false;

    }

WordPress: Get custom field function

On several WordPress projects I've needed to get the value of a custom field.  Not too difficult using the get_post_meta command, but I wanted a little quicker way.  So I now add this little function to the functions.php file on themes I'm working on.
PLAIN TEXT
PHP:

function getMeta($key)

{

global $post;

return get_post_meta($post->ID, $key);

}

Say you've got a custom field [...]

Bookmarking threads on an SMF board

This is one of those features I've been wanting to add to my photography forum for a while now, but I just got around to it this weekend.
With the addition of a database table, a new template file, a few source files, and changes to several others, my Simple Machines Forum now gives my users [...]