Wednesday 25 March 2009

Sending excel file to browser

Polished up the management screens and added an export facility (to Excel) for the gallery data. This is how to send an excel file to the browser.

<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment;
filename=photoarchive.xls");
header("Pragma: no-cache");
header("Expires: 0");
// then send tab-delimited rows of your data
?>

Tag cloud formula

Modified the tag cloud for photo categories using a neat formula adapted from that found at http://r2soft.blogspot.com/2007/12/how-to-create-tag-cloud-with-formula.html

Choose a $lower_threshold then select tag counts having count of $lower_threshold or more. Find the highest tag count and define largest and smallest font size.
$cloudnumber=round(( (($this_tag_count-$lower_threshold) *
($largest_font_size-$smallest_font_size)) /
($most_popular_tag_count-$lower_threshold) )
+ $smallest_font_size);
if ($cloudnumber<0) { $cloudnumber=0; }

I put the clouds into 6 discrete buckets defined by CSS - ('cloud'.$cloudnumber) cloud0, cloud1, cloud2 etc. then modify the characteristics of the buckets. Could make it a more continuous variation in font size using a range of 75% to 300% which seems popular but I like the look of the fixed buckets generated by the $cloudnumber.

Altering the $lower_threshold will help to limit the number of tags on the photographs screen. Probably, in due course, add a 'more' link which will go to an alternative screen where the $lower_threshold is set to 1.

Monday 23 March 2009

Grampound with Creed Photo Archive

Need to sort out the domain to publish and it is launched.

This has been a challenging project to design an 'easy-to-use' photo archive that is database driven, managed by several individuals with various levels of IT skills, and have a mirror version running from a PC that does not have internet access.

Many thanks to XAMPP, Mootools, Highslide JS and freecsstemplates.org.