summaryrefslogtreecommitdiff
path: root/templates/themes/staffapplication/staffapplicationpost.php
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2017-09-03 22:19:32 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2017-09-03 22:19:32 +0900
commit7f8c54249dea60f624e3f90b6c29adbd1207781b (patch)
tree3cf14b57fbaa851a624a97606e7baf0c961118a3 /templates/themes/staffapplication/staffapplicationpost.php
parent8211c01d84b580abcbb57c3012f39020f1522063 (diff)
Add staff application theme, calendar theme and ukko4 theme
Diffstat (limited to 'templates/themes/staffapplication/staffapplicationpost.php')
-rw-r--r--templates/themes/staffapplication/staffapplicationpost.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/templates/themes/staffapplication/staffapplicationpost.php b/templates/themes/staffapplication/staffapplicationpost.php
new file mode 100644
index 00000000..0e1b14ca
--- /dev/null
+++ b/templates/themes/staffapplication/staffapplicationpost.php
@@ -0,0 +1,54 @@
+<?php
+$name = $contactmethod = $email = $application = $antispam = $displaymessage = "";
+require '/var/www/html/inc/functions.php';
+if (isset ($_POST["antispam"])){
+ if ($_POST["antispam"] == "DUCK"){
+ $namecheck = ! empty($_POST["name"]);
+ $contactmethodcheck = $_POST["contactmethod"] == "email";
+ $emailcheck = ! empty($_POST["email"]);
+ $emailischecked = $contactmethodcheck ? $emailcheck : true;
+
+ if ($emailischecked && $namecheck){
+ $name = $_POST["name"];
+ $contactmethod = $_POST["contactmethod"];
+ $email = $_POST["email"];
+ $application = $_POST["application"];
+ $antispam = $_POST["antispam"];
+ $to = "admin@lainchan.org";
+ $subject = "Lainchan.org Staff Application for " . $name;
+
+ $message = "Name: " . $name . "\r\n";
+ $message .= "Contact method: " . $contactmethod . "\r\n";
+ $message .= $application;
+ $message = wordwrap($message, 70, "\r\n");
+
+ $source = $emailcheck ? $email : $to;
+ $headers = 'From: ' . $source . "\r\n" .
+ 'Reply-To: ' . $source . "\r\n" .
+ 'X-Mailer: PHP/' . phpversion();
+ $sent = mail($to, $subject, $message, $headers);
+ $sentmessage = $sent ? "was submitted successfully.</p>\r\n" : "was unable to be submitted.</p>\r\n";
+ $displaymessage = "<p style=\"text-align:center;\"> Your staff application " . $sentmessage;
+ }
+
+ }
+ else
+ {
+ $displaymessage = "<p style=\"text-align:center;\">ANTISPAM VALUE INCORRECT</p>\r\n";
+
+ }
+}
+else {
+$displaymessage = "<p style=\"text-align:center;\">ANTISPAM NOT SET</p>\r\n";
+}
+$displaymessage .= '<span style="text-align:center; display: block;" >[ <a href="https://lainchan.org/"> Return Home </a> ]</span>';
+
+echo Element('page.html', array(
+ 'index' => $config['root'],
+ 'title' => _('Staff Application'),
+ 'config' => $config,
+ 'boardlist' => createBoardlist(isset($mod) ? $mod : false),
+ 'body' => $displaymessage,
+ )
+ );
+?>