skip to content

DerekAllard.com : CodeIgniter, ExpressionEngine, and the World of Web Design

Inspired by Lightbox: Anatomy of a Modal Window

April 11th, 2007

Ugh... that just might be the worst title I've ever written...

For a "ultra-top secret"™ web application I've been working on, I need to take all focus away from the browser screen, and allow/force the user to interact with a window before being able to continue. Commonly, these are called modal windows, and gained some credibility for having practical uses with Lokesh Dhakar's wonderful Lightbox script (incidently, I use a variation of it on this script on DerekAllard.com).

There are many variations of modal windows running around, but I wanted a simple, unanimated "overlay" would would require a user's interaction, so I set about to build my own. The first thing I needed, was an alpha transparent div to sit on top of the whole screen. I stole was inspired by Matthew Pennel's great article on Easy Cross Browser Transparency, and began building from there. The ultimate alpha transparent solution I chose was a pure CSS base.

Not so useless! image_to_text() as a CAPTCHA

April 10th, 2007

This entry is guest-posted by CodeIgniter programmer Alexander "Iksander" Springmeyer, who contacted me about a unique use of my "Most Useless CodeIgniter Helper Ever". I've asked him to write up a few words, that I present here for all. My sincerest thanks to go Alexander for looking for new ways to implement old ideas, and for teaching an the old image2text() dog a new trick!
-Derek

Some time ago I happened across Derek's blog post on the 'useless' image2text helper he had created. Despite all the "it is useless" comments in the entry, I felt it had powerful possibilities offered by its application in my Sentinel re-write and upgrade of the Freak Auth light authentication system (by Daniel "danfreak" Vecchiato). [editors note: if you want to, you can read a very long and detailed account of its evolution.]

I was inspired to use it for a CATPCHA. Here's how did I do it?

Code Igniter in the Real World : Part 2

February 27th, 2007

I posted earlier about an article that James Nicol had up on this blog.  The long awaited (well, long awaited for 6 days) article is now up, Real world apps with CodeIgniter: part II.  Clever title!

He delves deeper into the black art of Code Ingiter, and discussing integrating with third party systems, validation, and my favourite understatement of the week.

Before we even went live the clients came back asking for more features...

<sarcasm>What!?!  That hardly ever happens!</sarcasm>

At any rate, its a great read, and I hope James keeps writing!

Code Igniter in the Real World

February 21st, 2007

Code Igniter programmer, and good friend, James Nicol has written up a wonderful summary of his experience using Code Igniter in a production environment that he's called "Real world apps with CodeIgniter: part 1". His company developed a scheduling and logisitics management application for one of the candidates for the next US federal election (he isn't saying whom yet). His solution included building in table relationships, dynamic PDF generation, AJAX and javascript effects and CI used in a real-world app.

Finding the Second Highest Value with SQL

February 12th, 2007

For a project I'm currently working on, subscribed users get up to the minute most current information (as outlined by a date field in MySQL).  Unsubscribed users get the information still, only it is a day behind. 

Due to the way the information is going into the system, there could be multiple entries for one date, and then no entries for a few days, then new, etc.  Basically, the information cannot be predicted by the application.  Retrieving the most recent date is trivially easy with a MAX command, but there is no "almostMAX" command, so I found myself staring at the screen wondering what the most efficient way to approach this was.  Here's my solution:

SELECT * FROM table GROUP BY dateIssued ORDER BY dateIssued DESC LIMIT 1,1

Fortunately for me, LIMIT accepts offsets, and I can specific to grab only the second entry.  If you can think of a more elegant way to do this (or heck, if you just want to comment), please leave a note below.

Passing Disallowed Characters through the URL in Code Igniter

December 30th, 2006

One of the very nice things about CodeIgniter (and really all the PHP frameworks I've looked at) is the built in security tools. For example, CodeIgniter automatically cleans cookies, sessions, user input and URLs in addition to coming with a host of other built in tools to make your job in securing your application as easy as possible. But, like all good things, there is a trade off. In the case of security, the trade off is convenince. The more secure, the less convenient. Since security isn't really something we can compromise on, clever developers need to find alternate ways of implementing common things. CodeIgniter for example limits the characters that one can use in a URL to letters, numbers, and "~, %, :, _ and -". A good collection sure, but what if you need to pass other characters, such as "(, ), =" or even spaces? Here's how I did it.

Building an RSS Feed in Code Igniter

December 03rd, 2006

I've had a few requests asking how I built my RSS feed since I'm using a custom built Code Igniter blogging system. Actually, it was pretty straight forward, but I thought I'd take a few moments to outline step by step how I did it.

Top 10 SQL Performance Tips

November 19th, 2006

Hmm... lools like my love affair with SQL related posts continues.

MySQL has posted an excellent resource posted called Top 10 SQL Performance Tips. Although, it is kind of a misleading name, since its a wiki, and everybody is able to post. Currently it's up to 84 tips, most of which look really great. Here is a small sampling...

Writing SQL with HAVING vs WHERE clauses

November 14th, 2006

UGH! So apparently I need one of those Matrix-style brain implants to help me remember SQL.

I'm writing this down now as both a personal reminder... and maybe I'll save you from the same fate. When writing the archive for this blog, I wanted to create friendly URLs, so that /blog/archive would display all posts, /blog/archive/2006 would show all of the posts from 2006, and finally /blog/archive/2006/11 would show all of the posts from November of 2006. Simple enough right?

Tips for Getting Started Building an Application Using Code Igniter

November 06th, 2006

When I originally released BambooInvoice I learned a lot about trying to code for a site specific goal, and coding for a mass audience. I originally wrote these tips on the Code Igniter forums, but since I was recently asked for advice again, I thought I'd repost them here. The original thread is still active.

Since I released BambooInvoice I've received a number of interested emails from developers looking for tips on getting started building an application using code igniter that you intend to widely distribute. Here is a small collection of useful processes.

 <  1 2 3 >

Derek Allard

I'm Derek Allard, a programmer, author, and award-winning instructor. I'm also a Technology Architect at EllisLab, and the programmer behind BambooInvoice, a simple, Open Source, web-based invoicing application. [ more about Derek ]

Recent Archives

Categories