AIAM100 Launch Party

After a year and a half of telling people I’ve been building this site, we finally had the AIAM100.com website and exhibtion launch party on Friday night at Cooee Art Gallery in Lamrock Ave. Bondi.

Australian Indienous Art Market top 100 (AIAM100) is a website show casing the top Australian indigenous artists based on their market performance in the secondary art market. Over 130 profiles compiled by Adrian Newstead give the user a detailed view of each artist. Market Performance results are supplied by Australian Art Sales Digest (AASD), these results allow the AIAM100 to calculate the AIAM100 index and rank each artist accordingly. It also provides the overall health of the industry, for example the peak in 2007.

Adrian Newstead at the opening of the AIAM100 website and exhibiton

Adrian Newstead at the opening of the AIAM100 website and exhibiton

Ruth Hessey & Adrian Newstead

Ruth Hessey & Adrian Newstead

Being completely built in Flash I see this website as being a RIA rather than just a website. I know I know, it’s not the normal site to be completely built in Flash, and it raised numerous challenges along the way, especially regarding text layout, formatting and resizing (which are basic things we take for granted in developing an html based site). 50% of the site is it’s cutom built php based CMS, along with an extensive database, allowing AIAM administrators to easily publish new artists profiles.

Although i’ll still be working on adding a few more features it’s a great feeling to get AIAM100.com site live into the public.

Moran Prizes web kiosk app for NSW State Library

I recently just finished the ‘People’s Choice Award’ web kiosk application for the NSW State Library. The purpose of the app is to allow the public to vote on their favourite from the Moran Prizes exhibition.

The screen cast shows the general flow of the app, it was relatively siple and includes a back end admin to display user data.

Handy Hint: AMFPHP to Flash Character Encoding

If you’ve ever used AMFPHP to connect your DB into Flash, you may stumble across weird characters being output! eg: – replaces the ’. The simple explanation is that the PHP is decoding it wrong.

Forget about preg_replace(), all you need to do is update your amfphp/gateway.php file to decode, encode in UTF-8.


$gateway->setCharsetHandler("utf8_decode", "UTF-8", "UTF-8");

and walla no more annoying characters sent from AMFPHP.

Freelance @ White Agency – Flash game on Wii console

Last week I completed another little stint at the White Agency, Sydney. The brief was to create a little simple flash game that could be played through the opera browser on the Wii console. It was for a company called Sirtex Medical Ltd. and they wanted to create the game to highlight there medical technology in treating liver cancer with radiation.

Sirtex Flash Game

The aim of the game was to kill off the cancerous tumors by injecting the proprietory Sirtex radiation spheres in the quickest time possible, using the Wii remote you needed to have find the right blood vessel and inject the radiation.

Responsible for the game development and helping with design it was a rather enjoyable little project, as it was educational in the process. The game is going to be the key part of their exhibition which is expected to be displayed at a number of medical expos in the future.

PHP – having problems with getimagesize() when space in filename?

Some images containing spces in the file name led me to some errors when trying to determine their image size for manipulation using PHP.

Simply url encoding the string fixed this problem.
 

 <?php
  $imagePath = "some funky filename.jpg";
  $imagePath = str_replace(" ","%20",$imagePath);
  list($imgwidth,$imgheight) = getimagesize($imagePath);
?>

PHP Snippet – GetFileContents and save PDF

I needed to be able to access a pdf outside my document root… so I created the script below. Using just file_get_contents with an echo would just save it as the name of the script, using an $output_file variable and in the header you are able to specify what you want to save it as.


<?php
$output_file = 'outfilename.pdf';
$file = "target.pdf";
$fileDir = '../target/directory/';
$contents = file_get_contents($fileDir.$file);
header("Content-Disposition: attachment; filename=" . $output_file);
header('Content-type: application/pdf');
echo $contents;
exit();
?>

State Library of NSW 100 exhibiton Kiosk App

I’ve just finished the design and development of a flash based kiosk app for the State Library of NSW 100 Exhibiton. Originally I was contacted by Mental Media to do the job.

The app was fairly straight forward in process, providing the public the ability to vote on their favourite exhibiton item, view favourtie exhibiton item, complete a survey and enter a draw.

All data is saved into a mySQL database and the library staff can access a admin page to download the various data as CSV files. I had some fun with PHP merging all the tables to provide a simple usable table for the non-technical staff.

kiosk_onsite2

The app is running continuously for 100 days, so it was seriously important that there were no memory leaks. Flash and no memory leaks can be a time consuming effort…. At the end of the project I did encounter a memory anomaly where the memory seemed to jump 5MB every time an image was displayed on screen, although I was loading the images from memory. It turned out it was due to the fact I added a drop shadow to the image at runtime…. therefore flash somehow needed to reprocess that shadow area as a new image. This turned into a problem when I couldn’t access it, even by removing the filter, it still kept it in memory. Quick solution.. got rid of the drop shadow.

Lego Technic 8290

This is a model I recently built in Maya. As I’m fairly new to Maya it took a couple of weeks (part time). Modelling Lego is very satisfying, and a good place to learn modelling techniques, it helps when you can use their instructions for reference… MUCH FUN!

lego_technic_8290

PHP Snippet – Get Yesterdays date

This is a simple function that returns yesterdays date. Simple but handy.

function yesterday()
{
 $yesterday = date("Y:m:d",mktime(0,0,0,date("m") ,date("d")-1,date("Y")));
 return $yesterday;
}

PHP Snippet – Time difference between 2 date/time stamps.

In a recent project I needed to capture how long the user spent on the application, it was not expected they would spend days on it so it return hours minutes seconds which can be saved to a database.
So basically here is a function to do that…

//
echo getTimeDifference("2010-02-26 18:35:36");

function getTimeDifference($start_time){

 //convert $start_time into a usable string
 $tempStart = preg_replace('/(\d{2})-(\d{2})-(\d{2})(.*)/', '$1:$2:$3:$4',$start_time);
 $tempStart=explode(":",$tempStart);

 $year = $tempStart[0];
 $month= $tempStart[1];
 $day = $tempStart[2];
 $hour = $tempStart[3];
 $minute = $tempStart[4];
 $second = $tempStart[5];

 //set the end time as current time
 $timesEnd = date("Y:m:d:H:i:s");
 $tempEnd=explode(":",$timesEnd);

 $year1 = $tempEnd[0];
 $month1= $tempEnd[1];
 $day1 = $tempEnd[2];
 $hour1 = $tempEnd[3];
 $minute1 = $tempEnd[4];
 $second1 = $tempEnd[5];

 $countdown_date = mktime($hour, $minute, $second, $month, $day, $year);
 $countdown_date1 = mktime($hour1, $minute1, $second1, $month1, $day1, $year1);

 $diff = $countdown_date1 -$countdown_date ;
 if ($diff < 0)
 $diff = 0;
 $dl = floor($diff/60/60/24);
 $hl = floor(($diff - $dl*60*60*24)/60/60);
 $ml = floor(($diff - $dl*60*60*24 - $hl*60*60)/60);
 $sl = floor(($diff - $dl*60*60*24 - $hl*60*60 - $ml*60)
 );

 $timeDifference = "$hl:$ml:$sl";

 return $timeDifference;
 }