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