<?php
function getmsg( $sect, $lang ){
##############################################################
#	these vars must be adopted to given environment
	$sqlhost = 'localhost';		# hostname
	$sqluser = 'otdb';		# mysql username
	$sqlpw = 'newvisions';		# mysql user password
	$sqldb = 'otdb';		# mysql database name
	$langs = array( 'de', 'en' );	# valid languages, first=default
##############################################################
	if( !mysql_connect( $sqlhost, $sqluser, $sqlpw )) {
		echo "<p>Oops, die Datenbank ist nicht verf&uuml;gbar. Bitte ";
		echo "sp&auml;ter noch mal versuchen - sorry!!</p>";
		exit;
	}
	mysql_select_db( $sqldb );
	$langno = count( $langs );
	for( $i = 0; $i < $langno && $langs[$i] != $lang; $i++ );
	if( $i == $langno ) $lang = $langs[0];
	if( !$id = mysql_query( "select txt from msg
		where sect = $sect and lang = '$lang'" )){
		echo "Error No. 1: ".mysql_errno().": ".mysql_error();
		exit;
	}
	if( !$row = mysql_fetch_array( $id )){
		echo "Serious error: All website texts missing!";
		exit;
	}
	return( explode( '|', $row[ 'txt' ] ));
}

$t = getmsg( 10, $lang );
$_admin = $t[0];	# memb_id of admins imploded by '#'
$x = explode( '*', $t[10] );
$_page = $x[0];
$_text = $x[1];
$_link = $x[2];
$_vlink = $x[3];
$_alink = $x[4];
$x = explode( '*', $t[11] );
$_bg1 = $x[0];		# dark bg: dark grey
$_bg2 = $x[1];		# medium bg: medium grey
$_bg3 = $x[2];		# light bg: light grey
$_bg4 = $x[3];		# special: grayed yellow
$_bg5 = $x[4];		# special: light yellow
$x = explode( '*', $t[12] );
$_fg1 = $x[0];		# normal: black
$_fg2 = $x[1];		# important: blue
$_fg3 = $x[2];		# alarm: red
$_fg4 = $x[3];		# ok: green
$_fg5 = $x[4];		# special: comment link color
$_fontfoot = $t[15];	# foot text font
$_fontbulk = $t[16];	# bulk text font
$_fontinpt = $t[17];	# input text font (forms)
$_fontmenu = $t[18];	# menu font
$_fonthdln = $t[19];	# headline font

for( $i = 1; $i <= $t[20]; $i++ ) $_lk1[] = $t[ 20 + $i ];
for( $i = 1; $i <= $t[30]; $i++ ) $_lk2[] = $t[ 30 + $i ];

$x = explode( "'", $t[23] );
if( empty( $x )) $x = explode( '"', $t[23] );
$link_rules = $x[1];

$_ismemb = $t[28];
$_ismaint = $t[29];

$x = explode( "'", $t[32] );
if( empty( $x )) $x = explode( '"', $t[32] );
$link_faqs = $x[1];

$domain = $t[40];	# domain name
$fqdomain = $t[41];	# full qualified name of web domain
$maildom = $t[42];	# mail domain name
$ot_maint = $t[43];	# ot maintainer (email without domain)
$_src = $t[44];		# source
$_who = $t[45];		# contact
$_title = $t[46];	# page title prefix

# keep some global texts
for( $i = 1; $i <= $t[50]; $i++ ) $_x[] = $t[ 50 + $i ];

$_arc = $t[70];		# archives
$_act = $t[71];		# active
$_ini = $t[72];		# new (=ini)
$_fin = $t[73];		# final
$_ver = $t[74];		# version
?>