include "./include/config.inc.php3";
include "./include/texte.php3";
include "./sys/funktion.inc";
$html_array= file("templates/empfehlen.htm");
$html_code = implode($html_array,"");
$html_code= rubrikerstellen($html_code);
$html_code= usererlauben($html_code);
$codesenden="nein";
$query="SELECT * FROM $sitetable5 WHERE siteid='$nummer' and code='aktiv'";
$result=mysql_db_query($dbname,$query,$conn) or die (mysql_error());
while($date=mysql_fetch_array($result))
{
$ort="$date[ort]";
$plz="$date[plz]";
$name="$date[name]";
$start="$date[start]";
$ende="$date[ende]";
$platz="$date[platz]";
$preise="$date[preise]";
$beschreibung="$date[beschreibung]";
$veranstalter="$date[veranstalter]";
$kontaktinfo="$date[kontaktinfo]";
$bild="$date[bild]";
$datumeintrag="$date[datumeintrag]";
$endedatum="$date[endedatum]";
$startdatum="$date[startdatum]";
$mail="$date[mail]";
$hometitel="$date[hometitel]";
$homeurl="$date[homeurl]";
$rubrik="$date[rubrik]";
$unterrubrik="$date[unterrubrik]";
$codesenden="ja";
}
if($codesenden=="nein")
{
Header( "Location: $seitenurl/verfehler.php?$sidname=$sidsid");
exit;
}
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
if($rubrik=="")
{
$html_code="$htmla[0] $htmlb[1]";
}
else
{
$query="SELECT * FROM $sitetable3 WHERE nummer='$rubrik'";
$result=mysql_db_query($dbname,$query,$conn) or die (mysql_error());
while($date=mysql_fetch_array($result))
{
$suche_code= array(
"={name}=si",
"={session}=si"
);
$suche_text= array(
"$date[name]",
"?$sidname=$sidsid&rubrik=$date[nummer]"
);
$block_block= preg_replace ($suche_code, $suche_text, $html_block);
}
$html_code="$htmla[0] $block_block $htmlb[1]";
}
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
if($unterrubrik=="")
{
$html_code="$htmla[0] $htmlb[1]";
}
else
{
$query="SELECT * FROM $sitetable4 WHERE nummer='$unterrubrik'";
$result=mysql_db_query($dbname,$query,$conn) or die (mysql_error());
while($date=mysql_fetch_array($result))
{
$suche_code= array(
"={name}=si",
"={session}=si"
);
$suche_text= array(
"$date[name]",
"?$sidname=$sidsid&rubrik=$rubrik&unterrubrik=$date[nummer]"
);
$block_block= preg_replace ($suche_code, $suche_text, $html_block);
}
$html_code="$htmla[0] $block_block $htmlb[1]";
}
if($code=="2")
{
$codesenden=0;
$anzeige="";
if(!preg_match("=[[:alnum:]]+=i",$aname))
{
$anzeige="$anzeige $userfehler_22";
$codesenden=1;
}
if(!preg_match("=[[:alnum:]]+=i",$ename))
{
$anzeige="$anzeige $userfehler_23";
$codesenden=1;
}
if(!preg_match("=[[:alnum:]]+=i",$avname))
{
$anzeige="$anzeige $userfehler_24";
$codesenden=1;
}
if(!preg_match("=[[:alnum:]]+=i",$evname))
{
$anzeige="$anzeige $userfehler_25";
$codesenden=1;
}
if(!eregi("^([_[:alnum:]-]+)(\.[_[:alnum:]-]+)*@([[:alnum:]])([[:alnum:]\.-]+)([[:alnum:]])\.([[:alpha:]]{2,4})$",$amail))
{
$anzeige="$anzeige $userfehler_26";
$codesenden=1;
}
if(!eregi("^([_[:alnum:]-]+)(\.[_[:alnum:]-]+)*@([[:alnum:]])([[:alnum:]\.-]+)([[:alnum:]])\.([[:alpha:]]{2,4})$",$email))
{
$anzeige="$anzeige $userfehler_27";
$codesenden=1;
}
if($codesenden=="0")
{
$email= ltrim("$email");
$email= rtrim("$email");
$amail= ltrim("$amail");
$amail= rtrim("$amail");
$datei = fopen("include/empfehlenmail.dat","r");
$mailtext = "";
while (!feof($datei))
{
$mailtext .= fgets($datei,1000);
}
fclose($datei);
$mail_code= array(
"={text}=si",
"={url}=si",
"={ort}=si",
"={plz}=si",
"={name}=si",
"={vonuhr}=si",
"={bisuhr}=si",
"={veranstaltungsplatz}=si",
"={preise}=si",
"={beschreibung}=si",
"={veranstalter}=si",
"={kontaktinfo}=si",
"={datumeintrag}=si",
"={bis}=si",
"={von}=si",
"={avname}=si",
"={evname}=si",
"={ename}=si",
"={aname}=si"
);
$mail_text= array(
"$text",
"$seitenurl/veranstaltung.php?nummer=$nummer",
"$ort",
"$plz",
"$name",
"$start",
"$ende",
"$platz",
"$preise",
"$beschreibung",
"$veranstalter",
"$kontaktinfo",
"$datumeintrag",
"$endedatum",
"$startdatum",
"$avname",
"$evname",
"$ename",
"$aname"
);
$mailtext = preg_replace ($mail_code, $mail_text, $mailtext);
mail("$email","$seitenname","$mailtext","From: $amail");
$anzeige="$empfehlen_ok";
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$rub_code= array(
"={anzeige}=si"
);
$rub_text= array(
"$anzeige"
);
$block_block= preg_replace ($rub_code, $rub_text, $html_block);
$html_code= "$htmla[0] $block_block $htmlb[1]";
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$html_code= "$htmla[0] $block_block $htmlb[1]";
}
else
{
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$rub_code= array(
"={email}=si",
"={amail}=si",
"={text}=si",
"={avname}=si",
"={evname}=si",
"={ename}=si",
"={aname}=si",
"={session_form}=si"
);
$rub_text= array(
"$email",
"$amail",
"$text",
"$avname",
"$evname",
"$ename",
"$aname",
""
);
$block_block= preg_replace ($rub_code, $rub_text, $html_block);
$html_code= "$htmla[0] $block_block $htmlb[1]";
}
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$rub_code= array(
"={anzeige}=si"
);
$rub_text= array(
"$anzeige"
);
$block_block= preg_replace ($rub_code, $rub_text, $html_block);
$html_code= "$htmla[0] $block_block $htmlb[1]";
}
else
{
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$html_code= "$htmla[0] $block_block $htmlb[1]";
$htmla= explode("", "$html_code");
$htmlb= explode("", "$htmla[1]");
$html_block= $htmlb[0];
$block_block="";
$rub_code= array(
"={email}=si",
"={amail}=si",
"={text}=si",
"={avname}=si",
"={evname}=si",
"={ename}=si",
"={aname}=si",
"={session_form}=si"
);
$rub_text= array(
"$email",
"$amail",
"$text",
"$avname",
"$evname",
"$ename",
"$aname",
""
);
$block_block= preg_replace ($rub_code, $rub_text, $html_block);
$html_code= "$htmla[0] $block_block $htmlb[1]";
}
$php_code= array(
"={ort}=si",
"={plz}=si",
"={name}=si",
"={vonuhr}=si",
"={bisuhr}=si",
"={veranstaltungsplatz}=si",
"={preise}=si",
"={beschreibung}=si",
"={veranstalter}=si",
"={kontaktinfo}=si",
"={bild}=si",
"={datumeintrag}=si",
"={bis}=si",
"={von}=si",
"={mail}=si",
"={hometitel}=si",
"={link}=si",
"={session2}=si",
"={datum}=si",
"={session}=si",
"={coby}=si",
"={session_form}=si"
);
$php_text= array (
"$ort",
"$plz",
"$name",
"$start",
"$ende",
"$platz",
"$preise",
"$beschreibung",
"$veranstalter",
"$kontaktinfo",
"",
"$datumeintrag",
"$endedatum",
"$startdatum",
"$mail",
"$hometitel",
"$homeurl",
"?$sidname=$sidsid&nummer=$nummer",
"$seitendatum",
"?$sidname=$sidsid",
"$coby",
""
);
$html_text = preg_replace ($php_code, $php_text, $html_code);
echo("$html_text");
?>