function flickr_block_update_1 in Flickr 5
Same name and namespace in other branches
- 6 block/flickr_block.install \flickr_block_update_1()
Move all the block settings into a single variable per block.
File
- block/
flickr_block.install, line 12
Code
function flickr_block_update_1() {
foreach (range(0, 6) as $delta) {
$user = variable_get("flickr_block_{$delta}_user_id", FALSE);
$show = variable_get("flickr_block_{$delta}_show_n", FALSE);
$size = variable_get("flickr_block_{$delta}_size", FALSE);
if ($user || $show || $size) {
variable_set('flickr_block_' . $delta, array(
'user_id' => $user,
'show_n' => (int) $show,
'size' => $size,
));
}
variable_del("flickr_block_{$delta}_user_id");
variable_del("flickr_block_{$delta}_show_n");
variable_del("flickr_block_{$delta}_size");
}
return array();
}