function resizeimage_wrapper_dbcache in Brilliant Gallery 7
Same name and namespace in other branches
- 5.4 image.php \resizeimage_wrapper_dbcache()
- 5.3 image.php \resizeimage_wrapper_dbcache()
- 6.4 functions.inc \resizeimage_wrapper_dbcache()
- 6 image.php \resizeimage_wrapper_dbcache()
- 6.2 image.php \resizeimage_wrapper_dbcache()
- 6.3 image.php \resizeimage_wrapper_dbcache()
- 7.2 OLD_brilliant_gallery_functions.inc \resizeimage_wrapper_dbcache()
1 call to resizeimage_wrapper_dbcache()
- brilliant_gallery_deliver_image in ./brilliant_gallery_functions.inc
- @todo Please document this function.
File
- ./brilliant_gallery_functions.inc, line 235
Code
function resizeimage_wrapper_dbcache($reset = FALSE, $imagepath, $bgimgproperties_hash) {
$bgcachexpire = brilliant_gallery_get_days_in_seconds(variable_get('brilliant_gallery_cache_duration', 90));
static $my_data;
$pcache = variable_get('brilliant_gallery_pcache', BRILLIANT_GALLERY_DEFAULT_CACHE_DIR);
$foqen = FILE_DIRECTORY_PATH . '/' . $pcache . '/bg_cached_resized_' . $bgimgproperties_hash;
$lastchanged = @filemtime($foqen);
if ($lastchanged === FALSE or REQUEST_TIME - $lastchanged > $bgcachexpire) {
@unlink($foqen);
$my_data = resizeimage($_GET['imgp'], $_GET['imgw'], $_GET['imgh'], @$_GET['imgcrop'], $imagepath);
$image = $my_data;
if (strlen($image) > 0) {
$fp = fopen($foqen, 'w');
fwrite($fp, $image);
fclose($fp);
}
}
return $my_data;
}