<?php

$main_path = dirname($_SERVER["SCRIPT_NAME"]);
if ($main_path == "/") unset($main_path); 
$main_script = $_SERVER["SCRIPT_NAME"];
$www_dir = realpath(dirname(__FILE__));
//data directory for uploads without trailing slash
$www_data_dir = $www_dir . "/data";

$base_url = $_SERVER["HTTP_HOST"];
$rel_path = relPath(realpath(dirname($_SERVER["SCRIPT_FILENAME"])),realpath(dirname(__FILE__)));
if (!$rel_path) $rel_path = ".";
$conf_data_dir = $rel_path . "/data";

/**********
 * Your Settings
 **********/

$img_ext_arr = array("jpg", "jpeg", "png", "gif");

//connection-infos for your database
$db_host = "localhost";                             //change!!
$db_user = "dbusr";                               //change!!
$db_pass = "dbpwd";                               //change!!
$db_name = "dbnom";                               //change!!

$ftable_prefix = "sbb42_";						//change, leave or undef it ...

//mail to send db-errors to - used in dbquery-function (functions.php)
$conf_admin_mail = "you@yourdomain.tld";                //change

$fdb = @mysql_connect($db_host, $db_user, $db_pass);
@mysql_select_db($db_name, $fdb);

/**** Fetch board settings ****/
if ($fdb) {
  $sql = "select * from `" . $ftable_prefix . "config` where id = 1;";
  $res = dbquery($sql);
  $board_config = @mysql_fetch_object($res);
}
//templates
$template = $board_config->template;
if (!file_exists("$rel_path/templates/$template")) $template = "defaultXHTML";
$template_path = "$rel_path/templates/$template";

//define how much topics per page should be shown, pages will be generated automatically (0 for all topics on one page)
$topics_per_page = $board_config->topics_per_page;
//board language (de/en)
$f_lang = $board_config->lang;
//output date format
$date_format = $board_config->date_format; //"Y-m-d";
$date_time_format = $board_config->date_time_format; //"Y-m-d H:i";
//board name
$f_title = $board_config->title;
//boardadmin - email address (for mails ...)
$conf_board_admin = $board_config->email_board_admin;
//email address for sending notifications (FROM) 
$conf_board_mailfrom = $board_config->email_board_mailfrom;

$version = $board_config->version;

$board_config->prefix = $ftable_prefix;


//if you've got SEO troubles, just uncomment the following line and SEO-Links will be disabled
//$board_config->seo = false;


if (function_exists(date_default_timezone_set)) {
  if ($board_config->default_timezone) date_default_timezone_set($board_config->default_timezone);
  else date_default_timezone_set(date_default_timezone_get());
}

/**** Session Part ****/
ini_set("session.gc_maxlifetime",84600);
@session_start();
$f_auth = $_SESSION["f_auth"];
$f_auth_uid = $_SESSION["f_auth_uid"];

$lang = array();
?>