Location: PHPKode > projects > QuickTicket > quickticket/quickticket/install/qti_setup_topic.inc
<?php

// QuickTicket 1.9.0.3 build:20081001

switch(substr($oDB->type,0,5))
{

case 'mysql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id int,
  numid int NOT NULL default 0,
  forum int NOT NULL default 0,
  type char(1) NOT NULL default "T",
  status char(1) NOT NULL default "0",
  wisheddate varchar(20) NOT NULL default "0",
  firstpostid int NOT NULL default 0,
  lastpostid int NOT NULL default 0,
  firstpostuser int NOT NULL default 0,
  lastpostuser int NOT NULL default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20) NOT NULL default "0",
  lastpostdate varchar(20) NOT NULL default "0",
  x decimal(13,10),
  y decimal(13,10),
  z decimal(13,2),
  actorid int,
  actorname varchar(24),
  notifiedid int,
  notifiedname varchar(24),
  replies int NOT NULL default 0,
  views int NOT NULL default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id int NOT NULL CONSTRAINT pk_'.$qti_prefix.'qtitopic PRIMARY KEY,
  numid int NOT NULL default 0,
  forum int NOT NULL default 0,
  type char(1) NOT NULL default "T",
  status char(1) NOT NULL default "0",
  wisheddate varchar(20) NOT NULL default "0",
  firstpostid int NOT NULL default 0,
  lastpostid int NOT NULL default 0,
  firstpostuser int NOT NULL default 0,
  lastpostuser int NOT NULL default 0,
  firstpostname varchar(24) NULL,
  lastpostname varchar(24) NULL,
  firstpostdate varchar(20) NOT NULL default "0",
  lastpostdate varchar(20) NOT NULL default "0",
  actorid int NULL,
  actorname varchar(24) NULL,
  notifiedid int NULL,
  notifiedname varchar(24) NULL,
  x decimal(13,10) NULL,
  y decimal(13,10) NULL,
  z decimal(13,2) NULL,
  replies int NOT NULL default 0,
  views int NOT NULL default 0
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id integer,
  numid integer NOT NULL default 0,
  forum integer NOT NULL default 0,
  type char(1) NOT NULL default "T",
  status char(1) NOT NULL default "0",
  wisheddate varchar(20) NOT NULL default "0",
  firstpostid integer NOT NULL default 0,
  lastpostid integer NOT NULL default 0,
  firstpostuser integer NOT NULL default 0,
  lastpostuser integer NOT NULL default 0,
  firstpostname varchar(24) NULL,
  lastpostname varchar(24) NULL,
  firstpostdate varchar(20) NOT NULL default "0",
  lastpostdate varchar(20) NOT NULL default "0",
  actorid integer NULL,
  actorname varchar(24) NULL,
  notifiedid integer NULL,
  notifiedname varchar(24) NULL,
  x decimal(13,10) NULL,
  y decimal(13,10) NULL,
  z decimal(13,2) NULL,
  replies integer NOT NULL default 0,
  views integer NOT NULL default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id integer,
  numid integer default 0,
  forum integer default 0,
  type char(1) default "T",
  status char(1) default "0",
  wisheddate varchar(20) default "0",
  firstpostid integer default 0,
  lastpostid integer default 0,
  firstpostuser integer default 0,
  lastpostuser integer default 0,
  firstpostname varchar(24) default NULL,
  lastpostname varchar(24) default NULL,
  firstpostdate varchar(20) default "0",
  lastpostdate varchar(20) default "0",
  actorid integer default NULL,
  actorname varchar(24) default NULL,
  notifiedid integer default NULL,
  notifiedname varchar(24) default NULL,
  x decimal(13,10) default NULL,
  y decimal(13,10) default NULL,
  z decimal(13,2) default NULL,
  replies integer default 0,
  views integer default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'sqlit':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id integer,
  numid integer NOT NULL default 0,
  forum integer NOT NULL default 0,
  type text NOT NULL default "T",
  status text NOT NULL default "0",
  wisheddate text default "0",
  firstpostid integer NOT NULL default 0,
  lastpostid integer NOT NULL default 0,
  firstpostuser integer NOT NULL default 0,
  lastpostuser integer NOT NULL default 0,
  firstpostname text,
  lastpostname text,
  firstpostdate text default "0",
  lastpostdate text default "0",
  actorid integer,
  actorname text,
  notifiedid integer,
  notifiedname text,
  x real,
  y real,
  z real,
  replies integer NOT NULL default 0,
  views integer NOT NULL default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'acces':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id int CONSTRAINT pk_'.$qti_prefix.'qtitopic PRIMARY KEY,
  numid int,
  forum int,
  type char(1),
  status char(1),
  wisheddate varchar(20),
  firstpostid int,
  lastpostid int,
  firstpostuser int,
  lastpostuser int,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  actorid int,
  actorname varchar(24),
  notifiedid int,
  notifiedname varchar(24),
  x float,
  y float,
  z float,
  replies int,
  views int
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id integer NOT NULL,
  numid integer NOT NULL default 0,
  forum integer NOT NULL default 0,
  type char(1) NOT NULL default "T",
  status char(1) NOT NULL default "0",
  wisheddate varchar(20) NOT NULL default "0",
  firstpostid integer NOT NULL default 0,
  lastpostid integer NOT NULL default 0,
  firstpostuser integer NOT NULL default 0,
  lastpostuser integer NOT NULL default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20) NOT NULL default "0",
  lastpostdate varchar(20) NOT NULL default "0",
  x decimal(13,10),
  y decimal(13,10),
  z decimal(13,2),
  actorid int,
  actorname varchar(24),
  notifiedid int,
  notifiedname varchar(24),
  replies integer NOT NULL default 0,
  views integer NOT NULL default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'ifx':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id integer,
  numid integer default 0 NOT NULL,
  forum integer default 0 NOT NULL,
  type char(1) default "T" NOT NULL,
  status char(1) default "0" NOT NULL,
  wisheddate varchar(20) default "0" NOT NULL,
  firstpostid integer default 0 NOT NULL,
  lastpostid integer default 0 NOT NULL,
  firstpostuser integer default 0 NOT NULL,
  lastpostuser integer default 0 NOT NULL,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20) default "0" NOT NULL,
  lastpostdate varchar(20) default "0" NOT NULL,
  x decimal(13,10),
  y decimal(13,10),
  z decimal(13,2),
  actorid int,
  actorname varchar(24),
  notifiedid int,
  notifiedname varchar(24),
  replies integer default 0 NOT NULL,
  views integer default 0 NOT NULL,
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qti_prefix.'qtitopic (
  id number(32),
  numid number(32) default 0 NOT NULL,
  forum number(32) default 0 NOT NULL,
  type char(1) default "T" NOT NULL,
  status char(1) default "0" NOT NULL,
  wisheddate varchar2(20) default "0" NOT NULL,
  firstpostid number(32) default 0 NOT NULL,
  lastpostid number(32) default 0 NOT NULL,
  firstpostuser number(32) default 0 NOT NULL,
  lastpostuser number(32) default 0 NOT NULL,
  firstpostname varchar2(24),
  lastpostname varchar2(24),
  firstpostdate varchar2(20) default "0" NOT NULL,
  lastpostdate varchar2(20) default "0" NOT NULL,
  x decimal(13,10),
  y decimal(13,10),
  z decimal(13,2),
  actorid int,
  actorname varchar2(24),
  notifiedid int,
  notifiedname varchar2(24),
  replies number(32) default 0 NOT NULL,
  views number(32) default 0 NOT NULL,
  CONSTRAINT pk_'.$qti_prefix.'qtitopic PRIMARY KEY (id))';
  break;

default:
  die("Database type [{$oDB->type}] not supported... Must be mysql, mssql, pg, oracle, sqlite, firebird, db2, ifx or access");

}

echo '<div style="margin-left:20px; color:blue;">';
$b=$oDB->Query($strQ);
echo '</div>';

if ( !empty($oDB->error) || !$b )
{
  echo '<div class="div_setup_err">',sprintf ($L['E_install'],$qti_prefix.'qtitopic',$qti_database,$qti_user),'</div>';
  echo '<br/><table cellspacing="0" class="ta_button"><tr><td></td><td class="td_button" style="width:120px">&nbsp;<a href="qti_setup_1.php">',$L['Restart'],'</a>&nbsp;</td></tr></table>';
  exit;
}

?>
Return current item: QuickTicket