<?php
define("NO_ONLINE", 1);
define("IN_MYBB", 1);
$templatelist = "contact";
require_once("./global.php");
$lang->load('member');
global $mybb;
if ($mybb->user['uid']!=0){
$uname = $mybb->user['username'];
}
else{
$uname = 'Gast';
}
if($mybb->request_method == 'post')
{
if($mybb->settings['captchaimage'] == 1 && function_exists("imagecreatefrompng"))
{
$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string(my_strtolower($mybb->input['imagestring']));
$query = $db->simple_select("captcha", "*", "imagehash='$imagehash' AND LOWER(imagestring)='$imagestring'");
$imgcheck = $db->fetch_array($query);
if(!$imgcheck['dateline'])
{
$db->delete_query("captcha", "imagehash='$imagehash'");
error($lang->error_regimageinvalid);
}
$db->delete_query("captcha", "imagehash='$imagehash'");
}
if(!validate_email_format($mybb->input['mail']) || $mybb->input['title'] == '' || $mybb->input['text'] == '')
{
error('Die Eingaben sind leider nicht vollständig.');
}
$mybb->input['title'] = $mybb->input['title'].' von '.$uname;
my_mail($mybb->settings['adminemail'], 'Kontakt-Formular: '.$mybb->input['title'], $mybb->input['text'], $mybb->input['mail']);
redirect("{$mybb->settings['bburl']}/contact.php", "Die Nachricht wurde gesendet.");
}
add_breadcrumb("Kontakt", "contact.php");
if($mybb->settings['captchaimage'] == 1 && function_exists("imagecreatefrompng"))
{
$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$regimagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $regimagearray);
}
eval("\$contact = \"".$templates->get("contact")."\";");
output_page($contact);
?>