TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 361
  • Total: 362
  • tino

[Done!] Join Us! form

Started by mebymyself, October 19, 2006, 08:10:13 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

mebymyself

we are America's Army  addicts :)
visit us at http://wow-aao.net

OzButcher

#71
For some reason guests can still see the Form? I'm guessing the Echo tags with my html has affected this somehow?

could you please see if my code screwed up? :)

if ($context['user']['is_guest'])
{
   echo
   '<h5>Access Denied</h5>
   We are sorry. You must be registred on the site in order to apply for  Clan membership.';
} else  {}

global $sourcedir, $user_info, $context ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');

{
  echo '<h2 align="center">Recruitment Application </h2><p align="center">Please read everything below very carefully and then complete the Application form on this page!<br />Completing this form does not guarantee Recruitment!</p><h3><span style="color: #009900"><strong>What is the Recruiting Process</strong></span> <br /></h3><p>The recruitment process can take up to 4 weeks. In these 4 weeks the following must happen:</p><p>1. Applicant must have installed/used our Ventrilo chat room  (see our <a href="http://unt.swisshut.com/index.php?page=6">General FAQ</a>).<br />2. Applicant must have at least 2 games (1 public - 1 practice) with an =UnT= Admin (Smegg, Nobby, Villain or OzButcher).<br />3. If a Admin likes what he sees (and Clan members report positive feedback on your performance) you will be recruited on a 2 week probationary period. If in these 2 weeks you fail to show a commitment to =UnT= or break any of our rules your application will be rejected.<br />4. Upon successful completion of your trial you will become a full =UnT= Clan Member and will be able to participate with us in ladder matches</p><h3><span style="color: #009900"><strong>Who are the Admins?</strong></span> <br /> </h3><p><a href="http://unt.swisshut.com/index.php?action=profile;u=16"> Smegg</a> <br /><a href="http://unt.swisshut.com/index.php?action=profile;u=12">Nobby</a> <br /><a href="http://unt.swisshut.com/index.php?action=profile;u=7">Villain</a> <br /><a href="http://unt.swisshut.com/index.php?action=profile;u=1">OzButcher</a> <br /></p><h3><span style="color: #009900"><strong>What are the requirments for joining?</strong></span></h3><p>The requirements for joining =UnT= are as follows:<br /><br />* An internet connection above 128k<br />* A full working copy of a multi player game ( eg: 2142 , BF2 etc ) patched to the latest version.<br />* A certain level of teamwork skills<br />* A certain level of combat skills<br />* Must be 18+ years of age </p><h3><span style="color: #009900"><strong>I know =UnT= members, does that increase my chances of getting in?</strong></span></h3><p>In most cases, yes<br /><br />If you have a reliable reference within the clan you have a greater chance of getting in. </p><h2><br /><font color="#339900">Recruitment Application Form:</font><br /></h2><p> </p><br />';
}


// CONFIGURATION SECTION

//send the application by email?
$enable_email=true;

// email address of recruitment admins
$email_address='didaswisshut@iinet.net.au; vclnobnuts@hotmail.com; brasso@optusnet.com.au; ulysses@dialtone.com.au';

//post the application on forum?
$enable_post=true;

//board id to which the application should be posted
$board_id=4;

//the id of the this article
$this_article_id = '28';

//article to be redirected when form is submitted
$thank_you_article_id = '26';


//END OF CONFIGURATION SECTION

