Category: Development


I just worked on my Sport Training Programs website (shameless seo) for over three hours on a problem that doesn’t exist.

If you’re using Zen Theme for Drupal 5 or 6 and your page is loading incorrectly in Internet Explorer IE6 or IE7 (namely, your page is loading without css), consider that Internet Explorer can load a maximum or 31 .css files.  Boy that is interesting…wish I’d known it before.  Zen theme without any modules gets pretty close to this out of the box.  This is a very easy fix in a drupal install, just turn on css aggregation in /admin/setttings/performance.

I learned this after completely validating my css, ripping the guts out of my .tpl.php and template.php files, eating a sandwich and disabling 6 or 7 modules.

Drupal Logo

I am a Drupal developer almost full-time now, and on my development server I have two subdirectories in the public_html folder:  /drupal5 and /drupal6.

Try as I might, I have never been able to get the combination of $base_url in the settings.php file and the RewriteBase directive in the .htaccess file to correctly display sites in either of these subdirectories.  In the best-case scenario, the sites would show up almost correctly, but any linked files or embedded images would not contain the correct path (ie /files/images/x.jpg instead of /drupal6/files/images/x.jpg).

My workaround?  A little bit of htaccess voodoo.  Essentially I modified an existing htaccess script  that allows you to run drupal in a subdirectory–all I did was add some conditions that let the server know whether to route the traffic to the d6 directory or the d5 directory.

The fix is a three step process:

1) Name all of the sites in your development server differently depending upon whether they are on the drupal6 or drupal5 platform.  All of the sites in my /drupal5/sites folder are named “locald5.site.com“, and all of the sites in my /drupal6/sites folder are named “locald6.site.com“.

2) Modify your Hosts file to reflect any site you add to your server.  You’ve probably already done this, but if you haven’t here is a tutorial on modifying your hosts file in Mac OS X, and here is a tutorial on modifying your hosts file in Windows.  For my fix, every additional entry in my hosts file looks like 127.0.0.1  locald[6 or 5].site.com

3) Insert the following into the .htaccess file in the ROOT of your webserver:


Options -Indexes
RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^locald6.*
RewriteRule ^$ drupal6/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/drupal6%{REQUEST_URI} -f
RewriteRule .* drupal6/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*wiki.*
RewriteCond %{HTTP_HOST} ^locald6.*
RewriteRule .* drupal6/index.php?q=$0 [QSA]

RewriteCond %{HTTP_HOST} ^locald5.*
RewriteRule ^$ drupal5/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/drupal5%{REQUEST_URI} -f
RewriteRule .* drupal5/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*wiki.*
RewriteCond %{HTTP_HOST} ^locald6.*
RewriteRule .* drupal5/index.php?q=$0 [QSA]

Do this and your server should correctly route all of your drupal5 and drupal6 development sites!  Good luck.

Quantum Communications: San Diego Marketing and Advertising
Check out the Quantum Communications website.

The process to arrive where we did was a fun one.  Terry wanted a design in which the user is immediately offered pretty much every service we offer–SEO, re-branding, brand positioning as a bunch of big ass buttons… looking to green your brand?  BAM!  This was pretty much the idea.  He also wanted some kind of a creative element, something to show off our creative side and to hook a potential client.

Meanwhile, floating around in my head was this idea of integrating a passive game into a functional interface.  Thus I proposed the basic premise to him, that the user should be able to browse items on the front page and, whether they realize it or not, they will be playing a game in the process.

The content is managed by a Drupal 6 installation.  The front page is running mostly on jQuery, and the game is a flash element. The color scheme can be switched very easily–we ran a Halloween theme…until new years.

The next two elements I plan to program in are a user color picker, so users can choose their own color schemes, and a more expansive leader board so my buddy Almu’s unbeatable scores aren’t the only ones the game will track.

Check it out.  If you don’t like it, tell me why, I would love to hear about it.  Maybe.  I might be a little annoyed, but don’t let that stop you.

Art websites

Finished off a website for the UCSF Mission Bay Art Collective.

Internet Explorer 6 Icon

A few months ago I built my most recent computer and for the first time installed Windows XP 64-bit edition. Anyone who has done this knows it is kind of a pain. So much of my old software didn’t work, I even had to buy a different wireless networking card due to Airlink101′s ineptitude in driver updating.

