votingapiactivity.install in Activity 6
File
contrib/votingapiactivity/votingapiactivity.install
View source
<?php
function votingapiactivity_install() {
if (!module_exists('activity')) {
module_load_include('module', 'activity');
}
activity_install_activity_defaults('votingapiactivity');
drupal_set_message(t('Activity integration with Voting API module installed. Go to <a href="@settings">Voting API Activity settings</a> to customize ', array(
'@settings' => url('admin/settings/activity/votingapiactivity'),
)));
}
function votingapiactivity_uninstall() {
if (module_exists('activityhistory')) {
db_query("DELETE FROM {activity_history} WHERE aid IN (SELECT aid FROM {activity} WHERE module = '%s')", 'votingapiactivity');
}
db_query("DELETE FROM {activity_targets} WHERE aid IN (SELECT aid FROM {activity} WHERE module = '%s')", 'votingapiactivity');
db_query("DELETE FROM {activity_comments} WHERE aid IN (SELECT aid FROM {activity} WHERE module = '%s')", 'votingapiactivity');
db_query("DELETE FROM {activity} WHERE module = '%s'", 'votingapiactivity');
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'votingapiactivity_%'");
while ($row = db_fetch_object($result)) {
variable_del($row->name);
}
}