You are here

function custom_breadcrumbs_update_1 in Custom Breadcrumbs 6.2

Same name and namespace in other branches
  1. 5 custom_breadcrumbs.install \custom_breadcrumbs_update_1()
  2. 6 custom_breadcrumbs.install \custom_breadcrumbs_update_1()
  3. 7.2 custom_breadcrumbs.install \custom_breadcrumbs_update_1()

File

./custom_breadcrumbs.install, line 81
Install file for the custom_breadcrumbs module.

Code

function custom_breadcrumbs_update_1() {
  $stuff = array(
    '%author_id' => '[author-uid]',
    '%author_name' => '[author-name]',
    '%user_id' => '[user-id]',
    '%user_name' => '[user-name]',
    '%node_id' => '[nid]',
    '%node_type' => '[type]',
    '%node_type_name' => '[type-name]',
    '%top_term' => '[term]',
    '%top_tname' => '[term-id]',
    '%created_d' => '[dd]',
    '%created_D' => '[ddd]',
    '%created_j' => '[d]',
    '%created_l' => '[day]',
    '%created_F' => '[month]',
    '%created_m' => '[mm]',
    '%created_M' => '[mon]',
    '%created_n' => '[m]',
    '%created_y' => '[yy]',
    '%created_Y' => '[yyyy]',
  );
  $search = array_keys($stuff);
  $replace = array_values($stuff);
  $result = db_query("SELECT * FROM {custom_breadcrumb}");
  while ($crumb = db_fetch_object($result)) {
    $crumb->titles = str_replace($search, $replace, $crumb->titles);
    $crumb->paths = str_replace($search, $replace, $crumb->paths);
    _custom_breadcrumbs_save_breadcrumb('custom_breadcrumb', $crumb);
  }
  return array(
    'success' => TRUE,
    'query' => 'Custom Breadcrumb replacement strings updated for use with Token module.',
  );
}