View source
<?php
function imagecache_profiles_update_6000() {
$ret = array();
$variables = array(
'user_picture_imagecache_profiles',
'user_picture_imagecache_comments',
'user_picture_imagecache_profiles_default',
);
foreach ($variables as $var) {
$value = variable_get($var, '');
if ($value && !is_numeric($value)) {
$preset = imagecache_preset_by_name($value);
if ($preset['presetid']) {
variable_set($var, $preset['presetid']);
$ret[] = array(
'success' => TRUE,
'query' => t('%var updated from %value to %presetid', array(
'%var' => $var,
'%value' => $value,
'%presetid' => $preset['presetid'],
)),
);
}
else {
$ret[] = array(
'success' => FALSE,
'query' => t('%var not updated: no imagecache preset could be found for %value. <a href="@settings_page"> Update your profile picture presets manually </a>', array(
'%var' => $var,
'%value' => $value,
'@settings_page' => url('admin/user/settings'),
)),
);
}
}
}
return $ret;
}
function imagecache_profiles_update_7000() {
variable_set('user_picture_style', variable_get('user_picture_imagecache_profiles_default'));
variable_del('user_picture_imagecache_profiles_default');
variable_set('user_picture_style_profiles', variable_get('user_picture_imagecache_profiles'));
variable_del('user_picture_imagecache_profiles');
variable_set('user_picture_style_comments', variable_get('user_picture_imagecache_comments'));
variable_del('user_picture_imagecache_comments');
}
function imagecache_profiles_uninstall() {
$variables = array(
'user_picture_style_profiles',
'user_picture_style_comments',
'user_picture_style_nodes',
'user_picture_imagecache_profiles_min_width',
'user_picture_imagecache_profiles_min_height',
);
foreach ($variables as $var) {
variable_del($var);
}
}