Location: PHPKode > projects > QuickTalk Forum > quicktalk/install/qtf_setup_section.php
<?php



// QuickTalk 2.5 build:20100924



switch($oDB->type)

{

case 'mysql4':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id int,

  type char(1) NOT NULL default "0",

  status char(1) NOT NULL default "0",

  notify char(1) NOT NULL default "1",

  domainid int NOT NULL default 0,

  title varchar(64) NOT NULL default "untitled",

  titleorder int NOT NULL default 255,

  moderator int NOT NULL default 0,

  moderatorname varchar(24) NOT NULL default "Administrator",

  stats varchar(255),  

  options varchar(255),  

  titlefield char(1) NOT NULL default "0",

  numfield varchar(24) NOT NULL default "N",

  prefix char(1),

  PRIMARY KEY (id)

  )';

  break;

  

case 'mysql':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id int,

  type char(1) NOT NULL default "0",

  status char(1) NOT NULL default "0",

  notify char(1) NOT NULL default "1",

  domainid int NOT NULL default 0,

  title varchar(64) NOT NULL default "untitled",

  titleorder int NOT NULL default 255,

  moderator int NOT NULL default 0,

  moderatorname varchar(24) NOT NULL default "Administrator",

  stats varchar(255),  

  options varchar(255),  

  titlefield char(1) NOT NULL default "0",

  numfield varchar(24) NOT NULL default "N",

  prefix char(1),

  PRIMARY KEY (id)

  )';

  break;



case 'mssql':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id int NOT NULL CONSTRAINT pk_'.$qtf_prefix.'qtaforum PRIMARY KEY,

  type char(1) NOT NULL default "0",

  status char(1) NOT NULL default "0",

  notify char(1) NOT NULL default "1",

  domainid int NOT NULL default 0,

  title varchar(64) NOT NULL default "untitled",

  titleorder int NOT NULL default 0,

  moderator int NOT NULL default 0,

  moderatorname varchar(24) NOT NULL default "Administrator",

  stats varchar(255) NULL,  

  options varchar(255),  

  titlefield char(1) NOT NULL default "0",

  numfield varchar(24) NOT NULL default "N",

  prefix char(1) NULL

  )';

  break;



case 'pg':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id integer,

  type char(1) NOT NULL default "0",

  status char(1) NOT NULL default "0",

  notify char(1) NOT NULL default "1",

  domainid integer NOT NULL default 0,

  title varchar(64) NOT NULL default "untitled",

  titleorder integer NOT NULL default 255,

  moderator integer NOT NULL default 0,

  moderatorname varchar(24) NOT NULL default "Administrator",

  stats varchar(255) NULL,  

  options varchar(255) NULL,  

  titlefield char(1) NOT NULL default "0",

  numfield varchar(24) NOT NULL default "N",

  prefix char(1) NULL,

  PRIMARY KEY (id)

  )';

  break;



case 'sqlite':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id integer,

  type text NOT NULL default "0",

  status text NOT NULL default "0",

  notify text NOT NULL default "1",

  domainid integer NOT NULL default 0,

  title text NOT NULL default "untitled",

  titleorder integer NOT NULL default 255,

  moderator integer NOT NULL default 0,

  moderatorname text NOT NULL default "Administrator",

  stats text,  

  options text,  

  titlefield text NOT NULL default "0",

  numfield text NOT NULL default "N",

  prefix text,

  PRIMARY KEY (id)

  )';

  break;

  

case 'ibase':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id integer,

  type char(1) default "0",

  status char(1) default "0",

  notify char(1) default "1",

  domainid integer default 0,

  title varchar(64) default "untitled",

  titleorder integer default 255,

  moderator integer default 0,

  moderatorname varchar(24) default "Administrator",

  stats varchar(255),  

  options varchar(255),  

  titlefield char(1) default "0",

  numfield varchar(24) default "N",

  prefix char(1),

  PRIMARY KEY (id)

  )';

  break;



case 'db2':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id integer NOT NULL,

  type char(1) NOT NULL default "0",

  status char(1) NOT NULL default "0",

  notify char(1) NOT NULL default "1",

  domainid integer NOT NULL default 0,

  title varchar(64) NOT NULL default "untitled",

  titleorder integer NOT NULL default 255,

  moderator integer NOT NULL default 0,

  moderatorname varchar(24) NOT NULL default "Administrator",

  stats varchar(255),  

  options varchar(255),  

  numfield varchar(24) NOT NULL default "N",

  titlefield char(1) NOT NULL default "0",

  prefix char(1),

  PRIMARY KEY (id)

  )';

  break;



case 'oci':

  $strQ='CREATE TABLE '.$qtf_prefix.'qtaforum (

  id number(32),

  type char(1) default "0" NOT NULL,

  status char(1) default "0" NOT NULL,

  notify char(1) default "1" NOT NULL,

  domainid number(32) default 0 NOT NULL,

  title varchar2(64) default "untitled" NOT NULL,

  titleorder number(32) default 255 NOT NULL,

  moderator number(32) default 0 NOT NULL,

  moderatorname varchar2(24) default "Administrator" NOT NULL,

  stats varchar2(255),  

  options varchar2(255),  

  numfield varchar2(24) default "N" NOT NULL,

  titlefield char(1) default "0" NOT NULL,

  prefix char(1),

  CONSTRAINT pk_'.$qtf_prefix.'qtaforum PRIMARY KEY (id))';

  break;



default:

 die('Database type ['.$this->type.'] not supported... Must be mysql, mssql, pg, db2, oci');

 

}



echo '<span style="color:blue">';

$b=$oDB->Query($strQ);

echo '</span>';



if ( !empty($oDB->error) || !$b )

{

  echo '<div class="setup_err">',sprintf ($L['E_install'],$qtf_prefix.'qtaforum',$qtf_database,$qtf_user),'</div>';

  echo '<br/><table cellspacing="0" class="ta_button"><tr><td></td><td class="td_button" style="width:120px">&nbsp;<a href="qtf_setup_1.php">',$L['Restart'],'</a>&nbsp;</td></tr></table>';

  exit;

}



$strQ='INSERT INTO '.$qtf_prefix.'qtaforum (

id,type,status,notify,domainid,title,titleorder,moderator,moderatorname,stats,options,titlefield,numfield,prefix)

VALUES (0,"1","0","0",0,"Admin section",0,0,"Admin","topics=0;replies=0;members=1","logo=0","0","N","a")';



$oDB->Query($strQ);



?>
Return current item: QuickTalk Forum