just a quick uncomment cause some just run and wonder why it dose nothing
[travianx.git] / contact.php
blob046ef1fc1abfa8599533912a7251ef4de3cdc3fe
1 <?php ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## ## Filename contact.php ## ## Developed by: Dzoki ## ## License: TravianX Project ## ## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## ## ################################################################################# include("GameEngine/Village.php"); $start = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><?php echo SERVER_NAME ?></title> <link REL="shortcut icon" HREF="favicon.ico"/> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="imagetoolbar" content="no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <script src="mt-full.js?0faaa" type="text/javascript"></script> <script src="unx.js?0faaa" type="text/javascript"></script> <script src="new.js?0faaa" type="text/javascript"></script> <link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?e21d2" rel="stylesheet" type="text/css" /> <link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?e21d2" rel="stylesheet" type="text/css" /> <?php if($session->gpack == null || GP_ENABLE == false) { echo " <link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' /> <link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />"; } else { echo " <link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' /> <link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />"; } ?> <script type="text/javascript"> window.addEvent('domready', start); </script> </head> <body class="v35 ie ie8"> <div class="wrapper"> <img style="filter:chroma();" src="img/x.gif" id="msfilter" alt="" /> <div id="dynamic_header"> </div> <?php include("Templates/header.tpl"); ?> <div id="mid"> <?php include("Templates/menu.tpl"); ?> <div id="content" class="warsim"> <h1>Contact US</h1> <!-- //============================================= // Contact Us Form! // - Travian Clone Project - // Made by: Dzoki and Dixie // Official site: www.TravianCloneProject.tk // DO NOT REMOVE COPYRIGHT NOTICE! //============================================= --> <?php //============================== // Version 1.0 // // Fill in the following. //============================== // where you want the emails to go to // separate multiple emails with a comma. $contact_to_email="pieterpaulisma@gmail.com"; // this will be the first part of the subject line of mail // sent from this script (identifies mail from this page) $contact_subject="Contact us:"; // emails sent from this page may appear to come from this // email address. change YOURDOMAIN.COM is to be the same // as your website's domain name $contact_from_email="pieterpaulisma@gmail.com"; // emails sent from here may come from this name. // Change this to be the name of your website. $contact_from_name="TravianX"; //======================================= // // The Following changes are optional // //======================================= // If your host blocks messages with To: fields coming // from other domains, then you may change this to true. // If the script works fine as it is, just leave it as false. // // If this variable is false, messages will appear to come // directly from the email address of the person who // filled out the form, rather than appearing to come from // the $contact_from_email above. $send_from_internal_address=false; // The color the errors will come out as when they // are displayed on the screen, use either a name or code // such as #0000FF $error_color="red"; // Use a security image only if you have a problem with automated // bots submitting SPAM to this form. You will need the // securityimage directory, which is located in the zip // file on www.douglassdavis.com // // change to true to use security image // false to not use security image. // // The downside to using a security image is that visually impaired // people will not be able to use the form. $use_security_image=false; //=============================== // // Do not change anything below. // //=============================== function previous_request_value($str) { if (isset($_REQUEST[$str]) ) return $_REQUEST[$str]; else return ''; } function cndstrips($str) { if (get_magic_quotes_gpc()) return stripslashes($str); else return $str; } $visitor_email=$database->getUserField($_SESSION['username'],"email",1); $visitor_name=$session->username; $message_body=cndstrips(previous_request_value('message_body')); $message_subject=cndstrips(previous_request_value('message_subject')); $security_code=str_replace(' ','',cndstrips(trim(previous_request_value('security_code')))); $errors=""; $message_sent=false; function validate_email($email) { return preg_match('/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]+\.[A-Za-z0-9_\-\.]+$/', $email) == 0; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (validate_email($visitor_email) ) { $errors.="Please enter a valid email address in the form of user@place.ext<br/><br/>"; } if ($use_security_image && (strtolower($security_code) != strtolower($_SESSION['contact_form_security_code']) || $_SESSION['contact_form_security_code']=='') ) { $errors.="The verification code for the image presented was incorrect. Please enter a correct verification code.<br/><br/>"; } if ($message_body == '') $errors.="Please enter a message<br/><br/>"; if ($message_subject == '') $errors.="Please enter a message subject<br/><br/>"; if ($visitor_name == '') $visitor_name=$session->username; if ( !$errors ) { $ip = $_SERVER["REMOTE_ADDR"]; $httpagent = $_SERVER["HTTP_USER_AGENT"]; $time = date("D, F j, Y H:i O"); if ($visitor_name) $visitor_name_and_email="$visitor_name <$visitor_email>"; else $visitor_name_and_email="$visitor_email"; if ($contact_from_name) $contact_from_email="$contact_from_name <$contact_from_email>"; $message = " $message_body ____________________________ Browser Info: $ip $httpagent "; if ($send_from_internal_address) { $message= " From: $visitor_name_and_email Date: $time Subject: $message_subject ".$message; } if ($send_from_internal_address) { mail($contact_to_email, $contact_subject." $message_subject", $message, "From: $contact_from_email\r\nReply-To: $visitor_name_and_email"); } else { mail($contact_to_email, $contact_subject." $message_subject", $message, "From: $visitor_name_and_email"); } echo "Your message"; echo "<div style='border: 1px solid black; margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;'>From: ".htmlentities($visitor_name_and_email)."<br />Re: ".htmlentities($message_subject)."<br />".htmlentities($message_body)."</div>"; echo "Has been sent. Thank you for contacting us."; $message_sent=true; } } if (!$message_sent) { $this_file = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1); ?> <form name="ContactForm" id="ContactForm" method="post" action="<?php echo $this_file ?>"> We are happy to hear from you. Please enter the requested information <?php if (!$message_body) echo "and message" ?> below, then click the Send button. <br /> <br /> <?php if ($errors) { echo "<span style='color:$error_color'><br />$errors</span>"; } ?> <label for="visitor_name">Your name<font color="Red">*</font></label><br /> <input name="visitor_name" type="text" id="visitor_name" value="<?php echo $session->username; ?>" size="25" /> <br /><br /> <label for="visitor_name">Your Email Address<font color="Red">*</font></label><br /> <input name="visitor_email" type="text" id="visitor_email" value="<?php echo $database->getUserField($_SESSION['username'],"email",1); ?>" size="25"/> <br /><br /> <label for="message_subject">Subject<font color="Red">*</font></label><br /> <input name="message_subject" type="text" id="message_subject" value="<?php echo htmlentities($message_subject) ?>" size="25"/> <br /><br /> <?php if ($use_security_image) { ?> <div id="security"><img src="securityimage/security-image.php?width=200" width="200" height="40" alt="Verification Image" /></div> Verification Image (please enter the text in the image above) <br /> <input name="security_code" type="text" id="security_code" size="25"/> <br /><br /> <?php } ?> <label for="message_body">Message<font color="Red">*</font></label><br /> <textarea name="message_body" cols="30" rows="6" id="message_body" ><?php echo htmlentities($message_body) ?></textarea> <br /><br /> <input type="submit" name="Submit" value="Send" /> </form> <?php } ?> <br /><br /><font size="1" color="gray">Fields marked with <font color="Red">*</font> must be filled in!</font> </p></div> <div id="side_info"> <?php include("Templates/quest.tpl"); include("Templates/news.tpl"); include("Templates/multivillage.tpl"); include("Templates/links.tpl"); ?> </div> <div class="clear"></div> </div> <div class="footer-stopper"></div> <div class="clear"></div> <?php include("Templates/footer.tpl"); include("Templates/res.tpl"); ?> <div id="stime"> <div id="ltime"> <div id="ltimeWrap"> Calculated in <b><?php echo round(($generator->pageLoadTimeEnd()-$start)*1000); ?></b> ms <br />Server time: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span> </div> </div> </div> <div id="ce"></div> </body> </html>