*
* File Name : senden.html
* Last Update : 2011-01-03
*/
include('glob/start.php');
create_thispage($thispage['id'],$thispage['uri'],$thispage['title']);
////////////////////////// P R E P A R E
if(defined('USER_ID')){
$userdata = user_get(USER_ID);
$post['formularfeldeins'] = USER_USERNAME;
$post['formularfeldzwei'] = $userdata['email'];
}
if($_POST){
$object = $_POST['object'];
$url = $_POST['url'];
$plus = $_POST['plus'];
}
if(!$object) $object = 'Webseite';
$emailintro = 'Community für alle Rennspiele-Fans, Gamer und Racer mit den aktuellsten Informationen, Rennspiele-Datenbank, Most Wanted-Charts, Downloads, Interviews und vielem mehr.';
if($object=='Artikel'){
$result = $sm_db->query("SELECT id, title, subtitle, text FROM news WHERE id='$plus'") or mysql_die($sm_db); $querynum2++;
$db = mysqli_fetch_assoc($result);
$title = stripslashes($db['title']);
$subtitle = nl2br(stripslashes($db['subtitle']));
$text = nl2br(stripslashes($db['text']));
preg_match_all('/IMG[RL][0-9]+/', $text, $matches);
foreach($matches[0] as $val){
$nimg[$val] = '/'.$val.'/';
}
if($nimg) $text = preg_replace($nimg, " ", $text);
$titleurl = $url;
$emailsubject = 'Artikel: '.$title;
$emailintro = 'schickt Ihnen den Artikel "'.$title.'", präsentiert von '.SITE_TITLE.' - der '.$emailintro;
$emailcontent = '
----------------------------------------------------
'.$title.'
'.$subtitle.'
'.$text.'
----------------------------------------------------';
} else if($object=='Bild'){
$title = $games_title[$plus];
$titleurl = SITE_URL.'/'.uri_get($page[$page['childrendb'][SITE_PAGE_GAMES]]['uri'].$plus,0,0,0,'img',0);
$emailsubject = 'Bild zum Spiel '.$title;
$emailintro = 'schickt Ihnen ein Bild zum Spiel "'.$title.'", präsentiert von '.SITE_TITLE.' - der '.$emailintro;
$emailcontent = '
----------------------------------------------------
zur Bildergalerie von '.$title.'
----------------------------------------------------';
} else {
$url = SITE_URL;
$title = SITE_TITLE;
$titleurl = $url;
$emailsubject = 'Webseitenempfehlung';
$emailintro = 'empfiehlt Ihnen die Webseite '.SITE_TITLE.' - die '.$emailintro;
}
////////////////////////// A C T I O N
if($form=='dnewettettr'){
////// p r e p a r e
$varpost = array('post_count_vid','formularfeldeins','formularfeldzwei','send_to_name','send_to_mail','text');
$obligatory = array('formularfeldeins','formularfeldzwei','send_to_name','send_to_mail');
foreach ($varpost as $val){
$post[$val] = $_POST[$val];
if(in_array($val, $obligatory) && empty($post[$val])){
$post['error'] = 'Es wurden nicht alle Pflichtfelder ausgefüllt.';
}
}
////// f o r m l o g
$formlogcont = (($_POST['email'])?'SPAM: input trap = '.$_POST['email'].'
':NULL).$object.' - '.$post['formularfeldeins'].' ('.$post['formularfeldzwei'].') - '.$post['send_to_name'].' ('.$post['send_to_mail'].')
'.$url.'
'.nl2br(stripslashes($post['text'])).'
'.(($_POST['verification'])?md5($_POST['verification']):'No Captcha Input').' - '.$_SESSION['captcha'];
$formlogresult = $sm_db->query("INSERT INTO formlog (count_vid, date, typ, content) VALUES ('".$post['post_count_vid']."', now(), '3', '$formlogcont')");
if(!$post['error'] && !$_POST["verification"] || md5($_POST["verification"])!=$_SESSION['captcha']){
unset($_SESSION['captcha']);
$post['error'] = 'Der Sicherheitscode ist falsch!';
}elseif(array_key_exists('email', $_POST)){
$post['error'] = 'Ein Fehler ist aufgetreten. Wenden Sie sich an den Webmaster!';
}elseif(!array_key_exists('post_count_vid', $_POST)){
$post['error'] = 'Ein Fehler ist aufgetreten. Wenden Sie sich an den Webmaster!';
}
if (!$post['subject']) $post['subject'] = 'kein Betreff';
//Pr�fmuster
$pruefung = array(
'formularfeldzwei' => '/^ [\w.!#%&\*\/=\?\^\`\{\|\}\~+-]{1,64}\@ [[:alnum:].-]{1,255} \. [a-z]{2,6} $/xi',
'formularfeldeins' => '/^[[:print:]]{3,}$/',
'send_to_mail' => '/^ [\w.!#%&\*\/=\?\^\`\{\|\}\~+-]{1,64}\@ [[:alnum:].-]{1,255} \. [a-z]{2,6} $/xi',
'send_to_name' => '/^[[:print:]]{3,}$/',
'text' => '/^[[:print:][:space:]]{3,}$/'
);
//Eingabepr�fung
foreach($post as $key=>$val) {
if(isset($pruefung[$key])) {
if(!preg_match($pruefung[$key], $val)) $post['error'] = 'Es sind Probleme aufgetreten.';
}
}
if(!getmxrr(substr(strstr($post['formularfeldzwei'], '@'), 1), $mxhosts)) $post['error'] = "Es konnte keine g�ltige Domain f�r ".$post['formularfeldzwei']." gefunden werden!";
if(!getmxrr(substr(strstr($post['send_to_mail'], '@'), 1), $mxhosts)) $post['error'] = "Es konnte keine g�ltige Domain f�r ".$post['send_to_mail']." gefunden werden!";
}
if(!array_key_exists('error', $post)){
if(array_key_exists('text', $post)){
$emailcontent = '
----------------------------------------------------
Kommentar von '.$post['formularfeldeins'].':
'.nl2br(stripslashes($post['text'])).'
----------------------------------------------------'.$emailcontent;
}
$emailbody = '
| Hallo '.$post['send_to_name'].', '.$post['formularfeldeins'].' ('.$post['formularfeldzwei'].') '.$emailintro.$emailcontent.' '.SITE_COPY.' |
Vorschau
Fehler: '.$post['error'].'
':NULL). (($post['success'])?''.$post['success'].'
':NULL). $c_body; include('glob/end.php'); ?>