Ah, finally.  It took a while to get my head around the drupal multi-site thing.  Here was the goal, to create a dev environment with as little setup as possible each time I create a new site.  I could have used the acquia install stack or look more into aegir, but I wanted to get it on my own.  The goal was to create a single vhosts entry in httpd-vhosts.conf.  I tried to see if the hosts file could handle wildcard entries, but unfortunately it does not.  Then I started looking into setting up BIND and running my own local dns to avoid having to deal with the hosts file, but that started getting complex and involved too much effort (i.e. got lazy and didn’t feel like blowing up my current stable setup).

So the steps are actually pretty simple:

Step 1.
Decide on a dev domain.  I usually pick an easy to type / remember domain. I also check to see if there is a real website out there before I lose it by changing the hosts file.  Since I was using the acquia distro, I decided on *.aq.com.  In this case all my drupal instances would be something.aq.com. So when I’m developing with ubercart, I can create cart.aq.com, or  client1.aq.com or test.aq.com.

Step 2.
You’ll need a VirtualHost setting in your httpd-vhosts.conf file.  I run my server on port 8090 for testing, my entry looks like this:

#acquia settings
<VirtualHost *:8090>
 ServerName www.aq.com
 ServerAlias *.aq.com aq.com
 ErrorLog "O:/www/drupal.osm.com/logs"
 LogLevel notice
 RewriteEngine On
 RewriteOptions inherit

 DocumentRoot "O:/www/drupal.osm.com/html/aq"
 <Directory "O:/www/drupal.osm.com/html/aq">
 Options Indexes FollowSymLinks MultiViews ExecCGI
 AllowOverride All
 Order allow,deny
 allow from all
 </Directory>

</VirtualHost>

A few things to note:

  1. The server is running on port 8090, so to get to a site in the browser I’ll need to access: http://cart.aq.com:8090
  2. osm.com – I create all my project folders with this suffix (OpenStep Media)
  3. document root is where acquia is setup, in this folder you’ll see the main drupal index.php file

Step 3.
You’ll need to update your hosts file in c:\windows\system32\drivers\etc   here’s an example.  You’ll need to do this for every site.  I’d like to add a plugin to the xampp control panel to either add entries, or at least create a shortcut to the file (nudge, nudge apachefriends)

#aquia sites
127.0.0.1       test.aq.com
127.0.0.1       web.aq.com

Step 4.
Restart apache.

Step 5.
This is the most important step, and the one that was driving me nuts, but yet so simple.  You will have to go into your drupal install, to the sites folder.  In there you’ll see a folder called “default”.  You’ll need to copy this folder to a new folder name that matches what you put into the hosts file.  So your new folders should be: “test.aq.com” and “web.aq.com”

When you navigate to http://test.aq.com  – you should get the install screen, the same with web.aq.com

Good Luck!

Magento UPS integration

June 15, 2009

/magento131/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php

integration code is in the file above.  Although the config table in the database seems to have rows expecting api keys and such.. but seems that it’s not needed.

I’m using Aptana for some drupal development.  For setup, I used svn to checkout the latest revision of acquia to my web root.  I loaded it up into aptana as a project.  As I tried copying files and renaming things, I kept getting subversion warnings and errors.  Since I’m not planning on comitting back to acquia, I found a little nifty option to turn SVN off for the aptana project.

Right click on the project folder, then Team. Then there is the option to turn off SVN and it will even run through the entire directory and remove all the SVN folders if you want.

favicon creator

May 24, 2009

I wanted to stylize the drupal admin_menu for the acquia install. Ended up using this nifty favicon generator to change the icon on the toolbar:

http://tools.dynamicdrive.com/favicon/

I’ve just spent the last 2 hours configuring FCKeditor for drupal.  Here are the main points:

