service_links.install in Service links 6.2
Same filename and directory in other branches
Service Links install file.
File
service_links.installView source
<?php
/**
* @file
* Service Links install file.
*/
/**
* Implementation of hook_uninstall().
*/
function service_links_uninstall() {
$result = db_query('SELECT name FROM {variable} v WHERE LOCATE("service_links_",v.name) > 0');
while ($row = db_fetch_object($result)) {
variable_del($row->name);
}
}
/**
* Update from Service Links 1.x.
*/
function service_links_update_6200(&$sandbox) {
$new_var = variable_get('service_links_show', NULL);
if (!isset($new_var)) {
variable_set('service_links_show', array(
'delicious' => variable_get('service_links_show_delicious', 0),
'digg' => variable_get('service_links_show_digg', 0),
'stumbleupon' => variable_get('service_links_show_stumbleupon', 0),
'reddit' => variable_get('service_links_show_reddit', 0),
'newsvine' => variable_get('service_links_show_newsvine', 0),
'furl' => variable_get('service_links_show_furl', 0),
'facebook' => variable_get('service_links_show_facebook', 0),
'myspace' => variable_get('service_links_show_myspace', 0),
'identica' => variable_get('service_links_show_identica', 0),
'twitter' => variable_get('service_links_show_twitter', 0),
'google' => variable_get('service_links_show_google', 0),
'yahoo' => variable_get('service_links_show_yahoo', 0),
'linkedin' => variable_get('service_links_show_linkedin', 0),
'technorati' => variable_get('service_links_show_technorati', 0),
'icerocket' => variable_get('service_links_show_icerocket', 0),
));
module_enable(array(
'general_services',
));
}
// delete old service variables
$result = db_query('SELECT name FROM {variable} v WHERE LOCATE("service_links_show_",v.name) > 0');
while ($row = db_fetch_object($result)) {
variable_del($row->name);
}
// Aggregator2 support
variable_del('service_links_agg2_link');
return array();
}
Functions
Name![]() |
Description |
---|---|
service_links_uninstall | Implementation of hook_uninstall(). |
service_links_update_6200 | Update from Service Links 1.x. |