<?php
/*
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Free Content / Management System #
# / #
# #
# #
# Copyright 2005-2011 by webspell.org #
# #
# visit webSPELL.org, webspell.info to get webSPELL for free #
# - Script runs under the GNU GENERAL PUBLIC LICENSE #
# - It's NOT allowed to remove this copyright-tag #
# -- http://www.fsf.org/licensing/licenses/gpl.html #
# #
# Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
# Far Development by Development Team - webspell.org #
# #
# visit webspell.org #
# #
##########################################################################
*/
//options
$showonlygamingsquads = true; //only show gaming squads (=true) or show all squads (=false)?
//php below this line ;)
if(isset($site)) $_language->read_module('joinus');
eval ("\$title_joinus = \"".gettemplate("title_joinus")."\";");
echo $title_joinus;
if(isset($_GET['action'])) $action = $_GET['action'];
else $action = "";
$show = true;
if($action=="save" && isset($_POST['post'])) {
if(isset($_POST['squad'])) $squad = $_POST['squad'];
else $squad = 0;
$nickname = $_POST['nickname'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lasttname'];
$sex = $_POST['sex'];
$b_day = $_POST['b_day'];
$b_month = $_POST['b_month'];
$b_year = $_POST['b_year'];
$age = $_POST['age'];
$flag = preg_replace("/[^a-zA-Z0-9\s]/", "", $_POST['flag']);
$city = $_POST['city'];
$email = $_POST['email'];
$steam = $_POST['steam'];
$xfire = $_POST['xfire'];
$skills = $_POST['skills'];
$lanable = $_POST['lanable'];
$joinbefore = $_POST['joinbefore'];
$reasonleaveros = $_POST['reasonleaveros'];
$reasonjoinagain = $_POST['reasonjoinagain'];
$clanbefore = $_POST['clanbefore'];
$whyleaveoldclan = $_POST['whyleaveoldclan'];
$oldclansite = $_POST['oldclansite'];
$reference = $_POST['reference'];
$howyoufoundus = $_POST['howyoufoundus'];
$whyyouwannajoin = $_POST['whyyouwannajoin'];
$knowmembers = $_POST['knowmembers'];
$run=0;
if($userID) {
$run=1;
}
else {
$CAPCLASS = new Captcha;
if(!$CAPCLASS->check_captcha($_POST['captcha'], $_POST['captcha_hash'])) $error[]=$_language->module['wrong_security_code'];
else $run=1;
}
if(!count($error) and $run) {
$ergebnis=safe_query("SELECT userID FROM ".PREFIX."squads_members WHERE joinmember='1' AND squadID='".$squad."'");
while($ds=mysql_fetch_array($ergebnis)) {
$touser[]=$ds['userID'];
}
if($touser[0] != "") {
$tmp_lang = new Language();
foreach($touser as $id) {
$tmp_lang->set_language(getuserlanguage($id));
$tmp_lang->read_module('joinus');
$message = '[b]'.$tmp_lang->module['someone_want_to_join_your_squad'].' '.mysql_real_escape_string(getsquadname($squad)).'![/b]
'.$tmp_lang->module['nickname'].' '.$nick.'
'.$tmp_lang->module['firstname'].': '.$firstname.'
'.$tmp_lang->module['lastname'].': '.$lastname.'
'.$tmp_lang->module['sex'].': '.$sex.'
'.$tmp_lang->module['birthday'].': '.$birthday.'
'.$tmp_lang->module['age'].': '.$age.'
'.$tmp_lang->module['country'].': '.$flag.'
'.$tmp_lang->module['city'].': '.$city.'
'.$tmp_lang->module['email'].': [email]'.$email.'[/email]
'.$tmp_lang->module['steam'].': '.$steam.'
'.$tmp_lang->module['xfire'].': '.$xfire.'
'.$tmp_lang->module['skills'].': '.$skills.'
'.$tmp_lang->module['lanable'].': '.$lanable.'
'.$tmp_lang->module['joinbefore'].': '.$joinbefore.'
'.$tmp_lang->module['reasonleaveros'].':
'.$reasonleaveros.'
'.$tmp_lang->module['reasonjoinagain'].':
'.$reasonjoinagain.'
'.$tmp_lang->module['clanbefore'].': '.$clanbefore.'
'.$tmp_lang->module['whyleaveoldclan'].':
'.$whyleaveoldclan.'
'.$tmp_lang->module['oldclansite'].': '.$oldclansite.'
'.$tmp_lang->module['reference'].': '.$reference.'
'.$tmp_lang->module['howyoufoundus'].':
'.$howyoufoundus.'
'.$tmp_lang->module['whyyouwannajoin'].':
'.$whyyouwannajoin.'
'.$tmp_lang->module['knowmembers'].':
'.$knowmembers.'
';
sendmessage($id,$tmp_lang->module['message_title'],$message);
}
}
echo $_language->module['thanks_you_will_get_mail'];
unset($_POST['nick'], $_POST['name'], $_POST['email'],$_POST['steam'],$_POST['xfire'],$_POST['birthday'],$_POST['age'],$_POST['whyyouwannajoin']);
$show = false;
}
else {
$fehler=implode('<br />• ',$error);
$show = true;
$showerror = '<div class="errorbox">
<b>'.$_language->module['problems'].':</b><br /><br />
• '.$fehler.'
</div>';
}
}
if($show == true){
if($showonlygamingsquads) $squads=getgamesquads();
else $squads=getsquads();
$bg1 = BG_1;
if($loggedin) {
if(!isset($showerror)) $showerror='';
$res = safe_query("SELECT *, DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS(birthday)), '%y') 'age' FROM ".PREFIX."user WHERE userID = '$userID'");
$ds = mysql_fetch_assoc($res);
$nickname = getinput($ds['nickname']);
$firstname = getinput($ds['firstname']);
$lastname = getinput($ds['lastname']);
$sex = getinput($ds['sex']);
$b_day = mb_substr($ds['birthday'],8,2);
$b_month = mb_substr($ds['birthday'],5,2);
$b_year = mb_substr($ds['birthday'],0,4);
$age = ($ds['age']);
$flag = ''.$ds['country'].'';
$country = flags($flag);
$country = str_replace("<img","<img id='county'",$country);
$countries = str_replace(" selected=\"selected\"", "", $countries);
$countries = str_replace('value="'.$ds['country'].'"', 'value="'.$ds['country'].'" selected="selected"', $countries);
$city = getinput($ds['town']);
$email = getinput($ds['email']);
$steam = getinput($ds['steam']);
$xfire = getinput($ds['xfire']);
$skills = getinput($ds['skills']);
$lanable = getinput($ds['lanable']);
$joinbefore = getinput($ds['joinbefore']);
if(isset($_POST['reasonleaveros'])) $reasonleaveros=getforminput($_POST['reasonleave']);
else $reasonleave='';
if(isset($_POST['reasonjoinagain'])) $reasonjoinagain=getforminput($_POST['reasonjoinagain']);
else $reasonjoinagain='';
$clanbefore = $ds['clanbefore'];
if(isset($_POST['whyleaveoldclan'])) $whyleaveoldclan=getforminput($_POST['whyleaveoldclan']);
else $whyleaveoldclan='';
$oldclansite = getinput($ds['oldclansite']);
$reference = getinput($ds['reference']);
if(isset($_POST['howyoufoundus'])) $howyoufoundus=getforminput($_POST['howyoufoundus']);
else $howyoufoundus='';
if(isset($_POST['whyyouwannajoin'])) $whyyouwannajoin=getforminput($_POST['whyyouwannajoin']);
else $whyyouwannajoin='';
if(isset($_POST['knowmembers'])) $knowmembers=getforminput($_POST['knowmembers']);
else $knowmembers='';
eval ("\$joinus_loggedin = \"".gettemplate("joinus_loggedin")."\";");
echo $joinus_loggedin;
}
else {
eval ("\$joinus_notloggedin = \"".gettemplate("joinus_notloggedin")."\";");
echo $joinus_notloggedin;
}
}
?>
|