function ad_uninstall in Advertisement 5
Same name and namespace in other branches
- 5.2 ad.install \ad_uninstall()
- 6.3 ad.install \ad_uninstall()
- 6 ad.install \ad_uninstall()
- 6.2 ad.install \ad_uninstall()
- 7.3 ad.install \ad_uninstall()
- 7 ad.install \ad_uninstall()
Allow complete uninstallation of the ad module.
File
- ./
ad.install, line 245
Code
function ad_uninstall() {
// Delete all ad content.
$result = db_query("SELECT nid FROM {node} WHERE type = 'ad'");
while ($nid = db_result($result)) {
node_delete($nid);
variable_del("ad_autoactivate_warning_{$nid}");
}
// Drop all ad module tables.
db_query('DROP TABLE {ad_clicks}');
db_query('DROP TABLE {ad_hosts}');
db_query('DROP TABLE {ad_owners}');
db_query('DROP TABLE {ad_permissions}');
db_query('DROP TABLE {ad_statistics}');
db_query('DROP TABLE {ads}');
// Delete all remaining ad module variables.
$variables = array(
'ad_cron_timestamp',
'ad_link_target',
'ad_cache',
'ad_cache_file',
'adserve',
'ad_group_vid',
'ad_groups',
'ad_validate_url',
'ad_display',
);
foreach ($variables as $variable) {
variable_del($variable);
}
// TODO: "ad_block_quantity_$delta"
}