Revision history for FeedbackActionUpgrade


Revision [23199]

Last edited on 2016-05-20 07:38:47 by DarTar [Replaces old-style internal links with new pipe-split links.]
Additions:
echo $this->Format("Return to the [[".$this->GetConfigValue("root_page")." | main page]]");
echo $this->Format(" --- Return to the [[".$this->GetConfigValue("root_page")." | main page]]");
Deletions:
echo $this->Format("Return to the [[".$this->GetConfigValue("root_page")." main page]]");
echo $this->Format(" --- Return to the [[".$this->GetConfigValue("root_page")." main page]]");


Revision [19150]

Edited on 2008-01-28 00:14:03 by DarTar [Modified links pointing to docs server]

No Differences

Revision [16898]

Edited on 2007-05-31 23:27:04 by DarTar [Reverted]
Additions:
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
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 "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
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
Deletions:
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
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 "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
if ($name


Revision [16696]

Edited on 2007-05-31 10:37:44 by RvnRoc [Reverted]
Additions:
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
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 "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
if ($name
Deletions:
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
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 "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
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


Revision [9767]

Edited on 2005-07-05 08:12:12 by DarTar [adding link]
Additions:
===== 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

<<This action is meant as a module to integrate the FeedbackAction into the **UserAdmin** tool.
To use it as a standalone action simply add ##""{{userfeedback}}""## in one of your pages.<< ::c::

Save the following code as ##actions/userfeedback.php##.

-- DarTar

----

<<##actions/userfeedback.php##<<


%%(php)
<?php

// USER FEEDBACK ACTION
// Displays a form to send feedback to the site administrator, as specified in the configuration file,
// or to a registered user as specified by a "user" GET variable

// Build feedback form

if ($_REQUEST["user"]) {
$form = "<p>Send feedback to :".$this->Link($_REQUEST["user"])."</p>".
$this->FormOpen().
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
"Comments:<br />\n".
"<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />".
"<input type=\"submit\" />".
$this->FormClose();
} else {

$form = "<p>Fill in the form below to send us your comments:</p>".
$this->FormOpen().
"Name: <input name=\"name\" value=\"".$_POST["name"]."\" type=\"text\" /><br />".
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"Email: <input name=\"email\" value=\"".$_POST["email"]."\" type=\"text\" /><br />".
"Comments:<br />\n<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />\n".
"<input type=\"submit\" />".
$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 "<p class=\"error\">Please enter some text</p>";
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 "<p class=\"error\">Please enter your name</p>";
echo $form;
} elseif (!$email || !strchr($email, "@") || !$user || !$host) {
// a valid email address must be entered
echo "<p class=\"error\">Please enter a valid email address</p>";
echo $form;
} elseif (!$comments) {
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
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;

}
?>


%%


----
Deletions:
===== Feedback Action Upgrade=====
''Last Updated: 2004-11-22 - ""RewriteRules"" bug fixed''

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

<<This action is meant as a module to integrate the FeedbackAction into the **UserAdmin** tool.
To use it as a standalone action simply add ##""{{userfeedback}}""## in one of your pages.<< ::c::

Save the following code as ##actions/userfeedback.php##.

-- DarTar

----

<<##actions/userfeedback.php##<<


%%(php)
<?php

// USER FEEDBACK ACTION
// Displays a form to send feedback to the site administrator, as specified in the configuration file,
// or to a registered user as specified by a "user" GET variable

// Build feedback form

if ($_REQUEST["user"]) {
$form = "<p>Send feedback to :".$this->Link($_REQUEST["user"])."</p>".
$this->FormOpen().
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
"Comments:<br />\n".
"<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />".
"<input type=\"submit\" />".
$this->FormClose();
} else {

$form = "<p>Fill in the form below to send us your comments:</p>".
$this->FormOpen().
"Name: <input name=\"name\" value=\"".$_POST["name"]."\" type=\"text\" /><br />".
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"Email: <input name=\"email\" value=\"".$_POST["email"]."\" type=\"text\" /><br />".
"Comments:<br />\n<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />\n".
"<input type=\"submit\" />".
$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 "<p class=\"error\">Please enter some text</p>";
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 "<p class=\"error\">Please enter your name</p>";
echo $form;
} elseif (!$email || !strchr($email, "@") || !$user || !$host) {
// a valid email address must be entered
echo "<p class=\"error\">Please enter a valid email address</p>";
echo $form;
} elseif (!$comments) {
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
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;

}
?>


%%


----


Revision [4760]

Edited on 2005-01-17 14:54:32 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopment


Revision [2363]

Edited on 2004-11-22 21:02:00 by DarTar [RewriteRules bug fixed]
Additions:
''Last Updated: 2004-11-22 - ""RewriteRules"" bug fixed''
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
// USER FEEDBACK ACTION
// Build feedback form
if ($_REQUEST["user"]) {
$form = "<p>Send feedback to :".$this->Link($_REQUEST["user"])."</p>".
$this->FormOpen().
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"<input type=\"hidden\" name=\"user\" value=\"".$_REQUEST["user"]."\">".
"Comments:<br />\n".
"<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />".
"<input type=\"submit\" />".
$this->FormClose();
$form = "<p>Fill in the form below to send us your comments:</p>".
$this->FormOpen().
"Name: <input name=\"name\" value=\"".$_POST["name"]."\" type=\"text\" /><br />".
"<input type=\"hidden\" name=\"mail\" value=\"result\">".
"Email: <input name=\"email\" value=\"".$_POST["email"]."\" type=\"text\" /><br />".
"Comments:<br />\n<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br />\n".
"<input type=\"submit\" />".
$this->FormClose();
// Results
if ($_REQUEST["mail"]=="result") {
if ($_REQUEST["user"]) {
$recipient = $_REQUEST["user"];
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 "<p class=\"error\">Please enter some text</p>";
echo $alert;
echo $form;
}
$email = $_REQUEST["email"];
if ($name && $email && $comments && $recipientmail) {
// Display initial form
CategoryDevelopment
Deletions:
This is an upgraded version of FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a ##user## GET variable
// 1. Build feedback form
if ($_GET["user"]) {
// feedback-to-user form
$form = '<p>Send feedback to :'.$this->Link($_GET["user"]).'</p>
<form method="post" action="'.$this->GetPageTag().'?user='.$_GET["user"].'&mail=result">
Comments:<br />
<textarea name="comments" rows="15" cols="40">'.$_POST["comments"].'</textarea><br />
<input type="submit" />
</form>';
// feedback-to-admin form
$form = '<p>Fill in the form below to send us your comments:</p>
<form method="post" action="'.$this->GetPageTag().'?mail=result">
Name: <input name="name" value="'.$_POST["name"].'"type="text" /><br />
Email: <input name="email" value="'.$_POST["email"].'" type="text" /><br />
Comments:<br />
<textarea name="comments" rows="15" cols="40">'.$_POST["comments"].'</textarea><br />
<input type="submit" />
</form>';
// 2. Validate form
if ($_GET["mail"]=="result") {
if ($_GET["user"]) {
// A. feedback-to-user validation
$recipient = $_GET["user"];
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]]");
// some text must be entered
echo "<p class=\"error\">Please enter some text</p>";
echo $alert;
// B. feedback-to-admin validation
$email = $_POST["email"];
// 3. Form is valid => send feedback
if ($name && $email && $comments && $recipientmail) {
// Print form
CategoryDevelopment


Revision [1980]

Edited on 2004-10-25 18:13:41 by NilsLindenberg [category added]
Additions:
%%
CategoryDevelopment
Deletions:
%%


Revision [1271]

Edited on 2004-09-16 16:12:21 by DarTar [minor fix]
Additions:
$recipient = $this->GetConfigValue("admin_users");
$recipientmail = $this->GetConfigValue("admin_email");
if ($name && $email && $comments && $recipientmail) {
Deletions:
if ($name && $email && $comments) {
$recipient = ($_GET["user"])? $recipient : $this->GetConfigValue("admin_users");
$recipientmail = ($_GET["user"])? $recipientmail : $this->GetConfigValue("admin_email");


Revision [1266]

Edited on 2004-09-16 09:39:36 by DarTar [minor fix]
Additions:
<<This action is meant as a module to integrate the FeedbackAction into the **UserAdmin** tool.
To use it as a standalone action simply add ##""{{userfeedback}}""## in one of your pages.<< ::c::
Deletions:
<<(This action is meant as a module to integrate the FeedbackAction into the UserAdmin tool).<<


Revision [1260]

Edited on 2004-09-16 09:31:41 by DarTar [minor fix]

No Differences

Revision [1259]

Edited on 2004-09-16 09:31:33 by DarTar [minor fix]
Additions:
Save the following code as ##actions/userfeedback.php##.
<<##actions/userfeedback.php##<<
Deletions:
<<##actions/feedback.php##<<


Revision [1254]

Edited on 2004-09-16 09:26:02 by DarTar [minor fix]

No Differences

Revision [1253]

Edited on 2004-09-16 09:25:55 by DarTar [minor fix]
Additions:
This is an upgraded version of FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a ##user## GET variable
<<(This action is meant as a module to integrate the FeedbackAction into the UserAdmin tool).<<
Deletions:
This is an upgraded version of FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a ##user## GET variable (This is a way to integrate the FeedbackAction as a module into the UserAdmin tool.
The code is still a bit messy - apologies...


Revision [1251]

Edited on 2004-09-16 09:24:46 by DarTar [minor fix]
Additions:
<<##actions/feedback.php##<<
Deletions:
<<##actions/feedback.php :##<<


Revision [1250]

Edited on 2004-09-16 09:24:34 by DarTar [minor fix]
Additions:
<<##actions/feedback.php :##<<
Deletions:
<<##actions/feedback.php##<<


Revision [1249]

Edited on 2004-09-16 09:24:24 by DarTar [minor fix]
Additions:
----
<<##actions/feedback.php##<<


Revision [1240]

Edited on 2004-09-15 20:16:11 by DarTar [minor fix]
Additions:
This is an upgraded version of FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a ##user## GET variable (This is a way to integrate the FeedbackAction as a module into the UserAdmin tool.
Deletions:
This is an upgraded version of FeedbackAction. It allows not only to send feedback to the Wikka administrator but also to any other registered user via a #user# GET variable (This is a way to integrate the FeedbackAction as a module into the UserAdmin tool.


Revision [1235]

Edited on 2004-09-15 19:55:45 by DarTar [minor fix]
Additions:
// Displays a form to send feedback to the site administrator, as specified in the configuration file,
// 1. Build feedback form
// feedback-to-user form
// feedback-to-admin form
// 2. Validate form
// A. feedback-to-user validation
// B. feedback-to-admin validation
// 3. Form is valid => send feedback
// Print form
Deletions:
// This action displays a form to send feedback to the site administrator, as specified in the configuration file,
// Build feedback form
// Results
// Display initial form


Revision [1231]

Edited on 2004-09-15 19:26:33 by DarTar [minor fix]
Additions:
$recipientmail = $recipientdata["email"];
if (!$recipientmail) {
Deletions:
$recipientemail = $recipientdata["email"];
if (!$recipientemail) {


Revision [1229]

Edited on 2004-09-15 19:07:09 by DarTar [minor fix]
Additions:
// Results

$senderdata = $this->LoadSingle("select email from ".$this->config["table_prefix"]."users WHERE name =\"".$name."\"");
$recipientdata = $this->LoadSingle("select email from ".$this->config["table_prefix"]."users WHERE name =\"".$recipient."\"");
// optionally displays the feedback text
// Display initial form
Deletions:
// feedback-to-user form
// feedback-to-admin form
// Form validation
// A. feedback-to-user validation
$senderdata = $this->LoadSingle("select email from ".$this->config["table_prefix"].
"users WHERE name =\"".$name."\"");
$recipientdata = $this->LoadSingle("select email from ".$this->config["table_prefix"].
"users WHERE name =\"".$recipient."\"");
// B. feedback-to-admin validation
// C. (common) Form is valid => send message
// displays the feedback text
// print form


Revision [1227]

The oldest known version of this page was created on 2004-09-15 18:39:22 by DarTar [minor fix]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki