Aaron Harp

30Aug/0856

PHP Scaffold Class

Update: This class has been released and is now available for download.

I've done web development for quite some time now and I hate writing CRUD as much as the next guy.  As a developer your goal should be to not ever write the same code twice.  But when creating CRUD systems for different projects this is impossible.  You always find yourself doing the same thing, over and over again.  Most coders have been enticed by Ruby on Rails's "weblog in 15 minutes" screencast.  There are also PHP frameworks that boast the same functionality.  I've never had the desire to learn any of these systems and, honestly, EzSQL teamed with Smarty gets the job done quite nicely.

A few years ago I ran across this article and ever since I have been building on the ideas presented to create an extremely powerful PHP Scaffold Class that I have used in numerous production sites.  In it's simplest implementation, all you do is pass the table name to the class and the scaffolding is created based on the table's structure.  Over time I've added functionality for table relationships, image uploading and resizing, and more.

I imagine this class could be very useful to the PHP community.  I plan on refining it further and eventually making it available to the public.  My purpose in writing this post is to find out if there's any interest in this sort of thing and to see if, and how much, people would be willing to pay for a license to use it.  Your feedback is welcome in the comments below.

Features

  • Parent/Child relationships
  • Image uploading and resizing
  • Thumbnail generation
  • WYSIWYG text fields
  • Disable certain actions (show, add, edit, or delete)
  • Handles SET or ENUM fields as select boxes
  • Sort by any of the columns
  • Pagination
  • Hide different columns from the listing table or from all views
  • Automatic recognition and handling of created and modified date fields
  • Extremely flexible

Demo

I've setup an example of a simple store backend to show its functionality.  You can view the code and database structure by clicking the links at the top.  Here is an example of a frontend that has been built on top of a backend powered by this class.

Filed under: Technology 56 Comments
10Jul/0813

WordPress Plugin: Manageable

I was recently motivated by a certain post about a plugin competition to put my nerdiness to good use and create a plugin that will (hopefully) be useful to my fellow WordPress-ers.

Whenever I have to go in and edit multiple posts or pages on my site, it always drives me nuts having to open each page, scroll down and find the box I'm looking for, make the change, click save, go back to the listing page, find where I was, and repeat.  I know we're just talking about a few extra clicks, but in cyberspace a few extra clicks is like trudging through a mosquito infested swamp.  Maybe not.

Manageable is my remedy.  Basically, you can edit all of the data related to a post or page (all except the actual content) using a simple Ajax interface.  This means you never leave the management panel.  So check it out and let me know what you think.  And if you're so inclined, you can vote for it here.

30May/086

I Hate Oil

This is absurd.  The Ford Model T got 13-21 mpg.  That was in 1908.  One hundred years later vehicles average 30 mpg.  I have a hard time believing that all the brainiac scientists out there aren't smart enough to figure out how to get at least 80-100 miles to a gallon.

Take the computer.  The first computer I remember having had a 286 processor with 1mhz clock speed.  22 years later I'm running a dual-core 2.2ghz processor.  That's a 219,900% percent increase (439,900% if you count both cores).  Over 100 years fuel efficiency has increased by 43-131%.

In every other technological arena huge advancements have been made in the last 100 years.  Why not fuel?  Something's awry here.

Maybe Lee Raymond will give me some of his $141,000 a day.

Tagged as: , 6 Comments
13Apr/084

Great Webcam for Mac Powerbooks and iBooks

I usually don't post about technological things but I figured I should make my contribution since I regularly take advantage of the wealth of information available on the net.

Since video chat is now the thing to do, I thought I should get in on the fun.  The only problem was that I have a Powerbook G4 and there aren't too many good, cheap webcam options.  I searched the internet long and hard trying to find a consensus on a good solution but didn't really find one.  After trying multiple cameras and settings this is the setup that worked well for me:

I bought the camera from somebody on Craigslist for about $20.  It's an older model but has a decent resolution and framerate.  It has good brightness too so you can be seen even without optimal lighting.

To get it working all you have to do is plug it in and install macam.  The installion info is in the mounted disk image.  After you install the QuickTime component open up the macam application.  Click the settings button (the icon with the horizontal sliders) and copy these settings:

Macam settings for Logitech QuickCam for Notebooks Deluxe

Be sure to click "Save current Setting" in the Control menu. I found that these settings give the best results.  The compression setting is pretty critical.  If it's set on anything else the video is choppy and/or dark.  You can play around with the others.

At this point the webcam will work with Skype (and other programs I assume).  Just make sure you have the camera plugged in before loading the program.  Getting it work with iChat, however, is a little quirky.

First, download and install iUSBCam (Free trial, $9.95 to buy).  After you've restarted iChat it should detect your camera and show the camera icon by your name and buddy icon.  Click that icon and your video preview will show up.  It'll be choppy so close the window and re-open it.  This time it'll be smoother.  You'll have to open the video preview window at least once before chatting with anybody.

Now if all goes well you'll be able to video chat away.  It's quite possible you'll run into connection problems (sorry).  Here is a list of links to help troubleshoot:

http://discussions.apple.com/message...sageID=1399740
http://discussions.apple.com/thread....hreadID=121845
http://docs.info.apple.com/article.html?artnum=93208
http://docs.info.apple.com/article.html?artnum=93333
http://docs.info.apple.com/article.html?artnum=106439
http://forums.macrumors.com/archive/.../t-186585.html
http://www.ralphjohnsuk.dsl.pipex.com/index.html
http://www.panfluteforum.org/ubbthre...o=&fpart=1#563

I hope someone finds this helpful.

Filed under: Technology 4 Comments
   
WordPress Lightbox 2 by Zeo