You are here

function hashtags_clean_hash_symbol in Hashtags 7

Clean hash (#) symbol in Hashtags vocabulary

Parameters

int $vid vocabulary id:

Return value

int Number of affected values

2 calls to hashtags_clean_hash_symbol()
hashtags_clean_hash_symbol_submit in ./hashtags.module
Submit handler for 'Clean hash symbol' button
hashtags_update_7002 in ./hashtags.install
1) Create a table for storing relations between hashtags, nodes and comments {hashtags_index} 2) Update Hashtags taxonomy: clean hash symbol for all saved hashtags #hash1 => hash1 3) Activate body fields for selected content types (that have…

File

./hashtags.module, line 964

Code

function hashtags_clean_hash_symbol($vid = NULL) {
  if (is_null($vid)) {
    $vid = variable_get('hashtags_vocabulary', '');
  }
  $result = db_query("UPDATE {taxonomy_term_data} \n      SET name = SUBSTR(name, 2) \n      WHERE vid = :vid AND \n      name LIKE '#%'", array(
    ':vid' => $vid,
  ));
  return $result
    ->rowCount();
}