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: 0
  • Guests: 673
  • Total: 673

[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

Quote from: iGate on July 02, 2007, 02:13:36 PM
ok....any ideas then how to modify this to use pms instead?

As I said - I don't know how to do it but i will work on it ...
about ideas ... If you know PHP you can try to reverse engineer the SMF source and see if build in function available to send PM. If not then manually insert records in smf_personal_messages and smf_pm_recipients tables


mebymyself

#131
Quote from: ninakar on July 02, 2007, 02:19:55 PM
Thnx again...soz for lots of questions but I'm a total noob in PHP :P

Well. resolved that last too..and also a same msitake afterwars (@ line 300+)

now got mistake on line 411


QuoteParse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/vincent/public_html/looneytunez/Test/TestPortal1/Sources/Load.php(1735) : eval()'d code(209) : eval()'d code on line 411

let's hope before u leave...and wish happy holidays :)

same thing here <OPTION value="No, I didn't">No, I didn't. Powered lvl, or traded character</OPTION>

must be
<OPTION value="No, I didn\'t">No, I didn\'t. Powered lvl, or traded character</OPTION>


You should escape all single quotes ' with \ so it looks like \'

ninakar

THNX!!!

Gosh..didn't thought that text part of the question -not code- would make such a mess..

Well no mistakes now..form is enabled..
I will test it thoroughly..

thnx a lot m8 :)

And I have a good think for anyone to make.
I want to make the code in that way so as to...

Depending the class selected from the applicant, the notification mail of the application goes to different class leader/officers mail.
Site admin & Guild Master also (for all applicants)

example:
If somebody selects Warlock for Recruiting char, I want the mail to be sent to not only site admin & GM but to the appropriate class leader for Warlocks we have.

in general
stable emails will be admin & gm
and depending on the variable of class
it will be sent to one third person, different each time

that's food for thought ;)


thnx again m8 :) and have  nice holiday :D

mebymyself

#133
Well, I tried to keep the code as general as possible. your request is specific to your type of game only but it very easy to customize:

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


put something like this:


switch ( $_POST['class'] ) {
case 'Druid':
    $email_address='whatever@emal.needed';
    break;
case 'Hunter':
    $email_address='whatever@emal.needed';
    break;

// put rest of the classes the same way
// case '<class name here>':
// $email_address='whatever@emal.needed';
//  break;

     
default:
    $email_address='whatever@emal.needed'; // Here put an email of general admin in case if user didn't select any class
}


ninakar

#134
Well m8..u are awesome...
though when selcting class it sends only to the email address put in the switch faction..
and not the stable ones outside of it (such as admin mail)

but that's ok :) I don't mind..i will jsut put the address inside the switch function..

thnx again :)

I believe that this addition is great for any site (not only my specific requirement) :)


Well I get one problem..When I only put one email address it's ok
But I insert multiple mail address into the switch function (to be send to the appropriate person each time). I use the method mentioned here --> http://www.tinyportal.net/index.php?topic=9840.msg88640#msg88640


But it doesn't work...

[edit]
Problem solved

Instead of the way mentioned
$email_address='myemail@iinet.net.au; email2.net.au; email3.net.au';

U must use "," instead of ";" between the e-mails. So it will be this way
$email_address='myemail@iinet.net.au, email2.net.au, email3.net.au';
[/edit]

ninakar

#135
Well guys somebody could help now..simple php (me=noob :P )
Well..in the error check area (for necessary fill in boxes).
There i want to check email/game name/class/lvl
the two first are written by the applicant
the two last are selected from a drop down menu (which is created from the select id, option value code etc etc)

It checks for the first two..but the last two are not checked for errors (no selection).
As I have seen the current code checks only written by the applicant answers.
It does not search answers that are chosen from options of a drop down menu.


// Check for an AA name
if (empty($_POST['aa_name']) ){
$enroll_errors[] = 'You forgot to enter your Character Name.';
}       

        // Check for class
if (empty($_POST['class']) ){
$enroll_errors[] = 'You forgot to enter your Character Class.';
}


The first is checked for errors (not filled)..the second no .
What I must change in order to check the value of a drop down menu?
If u don't select anything there, the option u receive is not selected (------), maybe that confuses the code and thinks that the option has a selection and is not empty.

Any ideas?

[edit]
Solved
Problem solved here too with a help of friend.

for drop down menu options (used in select tables)
instead of

// Check for class
if (empty($_POST['class']) ){
$enroll_errors[] = 'You forgot to enter your Character Class.';
}


I used

        // Check for class
if ($_POST['class']=="No Answer") {
$enroll_errors[] = 'You forgot to enter your Character Class.';
}


and works beautifully :)

iGate

any1 know why mine is skrewing up?

http://test.ihf.lp.pl/forum/index.php?page=17


global $sourcedir, $user_info, $context ;

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



// CONFIGURATION SECTION

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

// email address of reqruitment staff member
$email_address='k.dog.qwe@gmail.com';

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

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

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

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


