You are here

function signature_forum_install in Signatures for Forums 5.2

Same name and namespace in other branches
  1. 5 signature_forum.install \signature_forum_install()
  2. 6 signature_forum.install \signature_forum_install()
  3. 7 signature_forum.install \signature_forum_install()

Implementation of hook_install()

File

./signature_forum.install, line 6

Code

function signature_forum_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {users_signature} (\n        uid int NOT NULL default '0',\n        signature text,\n        PRIMARY KEY (uid)\n        ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      db_query("INSERT INTO {users_signature} (uid, signature)\n        SELECT uid, signature\n        FROM {users}\n        WHERE signature<>''");
      db_query("UPDATE {users} SET signature=''");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {users_signature} (\n        uid int NOT NULL default '0',\n        signature text,\n        PRIMARY KEY (uid)\n        )");
      db_query("INSERT INTO {users_signature} (uid, signature)\n        SELECT uid, signature\n        FROM {users}\n        WHERE signature<>''");
      db_query("UPDATE {users} SET signature=''");
      break;
  }
}