/[drupal]/contributions/modules/news_page/news_page.install
ViewVC logotype

Diff of /contributions/modules/news_page/news_page.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.1, Sun Jan 14 03:37:34 2007 UTC revision 1.2.2.2, Tue Jul 24 00:41:25 2007 UTC
# Line 0  Line 1 
1    <?php
2    // $Id: news_page.install,v 1.1.2.2 2007/01/14 03:22:34 MegaGrunt Exp $
3    
4    /**
5     * Implementation of hook_install()
6     */
7    function news_page_install() {
8      switch ($GLOBALS['db_type']) {
9        case 'mysql':
10        case 'mysqli':
11              $query1 = db_query("CREATE TABLE {news_page} (
12                    nid int(10) unsigned NOT NULL default '0',
13                    include varchar(255) NOT NULL default '',
14                    cid int(10) unsigned NOT NULL default '0',
15                    max_items int(11) NOT NULL default '0',
16                    search text,
17                    PRIMARY KEY (nid)
18                    ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
19    
20              if (!empty($query1)) {
21                $created = TRUE;
22              }
23    
24              break;
25      }
26    
27      if ($created) {
28        drupal_set_message(t('News Page module installed successfully.'));
29      }
30      else {
31        drupal_set_message(t('Table installation for the News Page module was unsuccessful. The tables may need to be installed by hand. See news_page.install file for a list of the installation queries.'), 'error');
32      }
33    
34      return;
35    }
36    
37    /**
38     * Updates existing tables from early 4.6 install and add "search" field.
39     */
40    function news_page_update_1() {
41    
42      _system_update_utf8(array('news_page'));
43    
44      $items = array();
45      $items[] = update_sql('ALTER TABLE {news_page} ADD search text');
46    
47      return $items;
48    }

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

  ViewVC Help
Powered by ViewVC 1.1.2