page_title.install 1.09 KB
Newer Older
1
<?php
JohnAlbin's avatar
JohnAlbin committed
2
// $Id$
3
4
5
6
7
8
9
10
11
12
13

function page_title_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      $query1 = db_query("CREATE TABLE IF NOT EXISTS {page_title} (
                            nid INT NOT NULL,
                            page_title VARCHAR( 128 ) NOT NULL,
                            PRIMARY KEY ( `nid` )
                          ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      if ($query1) {
JohnAlbin's avatar
JohnAlbin committed
14
15
        $created = TRUE;
      }
16
17
18
19
20
21
22
23
      break;

    case 'pgsql':
      $query1 = db_query("CREATE TABLE {page_title} (
                            nid integer NOT NULL default '0',
                            page_title text NOT NULL default ''
                          );");
      if ($query1) {
JohnAlbin's avatar
JohnAlbin committed
24
25
        $created = TRUE;
      }
26
27
28
29
30
31
32
33
34
35
      break;
  }

  if ($created) {
    drupal_set_message(t('Page title module installed successfully.'));
  }
  else {
    drupal_set_message(t('Table installation for the Page title module was unsuccessful. The tables may need to be installed by hand. See the README.txt file for a list of the installation queries.'), 'error');
  }
}