You are here

fb_app.install in Drupal for Facebook 5.2

Installs database tables and settings required by fb_app module.

File

fb_app.install
View source
<?php

/**
 * @file
 * Installs database tables and settings required by fb_app module.
 * 
 */

// TODO: some of these tables should be created by othe module install files.
function fb_app_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("\nCREATE TABLE IF NOT EXISTS {fb_app} (\nnid int(11) unsigned NOT NULL,\nlabel varchar(128) NOT NULL,\napikey varchar(128) NOT NULL,\nid varchar(128) NOT NULL,\nsecret varchar(128) NOT NULL,\ncanvas varchar(128) NOT NULL,\nrequire_login int(4) NOT NULL,\ncreate_account int(4) NOT NULL,\nunique_account int(4) NOT NULL,\ndata longtext,\nPRIMARY KEY (nid),\nUNIQUE KEY (apikey)\n) /*!40100 DEFAULT CHARACTER SET UTF8 */;\n");
  }
  drupal_set_message(t('Facebook Application module installed. Please grant yourself <a href="!perm">permissions</a> and then browse to <a href="!create">Create Content => Facebook Application</a> to get started.', array(
    '!perm' => url('admin/user/access'),
    '!create' => url('node/add/fb-app'),
  )));
}
function fb_app_update_1() {

  // Add id field
  $ret[] = update_sql('ALTER TABLE {fb_app} ADD id varchar(128) NOT NULL');
  return $ret;
}

Functions