function xmlsitemap_term_enable in XML sitemap 5.2
Same name and namespace in other branches
- 5 xmlsitemap_term/xmlsitemap_term.install \xmlsitemap_term_enable()
Implementation of hook_enable().
File
- xmlsitemap_term/
xmlsitemap_term.install, line 42 - Install file for XML sitemap term
Code
function xmlsitemap_term_enable() {
$weight = db_result(db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'pathauto'"));
if ($weight !== FALSE) {
db_query("UPDATE {system} SET weight = %d WHERE type = 'module' AND name = 'xmlsitemap_term'", ++$weight);
}
db_query("\n INSERT INTO {xmlsitemap_term} (tid, last_changed)\n SELECT td.tid, %d FROM {term_data} td\n LEFT JOIN {xmlsitemap_term} xt ON xt.tid = td.tid\n WHERE xt.tid IS NULL\n ", REQUEST_TIME);
xmlsitemap_flag_sitemap();
}