Monthly Archive for October, 2005

OSDC : Get your early bird tickets now!

Your chance to get early bird tickets to this year’s Open Source Developers’ Conference will dissapear on Monday - get in now to save yourself $50!

Not only that, but if you register before the 31st of October you will also receive a conference t-shirt.

Open Source Developers’ Conference
5th to 7th December 2005
Melbourne, Australia
http://osdc.com.au/

A tear ran down my cheek

I just have to say this while I’m feeling it. I just watched Code 46 and I have to say it’s the most beautiful film I’ve seen in a long time. I never cry when I watch movies - but I did this time. It made me angry. So angry I nearly crushed my wine glass. So angry I wanted to take revenge against the world. Then a tear ran down my cheek. I haven’t felt a tear run down my cheek for a long time. Usually when I cry I just hold it in and my body shakes. No tears. This moved me. When I felt that tear, I felt elated. I felt happy. I felt real again. I felt happy to feel sad. I felt alive.

WorkChoices

Trade unions … were abolished. Along with the unions went other gains in workers’ rights including the destruction of minimum wage.

Sound familiar? It will if you’ve been following Australian politics. These words are not in response to John Howard’s latest plans, however. I just read them at ThinkSocialist. They are in relation to Pinochet’s actions after the unfortunate “suicide” of Salvador Allende.

Pinochet also privatized the social security system of Chile, much like our very own pseudo-president [Bush] is seeking to do.

What happened next? Chile was lead into a fascist regime.

So tell me - are you worried?

Running OS Commerce on PHP5

Day two at the new job. My first tasks involve making some customisations to an OS Commerce installation and, as ever, I hate to work on live servers. I just spent an hour or so downloading the live application, but of course I’ve installed Dexter’s PHP5.1 with MySQL4.1 and Apache2. OS Commerce is written for PHP4.

The home page loaded fine, but heading to the admin page, I get “Fatal error: Cannot re-assign $this in …/admin/includes/classes/upload.php on line 31″. I figured that I’d document the changes required to get this running on PHP5 so that I can refer to it again later, and maybe help a few others out.

Fixing the $this re-assignment

First job is to get rid of that error. Looking at line 31 in /admin/includes/classes/upload.php I see:

// self destruct
$this = null;

For now, I’m just going to comment this out and see if there are any undesirable consequences as I test the system. Bingo - admin system works now.

Well I never - it works. Hardly seems worth posting this. In order to make this post a little more useful, I tried to see if anyone else has done this and found a thread on webmasterworld. This person seems to have found problems with the navigation object, but I can’t reproduce that. No errors here. Another thread covering this issue might also be useful to you.

[Update: 19 Oct @ 15:20]

It seems there is something else. When using the admin area, trying to add tax zones, I got an SQL error: “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-20, 20′ at line 1″.

Seems the paging code doesn’t work well in PHP5, and a thread on the oscommerce forum gives one solution: if the offset goes below zero, set it to zero. So on line 38 of admin/includes/classes/split_page_results.php and line 66 of includes/classes/split_page_results.php, add:

if ($offset < 0) $offset=0;

As is the poster of this tip, I’m unsure how this will cope with pages 2 and later when paging. I’ll update this if I find another problem.

The new job

My new job started yesterday and I had one helluva time getting the new IBM ThinkCentre to run Ubuntu. Well - getting it installed was easy, and as usual took less time than configuring Windows on my other machine, which was already pre-installed.

The crunch came when the installer couldn’t detect the network card. Arguably the worst device not to find, because there’s no net connection, and you can’t apt-get or download the drivers you need. Okay, so the monitor not working would be worse, granted, but that’s very unlikely to happen :-)

So after downloading the drivers, burning them onto a CD and copying them to the linux machine and realising they needed gcc-3.4 to compile, then downloading the gcc-3.4 .deb installers, burning, copying, installing, I finally got the drivers to compile and was left with a .ko file. New to compiling linux kernel objects, I followed the instructions to the letter, and successfully insmodded the object and make installed it. The device was still not recognised. I even resorted to rebooting! A linux machine! I know, but I figured it was worth a shot. Still nothing.

After 2 hours of trying, I went round the corner and bought a $15 generic 10/100 ethernet card and was up and running 5 minutes later.

Day one. Good so far!