Self-hosted moderated chat room and liveblog project

A few months ago I contacted Brian Cook, proprietor of one of the best sports blogs on the Internet, MGoBlog. A year or so earlier I had created a userscript that improved some functionality for his site, and I thought he might be interested in building some of that JS directly into the site so it would benefit every user. Instead we ended up discussing a few other projects, including an open-source alternative for the relatively expensive moderated liveblog systems the site uses for Michigan football gamedays. These are the results of that project so far. See the project

Tagged with: , , , , ,
Posted in GitHub, HTML & CSS, JavaScript, jQuery, MySQL, PHP, Server Side Code

Bing spelling suggestions and WordPress search

I’m a truly terrible speller, so when I was testing out the search functionality on this site it became very clear to me how much I rely on Google’s spelling suggestions and how deficient any search without that feature feels. I was surprised to find that there were no existing WordPress plugins that could easily add this functionality, so I decided to see how hard it would be to implement that functionality myself. As it turns out, with the right API account a simple spelling suggest feature is fairly straightforward to build. How to do it

Tagged with: , , ,
Posted in PHP, Server Side Code, WordPress

Linking to a CodePlex project’s latest source code

CodePlex is a source code distribution platform that stacks up against the competition (like GitHub) very nicely. The one feature I found myself wishing I could find for my CodePlex projects is one that GitHub does very easily: permanent links to download the latest source code of a project. Even though this isn’t provided by CodePlex itself, it’s fairly easy to set up your own service to link to your latest code. How to do it

Tagged with: , , ,
Posted in CodePlex, PHP, Server Side Code

Create and secure your own proxy with cURL and MCrypt

JavaScript’s same-origin policy can be a pain. Of course it’s very necessary for security reasons, but sometimes you want to access a remote web service client-side, or manipulate the display of remote content in an iframe. There’s a still a way to do these things of course, and it’s to build a server-side interface for the remote site and attach your JavaScript to that. Building a generic proxy-style interface is tempting, but can be dangerous if it’s not properly secured. Luckily, securing such a system is possible and relatively simple. See it in action

Tagged with: , ,
Posted in HTML & CSS, PHP, Server Administration, Server Side Code, Try It

Getting the most out of WordPress custom fields

WordPress custom fields are a pretty nifty idea that can allow you to add custom content to individual posts, outside of the standard content area. Most examples on how to implement custom fields show fairly innocuous uses, just inserting little strings of text in various locations. However, by populating the custom field with wonderfully portable JSON, it’s possible to perform much more complex and powerful actions on individual posts and pages. See it in action

Tagged with: ,
Posted in HTML & CSS, PHP, Server Side Code, WordPress

Automated site and database backups using PHP and cron

Using cron jobs to perform maintenance tasks becomes so much more inviting once you realize you don’t have to go out and learn PERL in order to make use of them. Any server with PHP installed can run any arbitrary PHP scripts you throw its way, and with the help of powerful functions like exec() and passthru() just about any administrative maintenance task can be carried out easily, including whole site and database backups. How it works

Tagged with: , ,
Posted in MySQL, PHP, Server Administration, Server Side Code

WordPress caching and wp-cron.php

After battling with terrible response time on three WordPress sites on the same hosting account for three days, I think I’ve finally gotten to the source of the issue: the wp-cron.php file. This file is how WordPress runs scheduled tasks, and is intended to run silently in the background without affecting load times. However, as I found out, this isn’t always the case. How to fix it

Tagged with: , ,
Posted in PHP, Server Administration, Server Side Code, WordPress

Using an Ajax powered web form to update a database

As part of the preparation for my upcoming wedding to a wonderful lady, I’m in charge of building our wedding website, which we’ve decided will handle all of our RSVPs. I’m still in the process of building the RSVP form for that site, maybe I’ll do a full post about it and all its features once it’s done. But this process did give me an idea to build a more universal and flexible web form, which could easily be plugged into any LAMP environment and used to push form responses to a database using Ajax. How I did it

Tagged with: , , ,
Posted in GitHub, HTML & CSS, JavaScript, MySQL, PHP, Server Side Code