SendQuestion(); } } } function ShowContactForm() { // Load the contact form $GLOBALS["HideContactPageResults"] = "none"; $GLOBALS["AL_CLASS_TEMPLATE"]->SetPageTitle($GLOBALS["AL_LANG"]["conContactUs"]); $GLOBALS["AL_CLASS_TEMPLATE"]->SetTemplate("Contact"); echo $GLOBALS["AL_CLASS_TEMPLATE"]->ParseTemplate(); } function SendQuestion() { // Send an email and/or store the question in the pending questions table $fromName = $_POST["FromName"]; $fromEmail = $_POST["FromEmail"]; $subject = $_POST["Subject"]; $message = $_POST["Message"]; $adminInfo = mysql_fetch_array(mysql_query(sprintf("SELECT * FROM %susers WHERE username='admin'",$GLOBALS["AL_CFG"]["tablePrefix"]))); $arrIgnore = explode(",", $GLOBALS["skipFields"]); foreach($_POST as $k => $v) { if(!@in_array($k, $arrIgnore)){ if($k != "thanksId" AND $k != "thanksName"){ $otherFields .= $k . ": " . $v . "\n"; } } } if($fromName == ""){ $fromName = $GLOBALS["AL_LANG"]["conALVisitor"]; } if($fromEmail == ""){ $fromEmail = $GLOBALS["contactEmail"]; } $send = sprintf("%s\n-----------------------------------------------------\n\n", $GLOBALS["AL_LANG"]["conSubmittedFromAL"]); $send .= "Name: " . $fromName . "\n"; $send .= "Email: " . $fromEmail . "\n"; $send .= "Subject: " . $subject . "\n"; $send .= $otherFields; $send .= "Question/Comment: " . $message . "\n\n"; AL_MAIL::sendEmail($adminInfo["Email"],stripslashes($subject),stripslashes($send),$fromName,$fromEmail); $PageId = $_REQUEST["thanksId"]; $PageName = $_REQUEST["thanksName"]; header("Location: ".AL_HELPER::PageLink($PageId, $PageName)); } } ?>