#if (!$smarty->is_cached($template, $cacheid)) #{ $smarty->assign('maincontentclass', 'content_photo' . $style); function smarty_modifier_colerize($input) { global $maximages; if ($input) { $hex = str_pad(dechex(255 - $input / $maximages * 255), 2, '0', STR_PAD_LEFT); return "ffff{$hex}"; } return 'ffffff'; } $smarty->register_modifier("colerize", "smarty_modifier_colerize"); //process grid reference if ($grid_given) { $square->rememberInSession(); //now we see if the grid reference is actually available... if ($grid_ok) { $smarty->assign('gridref', $square->grid_reference); $smarty->assign('gridsquare', $square->gridsquare); $smarty->assign('eastings', $square->eastings); $smarty->assign('northings', $square->northings); $smarty->assign('x', $square->x); $smarty->assign('y', $square->y); //store details the browser manager has figured out $smarty->assign('showresult', 1); $smarty->assign('imagecount', $square->imagecount); //is this just a closest match? if (is_object($square->nearest)) { $smarty->assign('nearest_distance', $square->nearest->distance); $smarty->assign('nearest_gridref', $square->nearest->grid_reference);