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

// QuickTalk 2.5 build:20100924

switch($oDB->type)
{

case 'mysql4':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24),
  setting varchar(255),
  loaded char(1),
  PRIMARY KEY (param)
  )';
  break;

case 'mysql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24),
  setting varchar(255),
  loaded char(1),
  PRIMARY KEY (param)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24) NOT NULL CONSTRAINT pk_'.$qtf_prefix.'qtasetting PRIMARY KEY,
  setting varchar(255),
  loaded char(1)
  )';
  break;
  
case 'pg':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24),
  setting varchar(255),
  loaded char(1),
  PRIMARY KEY (param)
  )';
  break;

case 'sqlite':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param text,
  setting text,
  loaded text,
  PRIMARY KEY (param)
  )';
  break;
  
case 'ibase':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24),
  setting varchar(255),
  loaded char(1),
  PRIMARY KEY (param)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar(24) NOT NULL,
  setting varchar(255),
  loaded char(1),
  PRIMARY KEY (param)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtasetting (
  param varchar2(24),
  setting varchar2(255),
  loaded char(1),
  CONSTRAINT pk_'.$qtf_prefix.'qtasetting PRIMARY KEY (param))';
  break;
  
default:
  die('Database type ['.$oDB->type.'] not supported... Must be mysql, mssql, pg, db2, sqlite, 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.'qtasetting',$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;
}

$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("version", "2.5", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("board_offline", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("site_name", "QT-cute", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("site_url", "http://", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("home_menu", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("home_name", "Home", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("home_url", "http://www.qt-cute.org", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("admin_email", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("admin_fax", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("admin_name", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("admin_addr", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("posts_per_topic", "100", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("chars_per_post", "4000", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("lines_per_post", "250", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("time_zone", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_time_zone", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("posts_delay", "4", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("posts_per_day", "100", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("site_width", "780", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("register_safe", "text", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("smtp_password", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("smtp_username", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("smtp_host", "", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("use_smtp", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("sys_welcome", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("topics_per_page", "20", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("replies_per_page", "20", "1")');
$str='english';
if ( $_SESSION['qtf_setup_lang']=='fr' ) $str='francais';
if ( $_SESSION['qtf_setup_lang']=='nl' ) $str='nederlands';
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("language", "'.$str.'", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("userlang", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("section_desc", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_banner", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_legend", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("index_name", "Forum index", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("skin_dir", "default", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("javamail", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("bbc", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("avatar", "gif", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("avatar_width", "120", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("avatar_height", "120", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("avatar_size", "20", "")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("formatdate", "j M Y", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("formattime", "G:i", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_id", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("id_format", "T-%03s", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_back", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("news_on_top", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_closed", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("register_mode", "direct", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("visitor_right", "5", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("login_qte_web", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("login_qte", "0", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("register_coppa", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_quick_reply", "1", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_calendar", "U", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("upload", "M", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("upload_size", "500", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("show_stats", "U", "1")');
$result=$oDB->Query('INSERT INTO '.$qtf_prefix.'qtasetting VALUES ("tags", "M", "1")'); //v 2.0

?>
Return current item: QuickTalk Forum