if($_SERVER[HTTP_HOST] == 'localhost'){
$domain = 'localhost';
}else{
$domain_parameter = explode(".",$_SERVER[HTTP_HOST]);
for($i = 10 ; $i >= 0 ; $i--){
if($domain_parameter[$i] != NULL){
if($tld == NULL){
$tld = $domain_parameter[$i];
$i--;
$domain_save = $domain_parameter[$i];
$domain = $domain_save.".".$tld;
$i--;
$smarty->assign("domain",$domain);
if(!$domain_ok OR !$domain_check){
$check = mysql_fetch_array(mysql_query("SELECT domain FROM domain WHERE domain='".mysql_real_escape_string($domain)."'"));
/* if($check['domain'] == $domain){
$domain_ok = 1;
}else{
$domain_ok = NULL;
echo "<center>Diese Seite wurde von einer nicht genehmigten Domain aufgerufen.<br><br>Bitte verst?ndigen Sie den Administrator per E-Mail unter <a href='mailto:********@*******.de'>********@*********.de</a>.<br><br>Sie gelangen zu der gew?nschten Seite ?ber folgenden Link: <a href='http://www.zur-auktion.de'>www.zur-auktion.de</a></center>";
exit;
}*/
}
}
$id_search = explode("_",$domain_parameter[$i]);
if($id_search['0'] == "id"){
$id = $id_search['1'];
}
if($domain_parameter[$i] != 'www'){
if(!$get_user AND !$get_domain){
$user_array = mysql_fetch_array(mysql_query("SELECT user,domain FROM user WHERE user='".mysql_real_escape_string($domain_parameter[$i])."' AND domain='".mysql_real_escape_string($domain)."'"));
$get_user = $user_array['user'];
$get_domain = $user_array['domain'];
}
if(!$get_auktion AND $get_user OR !$get_auktionshaus AND !$get_user){
$auktion_array = mysql_fetch_array(mysql_query("SELECT name2 FROM auktionshaus WHERE name2='".mysql_real_escape_string($domain_parameter[$i])."' AND aktiv=1"));
if(!$get_auktion AND $get_user){
$get_auktion = $auktion_array['name2'];
}elseif(!$get_auktionshaus AND !$get_user){
$get_auktionshaus = $auktion_array['name2'];
}
}
if($get_auktionshaus AND $get_user){
$auktion_array = mysql_fetch_array(mysql_query("SELECT name2 FROM auktionshaus WHERE name2='".mysql_real_escape_string($domain_parameter[$i])."' AND aktiv=1"));
$get_auktion = $get_auktionshaus;
$get_auktionshaus = NULL;
}
if(!$get_pages){
$pages_array = mysql_fetch_array(mysql_query("SELECT page, page_title, pfad FROM page WHERE page='".mysql_real_escape_string($domain_parameter[$i])."'"));
$get_pages = $pages_array['page'];
$smarty->assign("site_title",$pages_array['page_title']);
if($pages_array['pfad']){
include($pages_array['pfad']);
}
}
}
}
}
}