//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 an email
if (empty($_POST['email']) ){
$enroll_errors[] = 'You forgot to enter your email address.';
}
// Check for in game nickAAO
if (empty($_POST['aa_name']) ){
$enroll_errors[] = 'You forgot to enter your AA account name';
}
// Check for a name
if (empty($_POST['timezone']) ){
$enroll_errors[] = 'You forgot to enter your timezone.';
}
// Check for an honor
if (empty($_POST['honor']) ){
$enroll_errors[] = 'You forgot to enter your Honor Level.';
}
// Check for drAAt
if (empty($_POST['draat']) ){
$enroll_errors[] = 'You forgot to enter your drAAt link.';
}
// Check for why join?
if (empty($_POST['why']) ){
$enroll_errors[] = 'You forgot to enter why you want to join our clan.';
}     

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'] . '
Current Honor:  ' . $_POST['honor'] . '
Previous clan(s):  ' . $_POST['prev_clans'] . '
Banned from any sever:  ' . $_POST['banned'] . '
Registered with AAOTracker? ' . $_POST['aaotracker'] . '
AAOTracker name:  ' . $_POST['aaotracker_name'] . '
drAAt Link:  ' . $_POST['draat'] . '
TeamSpeak installed?:  ' . $_POST['ts'] . '
Have microphone/headset:  ' . $_POST['mic'] . '
Would like to help pay for a server?: ' . $_POST['pay'] . '
Why do you want to join our clan?  ' . $_POST['why'] . '
Other information:  ' . $_POST['other'];

