You are here

function uc_product_update_12 in Ubercart 5

File

uc_product/uc_product.install, line 333
Database installation, uninstallation, and updates for the product module.

Code

function uc_product_update_12() {
  $ret = array();
  if (module_exists('imagecache')) {
    $preset_id = db_next_id('{imagecache_preset}_presetid');
    $action_id = db_next_id('{imagecache_action}_actionid');
    db_query("INSERT INTO {imagecache_preset} (presetid, presetname) VALUES (%d, 'uc_thumbnail')", $preset_id);
    db_query("INSERT INTO {imagecache_action} (actionid, presetid, weight, data) VALUES (%d, %d, 0, '%s')", $action_id, $preset_id, 'a:4:{s:8:"function";s:5:"scale";s:3:"fit";s:6:"inside";s:5:"width";s:2:"35";s:6:"height";s:2:"35";}');
    cache_clear_all('imagecache:presets', 'cache');
    $ret[] = array(
      'success' => TRUE,
      'query' => "INSERT INTO {imagecache_preset} (presetid, presetname) VALUES (" . $preset_id . ", 'uc_thumbnail')",
    );
    $ret[] = array(
      'success' => TRUE,
      'query' => "INSERT INTO {imagecache_action} (actionid, presetid, weight, data) VALUES (" . $action_id . ", " . $preset_id . ", 0, '" . 'a:4:{s:8:"function";s:5:"scale";s:3:"fit";s:6:"inside";s:5:"width";s:2:"35";s:6:"height";s:2:"35";}' . "')",
    );
  }
  return $ret;
}