our blog

Archive for Web Development Category

How To Add A Lightbox To A WordPress Gallery

I wanted to setup a simple lightbox photo gallery on a WordPress site (v3.2.1) and, to avoid installing a slew of plugins, I put together a little gallery shortcode function using the built-in WordPress gallery shortcode as my starting point. I’m a big fan of PrettyPhoto, so I modified the output of the gallery shortcode to include the needed rel= attribute for PrettyPhoto galleries. (more…)

WordPress: How To Change Comment Excerpt Length

I recently needed to output a list of comments and bumped into a little trouble trying to output the comment excerpt. Usually I would use the built-in comment_excerpt() function but I only needed 10 words instead of the 20 that is hard-coded. I put together a little function that I found helpful and thought I would share.

(more…)

WP e-Commerce Category Product List Shortcode

While setting up a store using WP e-Commerce (v3.8.5 at the time of development) I noticed that the Category Product List Shortcode was no longer working for me.

I cooked up a quick shortcode function using some of their product list code that will query the products by the passed category and output them using the product template. (more…)

Finding the Carrier of a Cell Phone Number in PHP

Often web apps need to send SMS messages to their users (for example: balance alerts, reminders, notifications). To send these text messages from within your app, you basically have 2 options:

1) Pay Twilio and Tropo for the use of their APIs, for roughly a penny per message.

2) Send an email directly to their carrier’s mail-to-SMS gateway – a free service most carriers provide, which will translate your email into an SMS sent to their subscribers’ phone

Twilio and Tropo are about as easy as it gets to integrate (REST-like APIs that return JSON/POX), but you pay for every single message and that can add up quickly. So #2 (mail-to-SMS gateways) starts to look pretty good.

But there’s some problems with mail-to-SMS gateways: (more…)

Facebook Graph API requires Access Token for Feed Access

On June 3rd, Facebook updated the Graph API to require an access token to pull wall post data from public Facebook pages. This change can cause scripts to stop working, so here is a quick solution to pull wall post data from public Facebook pages with an access token. (more…)

Submitting a Contact Form via AJAX From Your Facebook Page

We recently created a contact submission form on a client’s Facebook page, and were not satisfied with the default user experience. For starters, the form opened a new window, and there was no way to redirect the user back to a confirmation message on the Facebook page.

We decided to submit the form via AJAX instead, and show the confirmation message directly on the Facebook page. This way the user would not have to leave the Facebook page, resulting in a smoother user experience. We couldn’t find a good explanation of how to do this on Google, so after figuring it out I decided to go ahead and write it up.

The following example will show you how to submit a basic contact form using AJAX from within your Facebook page. All HTML and Javascript that follows should be pasted directly into the “Edit FBML” screen on Facebook.

(more…)

Free Webservice to Geocode IP Addresses Saves The Day

At Illuminati Karate we love a challenge. So when our client called needing two lists of 1500 IP addresses geocoded as quickly as possible, we rose to the occasion. With the help of PHP and a freely available web service we were able to complete the task in just under an hour. Here’s how we did it.

(more…)

10 Javascript Tricks for Better Forms

Nothing exposes the gap between web apps and desktop applications more than plain HTML forms. Fortunately, by leveraging Javascript we can start to close this gap while maintaining a consistent experience for users using screen readers and old browsers.

We’ve identified 10 ways in which normal HTML forms fall short, and dug up the Javascript and CSS code you’ll need to fix them. Although the best enhancements are so intuitive as to be unnoticed, rest assured your visitors would thank you if they knew.

Note: Many of the solutions in this list depend on jQuery, our javascript framework of choice.

(more…)