array( 'r' => 'Если вы хотите что-нибудь написать нам, просто заполните форму ниже: ', 'e' => 'If you want to write something to us, just fill out form below:' ), 'answ' => array( 'r' => 'Если вы рассчитываете получить ответ, укажите свой e-mail адрес и имя: ', 'e' => 'If you would like to have some respond from us, please provide your name and e-mail:' ), 'name' => array( 'r' => 'имя', 'e' => 'name' ), 'send' => array( 'r' => 'Отправить', 'e' => 'Send' ), 'feedback' => array( 'r' => 'Обратная связь', 'e' => 'Feedback' ), 'error' => array( 'r' => 'ошибка', 'e' => 'error' ), 'success' => array( 'r' => 'Ваше сообщение успешно отправлено!', 'e' => 'Your message is successfully sent!' ), 'thank' => array( 'r' => 'Спасибо за внимание и интерес к нашему сайту!', 'e' => 'Thank you for your interest in our site!' ), 'return' => array('r' => 'Вернуться на сайт', 'e' => 'Return to the site'), 'wrong_email' => array( 'r' => 'неправильно указан e-mail адрес', 'e' => 'wrong e-mail address'), ); function contact_form( $email, $ename, $etext, $lang) { global $msg; $email = htmlspecialchars( $email); $ename = htmlspecialchars( $ename); $etext = htmlspecialchars( $etext); //echo "Если вы хотите что-нибудь написать нам, просто заполните форму ниже:\n"; echo $msg['exp'][$lang] . "\n"; echo "

\n"; echo "

\n"; echo $msg['answ'][$lang] . "\n"; echo "

"; echo "e-mail: \n"; echo "    "; echo $msg['name'][$lang]. ":

\n"; echo '\n"; echo '\n"; echo "\n"; echo "
\n"; } function send_email( $etext, $email, $ename, $eref) { global $feedback_email; if( strlen($ref) < 3 ) { return 1; } if( stristr($ename, 'free') ) { return 1; } if( stristr($ename, 'sex') ) { return 1; } if( stristr($ename, 'ringtone') ) { return 1; } if( stristr($ename, 'ring tone') ) { return 1; } if( strstr($email, 'tinam@narod.ru') ) { return 1; } if( '70.176.47.246' == $_SERVER['REMOTE_ADDR'] ) { return 1; } if( '207.245.84.70' == $_SERVER['REMOTE_ADDR'] ) { return 1; } $headers = 'From: feedback@kphoto.ru'."\n"; $headers .= 'Content-Type: text/plain; charset=koi8-r'."\n"; $body = 'email: '.$email."\n"; $body = $body .'name: '. $ename ."\n"; $body = $body .'ip: '. $_SERVER['REMOTE_ADDR'] ."\n"; $body = $body .'ref: '. $eref ."\n\n"; $body = $body . $etext ."\n"; return smail( $feedback_email, 'Feedback from www.kphoto.ru', $body, $headers ); } function process_send( $etext, $email, $ename, $eref, $lang) { global $msg; $etext = htmlspecialchars( $etext); $email = htmlspecialchars( $email); $ename = htmlspecialchars( $ename); if( strlen($etext) < 3 ) { return 0; } if( strlen( $email) > 1 ) { if( !preg_match( '/^[\w\.\-]+@[\w\.\-]+\.[\w]+$/', $email)) { echo "
"; echo $msg['error'][$lang] .": "; echo $msg['wrong_email'][$lang]; echo " "$email"
"; return 0; } } if( send_email($etext, $email, $ename, $eref) ) { echo "
"; echo $msg['success'][$lang] . "\n
"; echo $msg['thank'][$lang] ."\n"; echo "
"; } else { echo $msg['error'][$lang]; } back_button($lang); return 1; } function back_button($lang) { global $siteurl, $msg; echo "

"; echo "" . $msg['return'][$lang] . "\n"; echo "

"; } include_once('mbase.php'); include_once('../album/kphoto.php'); $kp = new KPhoto; if( $_REQUEST['lang'] == 'e' ) { $lang = 'e'; } else { $lang = 'r'; } $kp->set ('lang', $lang); $kp->set ('content_background', '#e2e2e2'); $kp->add ('left', $msg['feedback'][$lang], 0); $kp->top_bar_tbl(); echo "
\n"; if( $_REQUEST['send']) { if( !process_send( $_REQUEST['etext'], $_REQUEST['email'], $_REQUEST['ename'], $_REQUEST['eref'], $lang )) { contact_form( $_REQUEST['email'], $_REQUEST['ename'], $_REQUEST['etext'], $lang); } } else { contact_form('', '', '', $lang); } $kp->bottom_bar_tbl(); $kp->copyr(); ?>