<?php
/************************************************************************/
/* Jolt League Signup Form v2 */
/* =========================== */
/* */
/* Created by Azazel */
/* http://www.unrealadmin.org/ */
/* */
/* Based on PHPNuke Feedback Module */
/* */
/* Modified by QuikShot */
/* http://www.jolt.co.uk */
/* */
/************************************************************************/
/* XNews theme */
$theme = "olive";
/* Background colour of table */
$bgcol = "#262A2B";
/* Who should the registration information be sent to? */
$adminemail = "imp@jolt.co.uk";
/* What is the name of the cup/league? */
$leaguename = "Jolt ETQW League";
/* The XNews page ID of the information/rules section */
$rulesid = "15498";
/* Time and date at which signups close */
$signupsclose = "TBC";
/* IRC channel for league/cup (including hash) */
$channel = "#etqw.jolt";
/* The days, dates and times on which the league/cup will be played */
$plannedtimes = "TBC";
/* The URL of the subsite from which the league/cup is run */
$subsiteurl = "www.etqwleague.jolt.co.uk";
/* Time/date at which those accepted into the league/cup are announced */
$announce = "TBC";
/* If you are expecting more than 100 signups, adjust this */
$maxsignups = 100;
/* That's all! */
/************************************************************************/
echo "<LINK REL=\"StyleSheet\" HREF=\"includes/style.css\" TYPE=\"text/css\">\n\n\n";
echo "<body style=\"font-family: Verdana; font-size: 8pt; color: #7BA6C6\" link=\"#668DDC\" vlink=\"#7D79DC\" alink=\"#668DDC\">\n\n\n";
$form_league= "<table width=\"460\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr><td><img src=\"http://assets.jolt.co.uk/assets/steel/shim.gif\" width=\"460\" height=\"4\" border=\"0\"></TD></TR>
<tr><td class=\"contentboxhd\" height=\"18\" background=\"http://assets.jolt.co.uk/assets/steel/hdbg_newsbox.gif\">$leaguename Signup
</TD></TR><TR><TD>
<<center><br>
<b><font color=\"#86D760\" size=\"2\">Jolt ETQW League Registration Form</font></b>
</center><br><br>
<blockquote>Please make sure you are familiar with the <a target=\"_blank\" href=\"index.php?page=&action=show&id=$rulesid\">rules</a> before signing up.<br>
If you have any questions or problems, speak to the admins in #etqw.jolt (preferebly the ETQW Head Admin).<br>
<br>
Pings will be similar to the jolt.co.uk publics and clanservers. If you are at all worried about pings please play on one of our public servers before signing up.<br><br>
<b><font color="#0099FF">
All Information below is required to compete in this league, failure to do so may result in your application and participation in the league to be ignored, please read all information carefully, and expect a reply from the admin Asap, All Signups are important to us and we will endevour to reply to your signup within a 24 hour period</font>. </b>
<center><br><font color=\"#86D760\">Signups close on the $signupsclose</font><br><br></center>
<center><b>Fields marked with a * must be filled in</b></blockquote>
<br><br></p><center>
<FORM METHOD=\"post\" ACTION=\"index.php?page=$page\">
<table border=\"0\">
<tr>
<td width=\"200\">* <b>In Game Name </b></td>
<td><input type=text name=\"Tag\" size=\"30\" maxlength=\"50\"></td></tr>
<tr>
<td>* <b>Online Username <br>
</b></td>
<td><input type=text name="\Name\" size=\"30\" maxlength=\"50\"></td></tr>
<tr>
<td>* <b>Full Punkbuster Guid (pb_myguid) in Console <br>
</b></td>
<td><input type=text size=\"30\" maxlength=\"50\"></td></tr>
<tr>
<td>* <b>Contact Email Address </b></td>
<td><input type=text name=\"Clan Leader\" size=\"30\" maxlength=\"40\"></td></tr>
<tr>
<td>* <b>Country</b></td>
<td><input name=\"Country\" type=text id=\"Country\" size=\"30\" maxlength=\"40\" Leader\></td></tr>
<tr>
<td>* <b>Clan Name </b></td>
<td><input type=text name=\"Clan Name\" size=\"30\" maxlength=\"40\"></td></tr>
<tr>
<td><b>* Clan Tag </b></td>
<td><input type=text name=\"Clan Tag\" size=\"30\" maxlength=\"80\"></td></tr>
<tr>
<td>* <b>Favourite Class </b></td>
<td><input type="text" value="" size=\"30\" players\="Players\"></td></tr>
<tr>
<td>* <b>Favourite Weapon </b></td>
<td><input type=text name=\"Favourite Weapon\" size=\"30\" maxlength=\"40\"></td></tr>
<tr>
<td>* <b>Favourite Map </b></td>
<td><input type=text name=\"Favourite Map\" size=\"30\" maxlength=\"40\"></td></tr>
<tr><td colspan=\"2\"><br>Games will be played $plannedtimes.<br><br></td></tr>
<tr><td>* <i>I have filled in all fields and read the below.</i></td>
<td><INPUT TYPE=CHECKBOX NAME=\"Availability\"></td></tr>
<tr><td><br></td><td></td></tr>
<tr><td colspan=\"2\"><font size=\"2\"><left>Note: You must tick the above box for your application to be considered.</font><br><br>
<blockquote><font color=\"#86D760\"><b>Please also note:</b><br>
<ul>
<li>All Game Times will be UK timezone <br>
<li>The rules of the league.<br>
<li>Our server settings.<br>
<li>Games are played on Jolt's servers <br>
<li>Game days and times are pre-arranged. This means that the games clans play are at the same time, on the same day for the entire season.<br>
<li>You must have a full commitment to forefill the entire season whatever happens.</font></ul></blockquote><br><br></left>
<center><b>Please <u>check your form before submitting</u> below!</b></center></td></tr>
<tr><td><br></td><td></td></tr></table>
<INPUT type=\"hidden\" name=\"opi\" value=\"ds\"
<p><input type=submit name=\"submit\" value=\"Sign us up!\"></p>
</form></center>
<br></td></tr><tr><td><table callpadding=\"5\" border=0><tr><td><br></td><td><br></td><td><br></td></tr></table>
<br><br></td></tr></table>";
if ($opi != "ds") {
echo "$form_league";
}
elseif ($opi =="ds") {
$channelnohash = str_replace("#", "", $channel);
$cip = getenv("REMOTE_ADDR");
$reg = str_replace(",", ".", $_POST);
$reg = preg_replace('/\n|\r|(\r\n)/m', ' | ', $reg);
$error_array = array();
while (list($key, $value) = each($reg)) {
// Search for empty fields
if ($value == "" && $key != "Clan_Website" && $key != "Past Seasons") {
array_push($error_array, $key);
$send = "no";
}
// Start building up email message
if ($key != "opi" && $key != "submit" && $key != "Availability") {
$msgdetails .= str_replace("_", " ", $key) . ": " . strip_tags($value) . "\n";
}
}
if (!$_POST['Availability']) {
array_push($error_array, "Availability");
$send = "no";
}
if ($send != "no") {
$filename = "signupdata/" . $rulesid . ".txt";
if (file_exists($filename)) {
$data = file($filename);
$count = count($data);
// Check for multiple signups from one IP
foreach($data as $dataline) {
if (eregi($cip, $dataline)) {
make1();
echo "<b>Signup failed</b><br><br>We have already received a submission from you<br><br>Please contact $adminemail for assistance";
make2();
$quitnow = "true";
}
}
} else {
$count = 0;
}
if ($count >= $maxsignups) {
make1();
echo "<b>Signup failed</b><br><br>This tournament is oversubscribed<br><br>Please contact $adminemail for assistance";
make2();
$quitnow = "true";
}
if (!$quitnow) {
reset($reg);
$data = fopen($filename, "a+");
fputs($data, $count+1 . "," . $cip . ",");
while (list($key, $value) = each($reg)) {
if ($key != "opi" && $key != "Availability" && $key != "submit") {
fputs($data, strip_tags($value) . ",");
}
}
fputs($data, "\n");
fclose($data);
$toaddress = $reg["Contact_Email"];
$msg = "Thank you for your application! This is an automated email confirming that we have received your signup and can reach you at the specified addresses. If your team's details change please let us know. You should receive a direct E-Mail from the League's Head Admin in the next 24 hours.\n\n";
$msg .= "Please join $channel on irc.quakenet.org so that we can contact you if needed.\n\n";
$msg .= "The details we have for your clan are as follows:\n\n";
$msg .= $msgdetails;
$msg .= "\nThe $leaguename Admin Team\n";
$msg .= "$subsiteurl\n\n";
$msg .= "--------------------------\n\n";
$msg .= "This registration was received from $cip - If this mail was not expected please contact $adminemail";
$to = "$toaddress";
$subject = "$leaguename - Registration received";
$replyto = "$adminemail";
$mailheaders = "From: $leaguename <$replyto> \n";
$mailheaders .= "Reply-To: $replyto\n";
$mailheaders .= "Bcc: $adminemail, imp@jolt.co.uk\n\n";
mail ($to, $subject, $msg, $mailheaders);
make1();
echo "<div align=\"center\">Your request to join the $leaguename has been submitted. You should receive email confirmation of this shortly.<br><br>
<i>If you do not receive an email within 24 hours please contact us.</i><br><br>
<font color=\"#86D760\">Please may you and your clan mates <b>join <a href=\"irc://irc.quakenet.org/$channelnohash\">$channel</a> on irc.quakenet.org</b> now<br>so that admins can contact you if needed (and to support the league).</font><br><br>
</div>";
make2();
}
} elseif ($send == "no") {
make1();
echo "We were unable to process your submission<br><br>";
echo "<b>Please click the back button on your browser and fill in the following fields:</b><br><br>";
while (list($key, $value) = each($error_array)) {
echo "<center>" . str_replace("_", " ", $value) . "</center><br>";
}
make2();
}
}
function make1 () {
global $theme, $leaguename, $bgcol;
echo "<table width=\"460\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr><td><img src=\"http://assets.jolt.co.uk/assets/steel/shim.gif\" width=\"460\" height=\"4\" border=\"0\"></TD></TR>
<tr><td class=\"contentboxhd\" height=\"18\" background=\"http://assets.jolt.co.uk/assets/steel/hdbg_newsbox.gif\">$leaguename Signup
</TD></tR><TR><TD>";
}
function make2 () {
global $theme, $leaguename, $bgcol;
echo "<br><br><br><div align=\"center\"><img src=\"http://www.ut2004.jolt.co.uk/images/sep1.gif\"></img><br>
<img src=\"http://www.pczone.jolt.co.uk/blank.gif\" width=\"15\"></img><img src=\"http://www.ut2004.jolt.co.uk/images/jolt.gif\"></img></div></td>
</tr><tr><td><table callpadding=\"5\" border=0><tr><td><br></td><td><br></td><td><br></td></tr></table>
<br><br></td></tr></table>";
}
?>