This morning I was informed of an IE6 display issue on one of my sites, and I realized in horror that my odds of finding a standalone IE6 to run on my 64-bit platform were not good. Fortunately, after about a 45-minute search I did stumble upon a working browser, which you can download from evolt.org.

A static website in three hours

Sports Lab Ball WorkoutWell, the title is misleading. I did have to launch this website in three hours–and it was a pain–but I got to come back in and spend some time on friday cleaning up loose ends and filling in the details, which as I’ve come to realize, are the only thing that make the difference between good web design and websites that look like they were made in Microsoft Word by a non English speaking grandmother.

Marv Marinovich’s Sports Lab v1.0 is off the chopping block. Here is the backstory:

Thursday 2pm

Boss: “So Sports Lab is going to be featured on the NFL Network.”

Me: “Super. Some press will help them out.”

Boss: “They’re on at 4pm today.”

Me: “Wow, and they’re just telling us now?”

Boss: “We need a website up by 4pm.”

Click. Click. Click.

Me: “Damn, forgot to buy bullets.”

Well if you looked at the website Thursday night it was pretty raw, but I got it mostly where I wanted it on Friday. We’re soon to be adding quite a few interactive elements, but for now I’m happy with it as a static web page. Bring on the next project!

ad rejected by clientWhen I tell most people that I’m a graphic designer, they seem pleasantly surprised.  It seems to conjure up images of me sitting in a meadow sipping coca-cola and sketching logos for some environmental non-profit.

Well, truth be told, that isn’t so far off.  Just replace meadow with cave of computers, sketching with vectorizing, and environmental non-profit with “anyone with money”.

I don’t wear much high-contrast clothing and my apartment is very poorly decorated.  I think I might have been born to be a computer programmer, but ended up as a graphic designer featuring programming abilities.  I think this is why I’m not prepared for the #1 drawback of being a designer–which is that you’re designing for other people, not for yourself.

When I’m writing software, it either works, or it doesn’t.  You never have to move a semi-colon a quarter inch to the left.

Today a client wanted me to write a ticker for their website to count the total amount of money that they have saved their clients so far on Solar Panel installations.

I did a couple of google searches and wasn’t able to come up with any tutorials, so I set off to write it myself. Fortunately, it was pretty cake.

The logic is straight forward, and can easily be applied to any language. Simply find your starting date, and your starting “amount”. In this case, as of May 1st 2008, HelioPower had saved their customers $3,107,500. I called this variable baseMoney. They did some calculations for me and determined that this number increases by $.14 (14 cents) every second. All you have to do is write a function that will find how many seconds it’s been since the starting date, and add those seconds (multiplied by your rate) to baseMoney.

Here’s what the code looks like in ActionScript 2.0:

//Starting Money Saved
var baseMoney:Number = 3107500;

//The date we're starting counting at
var d1:Date = new Date(2008, 04, 01, 0,0,0,0);
trace("Starting Date: " + d1);

//The time right NOW. No, right Now. No, right Now. No...
var d2:Date = new Date();
trace("Today: " + d2);

//How many seconds from the initial date to today's date
var addedSeconds:Number = Math.floor((d2 - d1)/1000);

//tickerval sets the function tick() to fire once every 1000ms (once per second)
var tickerval = setInterval(tick,1000);

Tick, which fires every second, simply increments the variable addedSeconds which is the total number of seconds since the initial date. It then calculates and outputs the updated number of dollars saved.

function tick()
{
var sumMoney:Number = baseMoney + ( addedSeconds * .04);
//This is the output. For more on fncCurrFormat, look below.
trace( fncCurrFormat(sumMoney, 2, ",") );
addedSeconds++;
}

The last step is to get the dollars into the correct format. For this I use a function I found called fncCurrFormat. I inherited this particular function in a .fla that I had to update years ago and have been using it ever since. I wish I could give credit where credit is due, but I'm unfortunately not sure where it is. Anyhow, here is the price formatting function.

