Writing a WordPressMU Widget

While working on a new website today, I found myself needing a widget that would show the archive list from one blog on another blog within my WordPressMU installation. Unfortunately, after a bit of Googling, I couldn’t find any that already existed. It was then that I decided to take matters into my own hands.

I started searching for tutorials on building WordPress widgets. I found some decent tutorials, and was able to put the widget together pretty quickly. However, I then realized that I needed to be able to use multiple instances of the widget, as I have more than one sidebar set up (one or the other is shown, depending on which page the visitor is viewing). Then, it was basically back to the drawing board.

Read More
AES Encryption with PHP and MySQL

Occasionally, you may find the need to encrypt information within a database. One of the standards for encryption is AES (Advanced Encryption Standard). In fact, in a lot of government institutions, AES is the required data encryption method.

At this point, I feel I need to make an important distinction. Encryption is a reversible method of masking data; not to be confused with hashing, which is supposed to be a one-way encoding method (though, many hash methods can be cracked through various types of attacks).

If you do need to encrypt your data, you have a few options when working with PHP and MySQL.

The first option is a pair of built-in MySQL functions. AES_ENCRYPT() and AES_DECRYPT() make it easy to encrypt and decrypt your data directly through a MySQL query. In order to use the AES_ENCRYPT() and AES_DECRYPT() functions, you will need to provide the data (original data should be provided to the encryption function, the encrypted data should be provided to the decryption function) as the first parameter and a 16-bit key as the second parameter. The same key will need to be used for both functions (otherwise, the decryption won’t work properly).

Read More
Google Gets in the Spirit of the World Cup

Goooooal on GoogleThanks to Benjamin Golub for sharing this (at least, that’s where I first saw it). I wonder if they’ll keep this going until the World Cup is over.

 

Read More
WordPress Password-Protected Posts

Following are a few quick tips for working with the built-in functionality to password-protect pages and posts in WordPress. WordPress allows you to add a password to any post or page, and hides the content of that entry until the visitor enters the appropriate password. Each password-protected page has its own unique password, and only one single password is used for that page (as opposed to “Private” pages, which require a user to be logged in with their own username and password for the site).

Read More
Quickbooks Online Available to the Masses

Quickbooks Online - IE6 Warning MessageUp until a few months ago, the only way to use the Quickbooks Online interface was to do so through Internet Explorer. The interface did not work at all for people using browsers other than IE, which meant that it was wholly unavailable to Linux users and Mac users (I have no idea whether it worked on Mac’s version of IE or not, but I’m fairly certain it didn’t).

Then, in October, the application was updated to begin working with Firefox on Windows and Safari on Mac. This was a step in the right direction, but still didn’t make the interface available to Linux users.

Read More
Google Fonts

Google Font LogoOne of many new features in CSS3 that has the Web development and design world clamoring is the introduction (well, reintroduction and standardization, really) of embedded fonts. Commonly referred to as the @font-face property, CSS3 will allow you to use non-standard fonts on your Web pages without having to resort to using images. Instead, you’ll upload the font file (in most cases, a Truetype Font [TTF] file) to a space on the Web, then use the @font-face property to import that font file as a resource for the page.

Read More
Reset Stylesheets

Whenever I begin slicing up a new website design to turn it into a template, one of the first things I do is to implement a reset stylesheet. The ideal reset stylesheet will essentially turn off all of the proprietary default CSS properties that browsers impose on various HTML elements. At the very least, padding and margins need to be reset, as each of the major browsers tend to implement those in completely different manners.

Read More
Three-Column Layouts

For me, it’s pretty rare that I develop fluid website layouts, so I’ve not played much with them. However, as part of a recent project, I needed a way to create a fixed-width sidebar and a fluid second column. I started searching around, and came across an old (January 2006) article from A List Apart (ALA). Although it’s old, it’s still extremely useful. It’s fairly aptly titled “The Holy Grail.”

The article explains how to create a three-column layout with fixed-width side columns and a fluid center column. For this particular application, I modified it slightly to use a two-column layout, but I’ve since realized just how powerful and useful the techniques described in the article are.

Read More
Where’d My Stats Go?

Google had a grand announcement the other day that many people probably didn’t even notice: Google Search over SSL.  If you’re not sure what this means, Wikipedia has a decent article on SSL but here’s a quick blurb:

…Secure Socket Layer (SSL), [is a] cryptographic protocol that provides security for communications over networks such as the Internet. …SSL encrypts the segments of network connections at the Transport Layer.

In English this means is that SSL protects data between your computer and the server that you’re connecting to (in this case, Google’s servers).  While I agree that securing your connection is smart for those times when you’re browsing on an unprotected hot spot, there are also some technical implications that this has on your browsing experience.  Google pages may load slower and many of the links to services that your normally get won’t appear (at least until they have SSL enabled too).

Read More
Using Javascript in WordPress Themes

If you’re planning to use javascript on your WordPress blog or website, there is one function with which you should become intimately familiar. That function is wp_enqueue_script(). It will also be helpful if you do a little bit of research into the wp_deregister_script() function, though, the only official information you’ll find about that function is in the codex information about the wp_enqueue_script() function.

Basically, this function keeps a log of all of the javascript files and libraries you want to use in your theme, makes sure you aren’t duplicating any, and then outputs them in the right order. I would recommend setting the $in_footer parameter to boolean true for all of the scripts you enqueue, as that causes WordPress to add the javascript calls to the footer of your pages rather than putting them in the header. In order to do this, though, you need to make sure that you include the wp_footer() function inside of your theme (preferably just above the closing </body> tag).

Read More