Archive for October, 2008

October 31, 2008

PHP Debugging – “=” vs “==”

I spent about 3 hours debugging my php code all over a missing “=” !!!

One “=” is a variable assignment, and two “==” is a test condition. Something like…

$var = false;   // a boolean variable, assign a value of false

if ($var == true) { do something } ;

But what I was doing instead was …

if ($var = true) { do something } ;  // Ie, one “=”

The affect of doing this is the variable $var is being assigned the value of “true”. PHP doesn’t give you an error or a warning even though it actually doesn’t make sense to do an assign value in a conditional test!! So I spent 3 hours in frustration trying to figure out where in my code my variable is mysteriously being changed back to true when it should be false ! Aaargghhh.

End of vent.

October 7, 2008

System Plan

Here’s a link to my System Plan: http://dmtsar.0fees.net/system_plan.html

There doesn’t seem to be a discussion forum setup yet on UTS Online.

Also, I can’t get it to 100% Validate due to the (annoying) Analytics code the hosting appends to end of the page, which I can’t turn off.

October 1, 2008

How do you respond to comments on your blog?

I suppose you can add a comment on the commenters blog, or make a comment on the blog that has a comment ….

Anyways, Angela, to answer your question… I used Photoshop to do the tiled background image as well as the banner, which is actually a photo of my bedside table lamp. And the rest of the layout, well, because I’ve restarted so many times, I’ve gotten the hang of the whole {position: fixed vs position: relative}  thing. Designing in Photoshop helped as it was eaiser to visually play around with background images, colours and sizing (specially sizing). A lesson I learnt the hard way. Powerpoint would be just as affective I suspect if you don’t have Photoshop.

As for the lighbox effect, in UTS Online, Week 8, there’s a link to Lightbox where you can download the scripts and instructions on how to use it. It was pretty simple I thought and didn’t take too long to setup. The layout of the little thumbnail images with descriptions underneath, is from w3schools.

Hope that’s been helpful!

October 1, 2008

Dropdown Menus

After trolling through what seems like hundreds of examples and tutorials, I finally found a pretty simple method of applying a dropdown menu. Basically, what I was after was when the mouse hovered over a link from a horizontal menu, a dropdown vertical menu appears. If not for an IE bug, you can pertty much accomplish this with just purely CSS.  A little bit of javascript is required. There’s some pretty complex examples out there, but this article, Suckerfish Dropdowns, from A List Apart is by bar the simplest in my opinion. It still uses javascript, and although I don’t quite fully understand what it’s doing (specially the javascript bit) it was pretty easy to apply for my own purposes.

Here’s my sample. Pretty simple, but it works!

Follow

Get every new post delivered to your Inbox.