Only in ./: avatar_selection-imagecache-431500.patch diff -up ./avatar_selection.admin.inc ../avatar_selectionNew/avatar_selection.admin.inc --- ./avatar_selection.admin.inc 2009-02-09 12:47:18.000000000 +0200 +++ ../avatar_selectionNew/avatar_selection.admin.inc 2010-05-06 01:24:49.000000000 +0200 @@ -147,6 +147,22 @@ function avatar_selection_config_form() '#default_value' => variable_get('avatar_selection_distinctive_avatars', FALSE), ); + if (module_exists("imagecache")) { + // Load imagecache presets + $presets = array(); + $presets[] = ''; + foreach (imagecache_presets() as $preset) { + $presets[$preset['presetname']] = check_plain($preset['presetname']); + } + + $form['update']['imagecache_preset'] = array( + '#type' => 'select', + '#title' => t('Imagecache preset'), + '#default_value' => variable_get('avatar_selection_imagecache_preset', FALSE), + '#options' => $presets, + '#description' => t("You can choose an imagecache preset to format the avatars."), + ); + } $form['update']['submit'] = array( '#type' => 'submit', @@ -557,6 +573,9 @@ function avatar_selection_config_form_su variable_set('avatar_selection_avatar_per_page', $form_state['values']['avatar_per_page']); variable_set('avatar_selection_set_random_default', $form_state['values']['set_random_default']); variable_set('avatar_selection_distinctive_avatars', $form_state['values']['distinctive_avatars']); + if (module_exists("imagecache")) { + variable_set('avatar_selection_imagecache_preset', $form_state['values']['imagecache_preset']); + } drupal_set_message(t('Configuration has been updated.')); } } diff -up ./avatar_selection.module ../avatar_selectionNew/avatar_selection.module --- ./avatar_selection.module 2009-10-26 02:09:36.000000000 +0200 +++ ../avatar_selectionNew/avatar_selection.module 2010-05-06 01:22:56.000000000 +0200 @@ -465,10 +465,19 @@ function _avatar_selection_image_list($u } } + if (module_exists("imagecache")) { + $imagecache_preset = variable_get('avatar_selection_imagecache_preset', 0); + } + while ($avatar = db_fetch_object($result)) { $avs_image = $avatar->avatar; $name = $avatar->name; - $avatars[$avs_image] = theme('image', $url .'/'. $avs_image, $name, $name, NULL, FALSE); + if (module_exists("imagecache") && $imagecache_preset) { + $avatars[$avs_image] = theme('imagecache', $imagecache_preset, $dir . '/' . $avs_image, $name, $name); + } + else { + $avatars[$avs_image] = theme('image', $url .'/'. $avs_image, $name, $name, NULL, FALSE); + } } $selects['avatars'] = $avatars; $selects['total'] = $total; Common subdirectories: ./js and ../avatar_selectionNew/js Common subdirectories: ./translations and ../avatar_selectionNew/translations