$postbody = 'Enrollment application has been made by ' . $context['user']['name'] .'<br />
<table>
<tr><td>Real Name:<td></td><td>  ' . $_POST['real_name'] . '</td></tr>
<tr><td>Email address:<td></td><td>  ' . $_POST['email'] . '</td></tr>
<tr><td>Current Game Name:<td></td><td>  ' . $_POST['aa_name'] . '</td></tr>
<tr><td>Age:<td></td><td>  ' . $_POST['age'] . '</td></tr>
<tr><td>Gender: <td></td><td>' . $_POST['gender'] . '</td></tr>
<tr><td>Location:<td></td><td>  ' . $_POST['location'] . '</td></tr>
<tr><td>Current Honor: <td></td><td> ' . $_POST['honor'] . '</td></tr>
<tr><td>Previous clan(s): <td></td><td> ' . $_POST['prev_clans'] . '</td></tr>
<tr><td>Banned from any sever: <td></td><td> ' . $_POST['banned'] . '</td></tr>
<tr><td>Registered with AAOTracker? <td></td><td>' . $_POST['aaotracker'] . '</td></tr>
<tr><td>AAOTracker name:  <td></td><td>' . $_POST['aaotracker_name'] . '</td></tr>
<tr><td>drAAt Link: <td></td><td> ' . $_POST['draat'] . '</td></tr>
<tr><td>TeamSpeak installed?: <td></td><td> ' . $_POST['ts'] . '</td></tr>
<tr><td>Have microphone/headset: <td></td><td> ' . $_POST['mic'] . '</td></tr>
<tr><td>Would like to help pay for a server?:<td></td><td> ' . $_POST['pay'] . '</td></tr>
<tr><td>Why do you want to join our clan? <td></td><td> ' . $_POST['why'] . '</td></tr>
<tr><td>Other information: <td></td><td> ' . $_POST['other']. '</td></tr>
</table>';



            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'] .'/forum/index.php?page=' . $thank_you_article_id);

} else {
// Redirect to error page
//header('Location: http://' . $_SERVER['HTTP_HOST'] . 'forum/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="100%" border="0">
<TR class= ââ,¬Å"windowbg2ââ,¬Â>
<TD width=ââ,¬Å"100%ââ,¬Â>YOUR TEXT HERE</TD>
</TR>
<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">Current AA 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>- Please Select -</OPTION>
<OPTION value="M">Male</OPTION>
<OPTION value="F">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Your Time Zone: *</TD>
<TD><SELECT id="timezone" name="timezone" type="text" value ="';
if (isset($_POST['timezone'])) echo $_POST['timezone'];   
echo '" />
<OPTION value="GMT -12">(GMT ââ,¬â€œ12:00)</OPTION>
<OPTION value="GMT -11">(GMT ââ,¬â€œ11:00)</OPTION>
<OPTION value="GMT -10">(GMT ââ,¬â€œ10:00)</OPTION>
<OPTION value="GMT -9">(GMT ââ,¬â€œ9:00)</OPTION>
<OPTION value="GMT -8">(GMT ââ,¬â€œ8:00)</OPTION>
<OPTION value="GMT -7">(GMT ââ,¬â€œ7:00)</OPTION>
<OPTION value="GMT -6">(GMT ââ,¬â€œ6:00)</OPTION>
<OPTION value="GMT -5">(GMT ââ,¬â€œ5:00)</OPTION>
<OPTION value="GMT -4">(GMT ââ,¬â€œ4:00)</OPTION>
<OPTION value="GMT -3">(GMT ââ,¬â€œ3:00)</OPTION>
<OPTION value="GMT -2">(GMT ââ,¬â€œ2:00)</OPTION>
<OPTION value="GMT -1">(GMT ââ,¬â€œ1:00)</OPTION>
<OPTION value="UTC/GMT" selected>(UTC/GMT)</OPTION>
<OPTION value="GMT +1ââ,¬Â>(GMT +1:00)</OPTION>
<OPTION value="GMT +2ââ,¬Â>(GMT +2:00)</OPTION>
<OPTION value="GMT +3ââ,¬Â>(GMT +3:00)</OPTION>
<OPTION value="GMT +4ââ,¬Â>(GMT +4:00)</OPTION>
<OPTION value="GMT +5ââ,¬Â>(GMT +5:00)</OPTION>
<OPTION value="GMT +6ââ,¬Â>(GMT +6:00)</OPTION>
<OPTION value="GMT +7ââ,¬Â>(GMT +7:00)</OPTION>
<OPTION value="GMT +8ââ,¬Â>(GMT +8:00)</OPTION>
<OPTION value="GMT +9ââ,¬Â>(GMT +9:00)</OPTION>
<OPTION value="GMT +10ââ,¬Â>(GMT +10:00)</OPTION>
<OPTION value="GMT +11ââ,¬Â>(GMT +11:00)</OPTION>
<OPTION value="GMT +12ââ,¬Â>(GMT +12:00)</OPTION>
<OPTION value="GMT +13ââ,¬Â>(GMT +13:00)</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Are you now or ever been in a clan?</TD>
<TD><SELECT id="clan" name="clan" style="WIDTH: 160px" value ="';
if (isset($_POST['clan'])) echo $_POST['clan'];   
echo '" />
<OPTION value="No answer" selected>- Please Select -</OPTION>
<OPTION value="YES">Yes ââ,¬â€œ (Complete next step)</OPTION>
<OPTION value="NO">No ââ,¬â€œ (Skip next step)</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Current Honor: *</TD>
<TD><INPUT id="honor" name="honor" type="text" value ="';
if (isset($_POST['honor'])) echo $_POST['honor'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<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 ="windowbg2">
<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 ="windowbg">
<TD width = "200px">Registered with AAOTracker?</TD>
<TD><SELECT id="aaotracker" name="aaotracker" style="WIDTH: 160px" value ="';
if (isset($_POST['aaotraker'])) echo $_POST['aaotraker'];   
echo '" />
<OPTION value="No answer" selected>- Please Select -</OPTION>
<OPTION value="YES">Yes ââ,¬â€œ (Complete next step)</OPTION>
<OPTION value="NO">No ââ,¬â€œ (Skip next step)</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">AAOTracker Link: (find <a href=" http://aaotracker.com/playersearch.php">here</a>)</TD>
<TD><INPUT id="aaotracker_name" name="aaotracker_name" type="text" value ="';
if (isset($_POST['aaotraker_name'])) echo $_POST['aaotraker_name']; 
echo '" /></TD>

<OPTION value="No answer" selected>- Please Select -</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">drAAt Link: *
(find <a href=" http://www.draat.net/playersearch/">here</a>)
</TD>
<TD><INPUT id ="draat" name ="draat" rows="4" cols="40"  value ="';
if (isset($_POST['draat'])) echo $_POST['draat'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Do you have TeamSpeak installed?:</TD>
<TD><SELECT id="ts" name="ts" style="WIDTH: 160px" value ="';
if (isset($_POST['ts'])) echo $_POST['ts'];   
echo '" />
<OPTION value="No answer" selected>- Please Select -</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</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>- Please Select -</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>- Please Select -</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 =IHF=? *</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">How often do you play AA?</TD>
<TD><SELECT id="habbits" name="habbits" style="WIDTH: 160px" value ="';
if (isset($_POST['habbits'])) echo $_POST['habbits'];   
echo '" />
<OPTION value="No answer" selected>- Please Select -</OPTION>
<OPTION value="Daily">Daily</OPTION>
<OPTION value="Weekly">Weekly</OPTION>
<OPTION value="Monthly">Monthly</OPTION>
<OPTION value="Occasionally">Occasionally</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Which member invited you to the clan?:</TD>
<TD><INPUT id="invite" name = "invite" rows="4" cols="40" value ="';
if (isset($_POST['invite'])) echo $_POST['invite'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<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 ="windowbg">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>

';

JOSHSKORN

I'd like to append this article such that when the user submits their application, it adds an additional membergroup to their privileges (i.e. the user is now assigned the secondary group 'Applicants' which is group 25).  Any ideas?

iGate


IchBin

Quote from: iGate on July 05, 2007, 12:14:47 PM
any ideas on mine?

Change this line and see if it makes any difference.

Find:
<TD><SELECT id="clan" name="clan" style="WIDTH: 160px" value ="';
if (isset($_POST['clan'])) echo $_POST['clan'];   
echo '" />


Replace:
<TD><SELECT id="clan" name="clan" style="WIDTH: 160px" value ="', isset($_POST['clan']) ? $_POST['clan'] : '' ,'" />

This website is proudly hosted on Crocweb Cloud Website Hosting.