To get the “Browse Server” button working for image uploads / quick upload / any uploading:

  1. First you’ll need to get into the config.php file fckeditor/editor/filemanager/connectors/php
    In there, I’ve added the following lines :

    $Config['Enabled'] = true ;
    // Path to user files relative to the document root.
    $root = "../../../../../../../../default/uploads/";
    $Config['UserFilesPath'] = $root ;
  2. Next I had to hack the fckeditor.inc file in /modules/wysiwyg/editors.  These settings probably have some integration with the drupal admin menu, but after a half hour of clicking all the options and things not showing up… I figured it’s easier to just get in there.  Obviously, this is not condoned… but this might be something that the wyswyg module needs to address.  You’ll need to make the following changes:
    function wysiwyg_fckeditor_settings($editor, $config, $theme) {
     $settings = array( 'EditorPath' => base_path() . $editor['library path'] .'/',
     'SkinPath' => base_path() . $editor['library path'] .'/editor/skins/'. $theme .'/',
     'Width' => '100%',
     'Height' => 420,
     'LinkBrowser' => TRUE,
     'LinkUpload' => TRUE,
     'ImageBrowser' => TRUE,
     'ImageUpload' => TRUE,
     'FlashBrowser' => TRUE,
     'FlashUpload' => TRUE,
     );
  3. Next thing, is that after all this work, FCKeditor has this great filebrowser / uploader functionality, but only images and flash files can be uploaded??? what’s the deal.  It’s not very intuitive, but it’s the “Link” button that enables you to upload more generic files like PDF’s, word files, excel files and the like.  If I couldn’t figure that out, I’m guessing that it’s not very intuitive to others either.  The easiest way to address this was to just change the tooltip in the en.js file in /fckeditor/editor/lang.  I just changed the tooltip to “Insert/Edit Links and Files”.  If you make the change to the en.js file, you will need to clear your browser cache or you won’t see the changes taking effect.
HP De-Branded Sempron 2200+

HP De-Branded Sempron 2200+

I finally got around to buying a “starter” computer for my daughter.  I’ve been addicted to dealigg lately, and also I’ve been checking out geeks.com now and again to see if they have any decent deals going on.  Last week I was looking at geeks.com and noticed they had a few simple systems listed.  What caught my eye was the HP De-Branded Sempron for $179.00.  A pretty decent price for a new machine, keyboard, mouse, 2GB memory and 160GB hard-drive with a DVD W/R drive.

No OS, but not a problem, I was going to load XP SP3  on there.  The one thing that I *didn’t* notice on the spec page was this great line “Drivers may be hard to find”.  But that just add to the challenge, doesn’t it.

The machine arrived just 3 days after ordering, pretty fast.

Next step was to install the OS.  I loaded up XP SP3 and hit a snag.  During the disk format, the operation crashed at 75% complete.  So I restarted and used the Quick Format options the second time around.  That worked… also needed to create 2 partitions on the drive.

Now with xp running, of course none of the onboard mobo plugs worked.  No audio, video was lousy, and no ethernet port detection.  However, the USB ports were working fine, and I was able to plug in my $12 usb wireless adapter no problem.

This is when I started kicking myself.  “Driver may be hard to find”.  Ugh… just what I wanted to spend the next few hours setting this machine up.  I reasoned that the money saved on the purchase would pay for the next few hours of research.

So running XP SP3, I needed to load up video and audio drivers.  There was no information on geeks.com regarding the mobo at all. So, what’s a person to do?  Crack open the case, get a piece of paper and start writing down model  numbers printed on the mobo.

Motherboard model: M2N68-LA

After a search on google, it turns out that this is an ASUS mobo, with a Socket AM2 architecture.  So I went over to the support.asus.com website to see if there were some downloadable drivers.  I couldn’t find the exact model -LA, so I just used the base M2N68 model.  This part led me to this page:

http://support.asus.com/download/download.aspx?model=M2N68&os=17&SLanguage=en-us

I downloaded the NVIDIA nForce drivers for the video.  Worked perfectly.

Downloaded the audio drivers… not so good.  Didn’t seem to work.

I ended up finding this page:
http://boredsysadm.blogspot.com/2008/03/windows-xp-sp3-and-microsoft-hd-audio.html

It had a step by step guide on how to install the missing HD audio drivers for SP3.

Realtek High Definition Audio Driver 5.10.0.5793

motherboard_driver_audio_realtek_azalia.rar

http://drivers.softpedia.com/get/SOUND-CARD/REALTEK/Gigabyte-GA-GC330UD-rev-1-0-Realtek-Azalia-Audio-Driver-51005793-for-Vista.shtml

This driver seemed to work for me… although it was an ASUS mobo.

Done!

Someone sent me this cool link about attaching icons to any dom text elements with css.

However, I believe that css selectors are not available in all browsers… i think IE is missing some of the features there.

Overdue post

August 1, 2008

Working diligently on a codeigniter-based simple LMS product to help the LEED certification prep-test have a home online.

I designed the logo for leedcourses.com, but I’m not a designer… it probably shows, but we needed something quickly.

Things that must be done this month… I have to attend gangplank. I’ve been meaning to go all month, but I’m really good at making excuses.

How awesome is that. I know I’m a doof.. but having the shuffle() function to randomize elements in an array is just great. It’s not even array_shuffle() or array_randomize() — it’s just plain shuffle(). Cute.

http://us3.php.net/manual/en/function.shuffle.php

I needed to add a table row to the bottom of a form.  Jquery to the rescue. The form has a series of rows that record a start date and an end date.  But the user can opt to create more input rows if they so choose, kicking off a little dhtml to extend the size of the form.

Here’s what I ended up using to add a row to the bottom of the table:

function onAddDateRange() {
var lastRow = $(‘#date_ranges tr:last’).clone();
var id = parseInt($(‘.id’, lastRow).html()) + 1;
$(‘[name]:first’, lastRow).attr(‘name’, ‘week_start_’ + id);
$(‘[name]:last’, lastRow).attr(‘name’, ‘week_end_’ + id);
$(‘.id’, lastRow).html(id);
$(‘#date_ranges’).append(lastRow);
}

http://www.mail-archive.com/jquery-en@googlegroups.com/msg22435.html