$show_form= 'true';
if (isset($_POST['submitted'])) {
// Handle the form

// Check required fields
$enroll_errors = array(); //Initialize error array

// Check for a name
if (empty($_POST['real_name']) ){
$enroll_errors[] = 'You forgot to enter your name.';
}
// Check for an email
if (empty($_POST['email']) ){
$enroll_errors[] = 'You forgot to enter your email address.';
}
// Check for an AA name
if (empty($_POST['aa_name']) ){
$enroll_errors[] = 'You forgot to enter your In-Game Nickname.';
}       
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';


if (empty($enroll_errors)) { //Everything seems to be OK
     
        $show_form='false';



// email an application

$subject = 'Enrollment Application';
$body = 'Enrollment application has been made by ' . $context['user']['name'] .
' from IP Address ' . $user_info['ip'] . '
Real Name:  ' . $_POST['real_name'] . '
Email address:  ' . $_POST['email'] . '
Current Game Name:  ' . $_POST['aa_name'] . '
Age:  ' . $_POST['age'] . '
Gender: ' . $_POST['gender'] . '
Location:  ' . $_POST['location'] . '
Hours played online:  ' . $_POST['honor'] . '
Previous clan(s):  ' . $_POST['prev_clans'] . '
Banned from any sever:  ' . $_POST['banned'] . '
Recruited by a UnT Member? ' . $_POST['aaotracker'] . '
UnT Members name:  ' . $_POST['aaotracker_name'] . '
Favourite KIT?  ' . $_POST['xfire'] . '
Able to attend Matches?:  ' . $_POST['ts'] . '
Have microphone/headset:  ' . $_POST['mic'] . '
Do you posses any web design or other skill that  could be contributed to the clan: ' . $_POST['pay'] . '
Why do you want to join our clan?  ' . $_POST['why'] . '
Other Games Played:   ' . $_POST['habbits'] . '
Other information:  ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />

[B]Real Name:[/B]  ' . $_POST['real_name'] . '
[B]Email address:[/B]  ' . $_POST['email'] . '
[B]In Game Nick:[/B]  ' . $_POST['aa_name'] . '
[B]Age:[/B] ' . $_POST['age'] . '
[B]Gender:[/B] ' . $_POST['gender'] . '
[B]Location:[/B] ' . $_POST['location'] . '
[B]Hours played online a week:[/B] ' . $_POST['honor'] . '
[B]Previous clan(s):[/B] ' . $_POST['prev_clans'] . '
[B]Banned from any sever:[/B] ' . $_POST['banned'] . '
[B]Recruited by a UnT Member?[/B] ' . $_POST['aaotracker'] . '
[B]UnT Members name:[/B] ' . $_POST['aaotracker_name'] . '
[B]Favourite KIT?[/B] ' . $_POST['xfire'] . '
[B]Able to attend Matches?:[/B] ' . $_POST['ts'] . '
[B]Have microphone/headset:[/B] ' . $_POST['mic'] . '
[B]Would like to help pay for a server?:[/B] ' . $_POST['pay'] . '
[B]Why do you want to join our clan?[/B] ' . $_POST['why'] . '
[B]Other Games Played:[/B] ' . $_POST['habbits'] . '
[B]Other information:[/B] ' . $_POST['other']. '';



            if ($enable_email)
mail($email_address, $subject, $body,"From: " . $_POST['email']);



//create new forum post with application

$msgOptions = array(
'id' =>  0 ,
'subject' => '[Pending] Application of ' . $context['user']['name'],
'body' => $postbody ,
'icon' => 'xx',
'smileys_enabled' => true,
'attachments' =>  array(),
);
$topicOptions = array(
'id' => 0 ,
'board' => $board_id,
'poll' =>  null,
'lock_mode' =>  null,
'sticky_mode' =>  null,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $context['user']['id'],
'name' => $context['user']['name'],
'email' => $user_info['email'],
'update_post_count' => true,
);
   
if ($enable_post)
            createPost($msgOptions, $topicOptions, $posterOptions);

// Redirect to thank you page
header('Location: http://' . $_SERVER['HTTP_HOST'] .'/index.php?page=' . $thank_you_article_id);

} else {
// Redirect to error page
//header('Location: http://' . $_SERVER['HTTP_HOST'] . '/index.php?page=' . $enroll_error_article_id );
echo '<h2 class="error">Error!</h2>';
echo '<p class="error">The following error(s) occured:<br />';

foreach ($enroll_errors as $msg) {
echo " - $msg<br />";
}
   echo "<p>Please, correct all errors and try again.</p>" ;



}
}
//else { // Display the form

