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

// QuickTalk 2.5 build:20100924

switch($oDB->type)
{

case 'mysql4':
$strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id int,
  numid int default 0,
  forum int default 0,
  type char(1) default "T",
  status char(1) NOT NULL default "0",
  statusdate varchar(20) NOT NULL default "0",
  tags varchar(255),
  firstpostid int default 0,
  lastpostid int default 0,
  firstpostuser int default 0,
  lastpostuser int default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies int default 0,
  views int default 0,
  modifdate varchar(20) NOT NULL default "0",
  PRIMARY KEY (id)
)';
  break;

case 'mysql':
$strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id int,
  numid int default 0,
  forum int default 0,
  type char(1) default "T",
  statusdate varchar(20) NOT NULL default "0",
  tags varchar(4000),
  firstpostid int default 0,
  lastpostid int default 0,
  firstpostuser int default 0,
  lastpostuser int default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies int default 0,
  views int default 0,
  modifdate varchar(20) NOT NULL default "0",
  PRIMARY KEY (id)
)';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id int CONSTRAINT pk_'.$qtf_prefix.'qtatopic PRIMARY KEY,
  numid int default 0,
  forum int default 0,
  type char(1) default "T",
  status char(1) NOT NULL default "0",
  statusdate varchar(20) NOT NULL default "0",
  tags varchar(4000),
  firstpostid int default 0,
  lastpostid int default 0,
  firstpostuser int default 0,
  lastpostuser int default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies int default 0,
  views int default 0,
  modifdate varchar(20) NOT NULL default "0"
  )';
  break;
  
case 'pg':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id integer,
  numid integer default 0,
  forum integer default 0,
  type char(1) default "T",
  status char(1) NOT NULL default "0",
  statusdate varchar(20) NOT NULL default "0",
  tags varchar(4000),  
  firstpostid integer default 0,
  lastpostid integer default 0,
  firstpostuser integer default 0,
  lastpostuser integer default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies integer default 0,
  views integer default 0,
  modifdate varchar(20) NOT NULL default "0",
  PRIMARY KEY (id)
  )';
  break;

case 'sqlite':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id integer,
  numid integer default 0,
  forum integer default 0,
  type text default "T",
  status text default "0",
  statusdate text NOT NULL default "0",
  tags text,
  firstpostid integer default 0,
  lastpostid integer default 0,
  firstpostuser integer default 0,
  lastpostuser integer default 0,
  firstpostname text,
  lastpostname text,
  firstpostdate text,
  lastpostdate text,
  replies integer default 0,
  views integer default 0,
  modifdate text NOT NULL default "0",
  PRIMARY KEY (id)
  )';
  break;
  
case 'ibase':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id integer,
  numid integer default 0,
  forum integer default 0,
  type char(1) default "T",
  status char(1) default "0",
  statusdate varchar(20) default "0",
  tags varchar(4000),
  firstpostid integer default 0,
  lastpostid integer default 0,
  firstpostuser integer default 0,
  lastpostuser integer default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies integer default 0,
  views integer default 0,
  modifdate varchar(20) default "0",
  PRIMARY KEY (id)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id integer,
  numid integer default 0,
  forum integer default 0,
  type char(1) default "T",
  status char(1) default "0",
  statusdate varchar(20) NOT NULL default "0",
  tags varchar(4000),
  firstpostid integer default 0,
  lastpostid integer default 0,
  firstpostuser integer default 0,
  lastpostuser integer default 0,
  firstpostname varchar(24),
  lastpostname varchar(24),
  firstpostdate varchar(20),
  lastpostdate varchar(20),
  replies integer default 0,
  views integer default 0,
  modifdate varchar(20) NOT NULL default "0",
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtatopic (
  id number(32),
  numid number(32) default 0,
  forum number(32) default 0,
  type char(1) default "T",
  status char(1) default "0",
  statusdate varchar2(20) default "0",
  tags varchar2(4000),
  firstpostid number(32) default 0,
  lastpostid number(32) default 0,
  firstpostuser number(32) default 0,
  lastpostuser number(32) default 0,
  firstpostname varchar2(24),
  lastpostname varchar2(24),
  firstpostdate varchar2(20) default "0",
  lastpostdate varchar2(20) default "0",
  replies number(32) default 0,
  views number(32) default 0,
  modifdate varchar2(20) default "0",
  CONSTRAINT pk_'.$qtf_prefix.'qtatopic 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.'qtatopic',$qtf_database,$qtf_user),'</div>';
  echo '<br/><table cellspacing="0" class="button"><tr><td></td><td class="button" style="width:120px">&nbsp;<a href="qtf_setup_1.php">',$L['Restart'],'</a>&nbsp;</td></tr></table>';
  exit;
}

?>
Return current item: QuickTalk Forum