function brilliant_gallery_image_properties_set in Brilliant Gallery 7
Same name and namespace in other branches
- 6.4 functions.inc \brilliant_gallery_image_properties_set()
- 7.2 OLD_brilliant_gallery_functions.inc \brilliant_gallery_image_properties_set()
@todo Please document this function.
See also
2 calls to brilliant_gallery_image_properties_set()
File
- ./
brilliant_gallery_functions.inc, line 122
Code
function brilliant_gallery_image_properties_set($bgimgproperties_array) {
// Binds image property array with its hash that is present in the cached file name and in the URL.
$bgimgproperties_hash = md5(serialize($bgimgproperties_array));
// Let's keep the array in cache. Check if it is in cache. If not, write it.
$countie = db_query("SELECT COUNT(*) FROM {brilliant_gallery_image_arrays} WHERE hash = :hash", array(
':hash' => $bgimgproperties_hash,
))
->fetchField();
if ($countie == 0) {
// Run an insert
//echo 1;
$fields = new stdClass();
$fields->hash = $bgimgproperties_hash;
$fields->array = serialize($bgimgproperties_array);
//$fields->datetime = date('Y-m-d H:i:s', REQUEST_TIME);
$fields->datetime = REQUEST_TIME;
drupal_write_record("brilliant_gallery_image_arrays", $fields);
}
else {
// Run an update
$change = array(
//'datetime' => date('Y-m-d H:i:s', REQUEST_TIME),
'datetime' => REQUEST_TIME,
'hash' => $bgimgproperties_hash,
);
drupal_write_record('brilliant_gallery_image_arrays', $change, 'hash');
}
return $bgimgproperties_hash;
}