| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* hook install for addnode.. create table to store the addnode order
|
| 5 |
*/
|
| 6 |
function addnode_install() {
|
| 7 |
switch ($GLOBALS['db_type']) {
|
| 8 |
case 'mysql':
|
| 9 |
case 'mysqli':
|
| 10 |
db_query("CREATE TABLE {addnode_order} (nid int not null default 0, fieldname char(255) not null default '', weights text) /*!40100 DEFAULT CHARACTER SET utf8 */");
|
| 11 |
break;
|
| 12 |
case 'pgsql':
|
| 13 |
db_query("CREATE TABLE {addnode_order} (nid integer not null default 0, fieldname varchar(255) not null default '', weights text)");
|
| 14 |
break;
|
| 15 |
}
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* we are reusing addnode namespace to update function for existing sites.
|
| 20 |
*/
|
| 21 |
function addnode_update_1() {
|
| 22 |
$ret = array();
|
| 23 |
addnode_install();
|
| 24 |
return $ret;
|
| 25 |
}
|
| 26 |
|
| 27 |
/**
|
| 28 |
* hook_uninstall deletes the support tables.
|
| 29 |
**/
|
| 30 |
function addnode_uninstall() {
|
| 31 |
db_query("DROP TABLE {addnode_order}");
|
| 32 |
}
|