function nodewords_update_6168 in Nodewords: D6 Meta Tags 6
Implements hook_update_N().
File
- ./
nodewords.install, line 1348 - Installation file for nodewords.module.
Code
function nodewords_update_6168() {
$ret = array();
drupal_load('module', 'nodewords');
$bool = db_result(db_query('SELECT COUNT(*) FROM {nodewords} WHERE type = %d', NODEWORDS_TYPE_TRACKER)) && !db_result(db_query("SELECT COUNT(*) FROM {nodewords_custom} WHERE name = 'tracker'"));
if ($bool) {
$row = new stdClass();
$row->name = 'tracker';
$row->path = "user/*/track\ntracker\ntracker/*";
if (drupal_write_record('nodewords_custom', $row)) {
$ret[] = update_sql("UPDATE {nodewords} SET type = '" . NODEWORDS_TYPE_PAGE . "', id = '" . $row->pid . "' WHERE type = '" . NODEWORDS_TYPE_TRACKER . "'");
}
}
return $ret;
}