function node_gallery_update_6102 in Node Gallery 6.3
Same name and namespace in other branches
- 6 node_gallery.install \node_gallery_update_6102()
- 6.2 node_gallery.install \node_gallery_update_6102()
Implements hook_update_N() Updating the database for the changing options for "view teaser"
File
- ./
node_gallery.install, line 669 - Install, update and uninstall functions for the node_gallery module.
Code
function node_gallery_update_6102() {
$ret = array();
$result = db_query("SELECT * FROM {ng_gallery_config} WHERE 1");
$t = drupal_unpack(db_fetch_object($result));
while ($t = drupal_unpack(db_fetch_object($result))) {
if (!empty($t)) {
$relationship = new gallery_config($t);
if ($relationship->teaser['gallery_display_type'] == '0') {
$relationship->teaser['gallery_display_type'] = 'cover';
}
elseif ($relationship->teaser['gallery_display_type'] == '1') {
$relationship->teaser['gallery_display_type'] = 'thumbnails';
}
$relationship->gallery = array(
'gallery_display' => 'thumbnails',
'lightbox2_gallery_preset' => 'node-gallery-display',
);
unset($relationship->data);
$relationship
->save();
}
}
return $ret;
}