echo '
<form action="index.php?page='  . $this_article_id  . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
<TABLE class = "bordercolor" cellSpacing="1" cellPadding="1" width="95%" border="0">
<TR class ="windowbg">
<TD width = "200px">* Your Name:</TD>
<TD><INPUT id="real_name" name="real_name" type="text" value ="';
if (isset($_POST['real_name'])) echo $_POST['real_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">* Email address:</TD>
<TD><INPUT id="email" name="email" type="text" value ="';
if (isset($_POST['email'])) echo $_POST['email']; else echo $user_info['email']; 
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">* In-Game Nick:</TD>
<TD><INPUT id="aa_name" name="aa_name" type="text" value ="';
if (isset($_POST['aa_name'])) echo $_POST['aa_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">* Age:</TD>
<TD><INPUT id="age" name="age" type="text" value ="';
if (isset($_POST['age'])) echo $_POST['age'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Gender:
</TD>
<TD><SELECT id = "gender" name = "gender" style="WIDTH: 152px" value ="';
if (isset($_POST['gender'])) echo $_POST['gender'];   
echo '" />
<OPTION value="No Answer" selected>--------------------------</OPTION>
<OPTION value="M">Male</OPTION>
<OPTION value="F">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Location:</TD>
<TD><INPUT id="location" name="location" type="text" value ="';
if (isset($_POST['location'])) echo $_POST['location'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Hours Spent playing online a week:</TD>
<TD><INPUT id="honor" name="honor" type="text" value ="';
if (isset($_POST['honor'])) echo $_POST['honor'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Previous clan(s) and reason of leaving:</TD>
<TD><TEXTAREA id="prev_clans" name="prev_clans" rows="4" cols="40" value ="';
if (isset($_POST['prev_clans'])) echo $_POST['prev_clans'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Have you ever been permanently banned from any sever (if yes, give details):</TD>
<TD><TEXTAREA id ="banned" name ="banned" rows="4" cols="40"  value ="';
if (isset($_POST['banned'])) echo $_POST['banned'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Were you recruited by a UnT Member?</TD>
<TD><SELECT id="aaotracker" name="aaotracker" style="WIDTH: 160px" value ="';
if (isset($_POST['aaotraker'])) echo $_POST['aaotraker'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">UnT Member name:</TD>
<TD><INPUT id="aaotracker_name" name="aaotracker_name" type="text" value ="';
if (isset($_POST['aaotraker_name'])) echo $_POST['aaotraker_name']; 
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">What is your favourite Kit</TD>
<TD><INPUT id="xfire" name="xfire" type="text" value ="';
if (isset($_POST['xfire'])) echo $_POST['xfire']; 
echo '" /></TD>
       </TR>
<TR class ="windowbg2">
<TD width = "200px">Will you be able to attend practice and matches?</TD>
<TD><SELECT id="ts" name="ts" style="WIDTH: 160px" value ="';
if (isset($_POST['ts'])) echo $_POST['ts'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
                                                <OPTION value="I will try my best">I will try my best</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have microphone/headset:</TD>
<TD><SELECT id="mic" name="mic" style="WIDTH: 160px" value ="';
if (isset($_POST['mic'])) echo $_POST['mic'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Would you help pay for a server?:</TD>
<TD><SELECT id="pay" name="pay" style="WIDTH: 160px" value ="';
if (isset($_POST['pay'])) echo $_POST['pay'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="Monthly">Yes, monthly</OPTION>
<OPTION value="Occasionally">Yes, occasionally</OPTION>
<OPTION value="Not">No, not now</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Why do you want to join =UNT=?</TD>
<TD><TEXTAREA id="why" name ="why" rows="4" cols="40" value ="';
if (isset($_POST['why'])) echo $_POST['why'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">What Other games to you play?:
</TD>
<TD><TEXTAREA id="habbits" name="habbits" rows="4" cols="40" value ="';
if (isset($_POST['habbits'])) echo $_POST['habbits'];
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Any other information you think can help us to make a decision:</TD>
<TD><TEXTAREA id="other" name = "other" rows="4" cols="40" value ="';
if (isset($_POST['other'])) echo $_POST['other'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
                       <TR class ="windowbg2">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>


also... adding extra email addresses like you showed me in the previous page wont work. If I try that method it wont send to any email address, instead sends me a error email.

mebymyself

Hi,

You closed else clause too early when checking for guest...

instead of



if ($context['user']['is_guest'])
{
   echo
   '<h5>Access Denied</h5>
   We are sorry. You must be registred on the site in order to apply for  Clan membership.';
} else  {}

..... <REST OF THE CODE >


Should be



if ($context['user']['is_guest'])
{
   echo
   '<h5>Access Denied</h5>
   We are sorry. You must be registred on the site in order to apply for  Clan membership.';
} else  { // remove closing bracket
..... <REST OF THE CODE >

} // Closing at the very end of the code






samson

Cant wait to try this mod I love the 1 click submit

Quick question I see you have a pop up that says you must be registered Is there a way to make check to see if the person has been registered for a certain amount of time?

example

sorry you must be registered for at least 30 days to fill out an application.

thanks in advance

hsdk

I tried this and it`s superb! But i need help with one thing.

I want to use data for two fields for my subject. i do this by using this:

'subject' => . $_POST['place'] . $_POST['date'],

but i need a space between them? If i use it like this, i wil show up like this : "placedate", i need "place date" :)

Hope someone could tell me how :)


A


mebymyself

hsdk, 

'subject' => . $_POST['place'] . ' ' . $_POST['date'], should do the trick :)

mebymyself

samson,

I believe you can use folowing function to calculate how many days between given dates but I realy cannot find registration date neither in $context nor in $user_info arrays :(
You may need to query database for it

and here is the function:


function days_between($fyear$fmonth$fday$tyear$tmonth$tday)
{
  return 
abs((mktime 000$fmonth$fday$fyear) - mktime 000$tmonth$tday$tyear))/(60*60*24));
}





samson

QuoteI believe you can use folowing function to calculate how many days between given dates but I realy cannot find registration date neither in $context nor in $user_info arrays
You may need to query database for it

and here is the function:

thanks but That would be as easy for me as building a nuclear bomb  :2funny:

Me finds somthing different to try  ;)

I love you form though it works great


mfKG

#78
THX to mebymyself for sharing this,...i also learnt something 'bout forms ;)...GREAT,..
but i suggest to change the <table><tr><td> for makeing a post to [table][tr][td]. Workt with <>, but was not formatet right and try after edit that post, hihi....

mfKG

#79
need help, plz ;) :

<TEXTAREA class="inp_txt" id="habbits" name="habbits" rows="4" value ="';
if (isset($_POST['habbits'])) echo $_POST['habbits']; echo '" ></' . 'TEXTAREA>


doesnt work (value doesnt work 4 textareas),...

so i changed to
<TEXTAREA class="inp_txt" id="habbits" name="habbits" rows="4">';
if (isset($_POST['habbits'])) echo $_POST['habbits']; echo </' . 'TEXTAREA>


but this produce en error in the artice,...very confusing, dont know why ;( (drops the code after "echo'"...

(btw: why is there "' . '"</' . 'TEXTAREA>? sry, im a very php newbie;))

tHX 4 help


edit: ok, this must be an TP Issue.....my code is correct,...tested it in a customaction (so it saves also the code in the textareas, with value its not working;)),....k...then i will make it with action,...looks anyway nicer ;) (?action=joinus)....

This website is proudly hosted on Crocweb Cloud Website Hosting.