fncCurrFormat = function (uknumValue, uknPlaces, strSeparator)
{
//trace("uknumValue: "+uknumValue+"\tuknPlaces: "+uknPlaces+"\tstrSeparator: "+strSeparator);
strResult = "";
var booError0 = false;
var booError1 = false;
if (typeof (uknumValue) == "string") {
var numValue = parseFloat(uknumValue);
if (isNaN(numValue)) {
booError0 = true;
}
} else if (typeof (uknumValue) == "number") {
var numValue = uknumValue;
} else {
booError0 = true;
}
if (typeof (uknPlaces) == "string") {
var numPlaces = (uknPlaces == "" || uknPlaces == null) ? 0 : parseInt(uknPlaces);
if (isNaN(numPlaces)) {
booError1 = true;
}
} else if (typeof (uknPlaces) == "number") {
var numPlaces = uknPlaces;
} else {
booError1 = true;
}
if (booError0 || booError1) {
strResult = (booError0 && booError1) ? "bad Value & bad Places" : "";
strResult = (!booError0) ? "bad Places" : "bad Value";
return "error";
} else {
var numRound = Math.pow(10, numPlaces);
numValue = Math.round(numValue*numRound);
var strValDec = (numPlaces>0) ? "."+String(numValue).substr(String(numValue).length-numPlaces) : "";
var strValInt = String(numValue).substr(0, String(numValue).length-numPlaces);
strValue = String(parseFloat(strValue));
var strValIntLen = strValInt.length;
numTriple = Math.floor((strValIntLen-1)/3);
numRemainder = ((strValIntLen-1)%3)+1;
for (var count = 0; count<numTriple; count++) {
strResult = strSeparator+strValInt.substr((strValIntLen-(3*(count+1))), 3)+strResult;
}
if (numRemainder) {
strResult = strValInt.substr(0, numRemainder)+strResult;
}
if (numPlaces && strValDec.length) {
strResult = (strResult == "") ? "0" : strResult;
strResult += strValDec;
}
}
return strResult
};

As I'm sure you can see it takes three arguments, the first being the string to format, the second being what character to separate blocks of digits by, and the third being how many decimal places to round to.

That's it! Peace of cake, no?

This is my first tutorial post ever, please let me know how I did.

Websites for Hero Nutritionals off the block

I’m starting to notice an unfortunate trend when I post new work that I’ve completed: none of it is actually complete. It always seems to be rushed–and half finished–but I have a feeling that I won’t get to go back and right any of the wrongs for some time.

Slice of Life  | Hero Nutritionals Home | Yummi Bears Home

These were some fun sites to work on. Slice of Life is my favorite. My coworker sold them the idea of a lazy susan, then turned to me and told me to build it. I started with this extremely helpful 3D in Flash Tutorial, got it working just about the way I wanted it to, then plugged in some Trigonometry graciously prepared by my mathematical buddy Pat Jarvis-Shean, and the result was slick. I wouldn’t mind taking some more time to clean up the loading sequence and the effect when the user rolls out of the movie, but for the time being it works well.

The Hero Nutritionals homepage is pretty straight forward, I’m sure there will be more content soon. The Yummi Bears homepage will be filled up with flash games and the like soon when we install the Yummi Zone.

Here are links to a couple of other sites I recently designed: Mitsven Surfboards, Simonek Law.

Another Website…Done!

Gotta love finishing projects. Although technically this one isn’t done, it has at least launched. Check out the new Pangaea Travel website.

The three windows are, unfortunately, a blantant ripoff of the mootools homepage. The clients liked it a lot, and the attempts I made to rewrite the code were slow and cumbersome. This script works well here and I’m happy with it.

I used some brushes from this Japanese Foliage as watermarks on the child pages. Thanks to DesignFruit, these brushes are beautiful.

The last thing to be done on this site is to replace the static header image on the first page with an interactive flash element. Our idea is a simple game in which a plane will fly over some beautiful natural scenery leaving a trail of pollution, and the user can “clean up” the pollution by turning it into flowers and plants. I was looking forward to building this but we’re swamped here and it’s been put off–hopefully not forever.

In other news I’ve decided to redesign this page. My thought when I built this beta-template was to fit everything in my site on one page. I’ve decided now that there are reasons people don’t do this, and I’m going to simplify everything up a bit. Once I get time. Which probably won’t be for a while. Cheers.

Powered by WordPress | Theme: Motion by 85ideas.