Jun 27
WP-eCommerce Gold Cart Plug-In Hack
A friend of mine asked if I could help him out with a project he was working on. He had a client who was trying to sell some products online and the previous developers gave him exactly what he asked for. And unfortunately all they asked for was a way that their visitors could fill out a form to purchase a product. They didn't ask for the ability to view orders, update products, customer data retention, etc.
The problem was that the client really wanted a shopping cart. Something that he could use to manage his business, but because my friend and his client are a little new to the online world, they didn't specify what they wanted to the developer. And unfortunately this developer didn't take any initiative to offer additional options and suggestions.
So I took a look at the website and I realized what the developer had done, which to say the least, wasn't a lot. They basically had a form, and a PHP page that processed the form data. They didn't even take the time to e-mail the customer a receipt. Sheesh. Oh well, I told my friend that I'd look around and see if there was an off-the-shelf PHP solution that could help them out. I'll be the first to tell you that I do not specialize in coding in PHP. My background is ColdFusion, but I've done a few little PHP sites in the past and to be quite honest, I'm not scared to dive into PHP and figure something out. I have a theory, and that's if you know programming logic, you can pretty much program in any language as long as you have good reference material. Hello Google!
Read more...
Jun 24
JQuery Plug-In: Simple Slideshow v2.1.1
Ok, I'm not perfect. My first attempt at a jQuery plug-in was a disaster. It worked great in FireFox and Safari, but it failed miserably in Internet Explorer. I should of known to do a little more testing before I released it, but it was late and I had a bunch of real work to do, so I rushed things. But as the old saying goes, if it doesn't kill you, it only makes you stronger.
In doing this re-write, I made some changes that I think fit more in line with what I was trying to do in the first place. Version 2.0 was a little more complicated than what I intended it to be, I blame this on the excitement of writing my very first jQuery plug-in.οΎ On this version I decided to follow my original mandate of keeping things simple.
Read more...
Jun 16
JQuery Plug-In: Simple Slideshow v2.0
I know, I know. There's about a gazillion slideshow plug-ins for JQuery. Trust me, I've seen em, I've used them and I've been impressed by them. But at times, the websites I'm working on, call for a simple little slideshow. That's all, nothing fancy. Just somethings that dissolves images, maybe some basic captioning and perhaps a little option to center the images or not.
A few years back, I made a little script that does just this. It was simple, had a small footprint and it did its job fairly well. The drawback was that it only allowed me to place one slideshow on a page at a time. So today I decided to re-write it and I figured while I was at it, convert it into a JQuery plug-in as well.
So let me introduce my Simple JQuery Slideshow. It has a few features you can control as well as the ability to pause a slide when a user mouseover's the cotainer.
Read more...
Jun 10
ColdFusion Components and Var Scoping Trick
Var scoping is essential when dealing with ColdFusion Components. You can get weird results or even some hard-to-track errors if you don't do this. I'm not privy as to why this happens, I just know that it does. It's one of those mysteries that I just never bothered to research. All I know, is that sometimes it's a pain in the butt, especially when your writing a fairly complex function and you forgot to var scope an "i" in a cfloop or some other quick and dirty variable you made.
Well a few months back, I started doing something with my function variables, that I thought I would share. Not only does it solve my var problem, but it winds up making the top of my function shorter (I'm a stickler for cleanish looking code). Essentially I create a generic local struct in the begining and I'm sure to var scope it, like so:
<cfset var local = StructNew() />
Read more...
Jun 4
Reason #592 why I hate Internet Explorer
My last step on any website design is to go through it and make sure that it works and look correct in the various flavors of Internet Explorer. I can't really say that the time spent doing this is blissful. I compare it to going to the dentist, because I never know what I'm going to find and when I do it's rarely good.
So today as I was debugging, what I thought was a very simple, JavaScript page. I came across one of those nifty "This method or function is undefined" errors from the Internet Explorer debugger. And as we all know, the IE debugger is as worthless as playing "I Spy" with a blind person.
So what was the problem? Well it turns out that IE doesn't like indexOf for arrays. I did a little research and I came across a fix online from Soledad Penades Blog. Basically, we need to test if the indexOf method is defined for Arrays. If not, then use the much loved JavaScript prototype function to create it, like so:
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i<this.length; i++){
if(this[i]===obj){
return i;
}
}
return -1;
}
}
Hope this helps anyone with the same problem, and thanks Soledad!
Doug said: @Nick - Yep, I re-worked it today. Check out the newer blog entry:...