/************************************************************************/ /* PHP-NUKE: Web Portal System */ /* =========================== */ /* */ /* Copyright (c) 2006 by Francisco Burzi */ /* http://phpnuke.org */ /* */ /* Based on Feedback Addon 1.0 */ /* Copyright (c) 2001 by Jack Kozbial (jack@internetintl.com) */ /* http://www.InternetIntl.com */ /* */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /************************************************************************/ if (!defined('MODULE_FILE')) { die ("You can't access this file directly..."); } require_once("mainfile.php"); prepare_captcha(); $module_name = basename(dirname(__FILE__)); get_lang($module_name); define('INDEX_FILE', true); define('NO_EDITOR', true); function showfeedbackform($sender_name,$sender_email,$message="") { global $module_name; $form_block = "
"._YOURNAME.":
"._YOUREMAIL.":
"._MESSAGE.":
"._HTMLNOTALLOWED2."
".(show_captcha_text())."
".(show_captcha_image())."
".(show_captcha_field())."

 
"; return $form_block; } function theindex() { global $pagetitle, $titlenav, $user_info, $user, $sitename, $adminmail, $anonymous; $subject = $sitename." "._FEEDBACK; $pagetitle=_FEEDBACK; include("header.php"); $navpanel=array(); $navpanel[]=array('link' => "index.php", 'linktext'=>_HOME); $navpanel[]=array('link' =>"",'linktext'=>_FEEDBACK); navpanel($navpanel); if (is_user($user)) { if (!empty($user_info['name'])) { $sender_name = filter($user_info['name'], "nohtml"); } else { $sender_name = filter($user_info['username'], "nohtml"); } if (!empty($user_info['user_email'])) { $sender_email = filter($user_info['user_email'], "nohtml"); } else { $sender_email=""; } } else { $sender_email=""; $sender_name=$anonymous; } OpenTable(); echo "
"._FEEDBACKTITLE."
"._FEEDBACKNOTE."
"; echo "
"; echo showfeedbackform($sender_name,$sender_email); CloseTable(); include("footer.php"); } function datasend() { global $sitename, $adminmail, $pagetitle; $sender_name=filter($_POST['sender_name'],"nohtml"); $sender_email=filter($_POST['sender_email'],"nohtml"); $message=filter($_POST['message'],"nohtml"); $send=1; if (empty($sender_name)) { $name_err = "
"._FBENTERNAME."
"; $send = 0; } if (empty($sender_email) OR !validate_mail($sender_email)) { $email_err = "
"._FBENTEREMAIL."
"; $send = 0; } if(!valid_captcha()){ $captcha_err = "
"._CAPTCHA_ERROR."

"; $send = 0; } if (empty($message)) { $message_err = "
"._FBENTERMESSAGE."
"; $send = 0; } $pagetitle=_FEEDBACK; include ("header.php"); $navpanel=array(); $navpanel[]=array('link' => "index.php", 'linktext'=>_HOME); $navpanel[]=array('link' =>"",'linktext'=>_FEEDBACK); navpanel($navpanel); OpenTable(); if ($send > 0) { $sender_name = removecrlf($sender_name); $sender_email = removecrlf($sender_email); $subject = $sitename." "._FEEDBACK; $message = $message; $msg = $sitename."\n\n"; $msg .= _SENDERNAME.": ".$sender_name."\n"; $msg .= _SENDEREMAIL.": ".$sender_email."\n"; $msg .= _MESSAGE.": ".$message."\n\n"; $to = $adminmail; $mailheaders = "Content-Type: text/plain; charset="._CHARSET."\n"; $mailheaders .= "From: ".$sender_name." <".$sender_email.">\n"; $mailheaders .= "Reply-To: ".$sender_email."\n\n"; nukemail($to, $subject, $msg, $mailheaders); echo "

"._FBMAILSENT."

"; echo "

"._FBTHANKSFORCONTACT."

"; } else { OpenTable2(); if (!empty($name_err)) { echo $name_err; } if (!empty($email_err)) { echo $email_err; } if (!empty($message_err)) { echo $message_err; } if (!empty($captcha_err)) { echo $captcha_err; } CloseTable2(); echo "

"; echo showfeedbackform($sender_name,$sender_email,$message); } CloseTable(); unset($_SESSION['captcha_keystring']); include ("footer.php"); } switch ($op) { default: theindex(); break; case "datasend": datasend(); break; } echo ""; ?>