You are here

hosting.install in Hosting 5

Same filename and directory in other branches
  1. 6.2 hosting.install
  2. 7.4 hosting.install
  3. 7.3 hosting.install

File

hosting.install
View source
<?php

function hosting_install() {
  db_query("UPDATE {system} SET weight = 10 WHERE type='module' and name='hosting'");
}
function hosting_update_1() {
  $ret = array();
  $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE type='module' and name='hosting'");
  return $ret;
}

/**
 * Update function to remove unused table
 */
function hosting_update_2() {
  $ret = array();
  $ret[] = update_sql("DROP TABLE {hosting_config_template}");
  return $ret;
}

/**
 * Hide hostmaster and hostslave profiles
 */
function hosting_update_3() {
  $ret = array();
  $result = db_query("select n.nid from {node} n left join hosting_package p on n.nid = p.nid where short_name in ('hostslave', 'hostmaster')");
  while ($obj = db_fetch_object($result)) {
    $in[] = (int) $obj->nid;
  }
  $in = implode(", ", $in);
  $ret[] = update_sql("UPDATE {node} SET status = 0 WHERE nid IN (" . $in . ")", $values);
  return $ret;
}

Functions

Namesort descending Description
hosting_install
hosting_update_1
hosting_update_2 Update function to remove unused table
hosting_update_3 Hide hostmaster and hostslave profiles