===== Feedback Action Upgrade===== ''Last Updated: 2004-11-22 - ""RewriteRules"" bug fixed'' >>**See also:** AdminModules >>::c:: This is action extends the basic FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a ##user## GET variable <Link($_REQUEST["user"])."

". $this->FormOpen(). "". "". "Comments:
\n". "
". "". $this->FormClose(); } else { $form = "

Fill in the form below to send us your comments:

". $this->FormOpen(). "Name:
". "". "Email:
". "Comments:
\n
\n". "". $this->FormClose(); } // Results if ($_REQUEST["mail"]=="result") { $comments = $_POST["comments"]; if ($_REQUEST["user"]) { // Sender $name = $this->GetUserName(); $senderdata = $this->LoadSingle("select email from ".$this->config["table_prefix"]."users WHERE name =\"".$name."\""); $email = $senderdata["email"]; // Recipient $recipient = $_REQUEST["user"]; $recipientdata = $this->LoadSingle("select email from ".$this->config["table_prefix"]."users WHERE name =\"".$recipient."\""); $recipientmail = $recipientdata["email"]; if (!$recipientmail) { echo $this->Format("== User ".$recipient." unknown == --- "); echo $this->Format("Sorry, the recipient of your message (**".$recipient."**) is unknown --- --- --- "); echo $this->Format("Return to the [[".$this->GetConfigValue("root_page")." | main page]]"); } elseif (!$comments) { // some text must be entered echo "

Please enter some text

"; echo $alert; echo $form; } } else { $name = $_POST["name"]; $email = $_REQUEST["email"]; $recipient = $this->GetConfigValue("admin_users"); $recipientmail = $this->GetConfigValue("admin_email"); list($user, $host) = sscanf($email, "%[a-zA-Z0-9._-]@%[a-zA-Z0-9._-]"); if (!$name) { // a valid name must be entered echo "

Please enter your name

"; echo $form; } elseif (!$email || !strchr($email, "@") || !$user || !$host) { // a valid email address must be entered echo "

Please enter a valid email address

"; echo $form; } elseif (!$comments) { // some text must be entered echo "

Please enter some text

"; echo $alert; echo $form; } } if ($name && $email && $comments && $recipientmail) { // send email and display message $msg = "Name:\t".$name."\n"; $msg .= "Email:\t".$email."\n"; $msg .= "Comments:".$comments."\n"; $subject = "Feedback from ".$this->GetConfigValue("wakka_name"); $mailheaders = "From:".$email."\n"; $mailheaders .= "Reply-To:".$email."\n\n"; mail($recipientmail, $subject, $msg, $mailheaders); echo $this->Format("== Feedback sent! == --- "); echo $this->Format("Thanks for your interest: your message has been sent to [[".$recipient."]] --- --- "); // optionally displays the feedback text echo $this->Format("---- ''**Your name:** ".$name."---**Your email:** ".$email."---**Your comments:**".$comments."'' ---- "); echo $this->Format(" --- Return to the [[".$this->GetConfigValue("root_page")." | main page]]"); } } else { // Display initial form echo $form; } ?> %% ---- CategoryUserContributions