You are here

function fb_app_install in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 5 fb_app.install \fb_app_install()
  2. 6.3 fb_app.install \fb_app_install()
  3. 6.2 fb_app.install \fb_app_install()
  4. 7.3 fb_app.install \fb_app_install()

File

./fb_app.install, line 9
Installs database tables and settings required by fb_app module.

Code

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'),
  )));
}