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,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 448
  • Total: 448

[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.

Azphat12

I will do my best..I am at work  ::)

In the application I would like all the Questions to be aligned Like this

Name: answer box
Age: answer box
Email: answer box
Why did you choose this spec?:
Answer box
What can you offer Dark Aftermath?:
Answer box
Member Referral: answer box

So basically all the questions are aligned together and neat.  The 'textarea' boxes are positioned below the question where as the smaller answer boxes can be to the right of the question.

On the actual Post I would like it the same way.  But in the text boxes maybe have a certain word limit per line if possible?  So it will see they typed 800 words in 1 sentence and it will auto wrap at lets say 300 words.  So here is what that might look like...

What can you offer Dark Aftermath?:
300 words of an answer
300 words of an answer
200 words of an answer

Maybe that is left justifying everyting?  I would like the table itself to be centered, but all the questions and such to be left justified inside of the table.  Not sure that is a good example or even possible. 

btw, I really appreciate you helping me on this.  Thank you so much!

JPDeni

Quote
The 'textarea' boxes are positioned below the question where as the smaller answer boxes can be to the right of the question.

That goes back to what I gave you earlier, then.

I'll repost it here.


global $sourcedir, $ID_MEMBER, $context ;


if ($ID_MEMBER == 0)
{
    echo 'You must be logged in before you can apply.';
}
else {

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


// CONFIGURATION SECTION

$intro_form = "<center><h4><font color=red>Even if this is nothing like the normal Applications that you are used too, we still expect that every field that requires a written answer to be well written.<p>Please take the time to fill out each field, as this is your first impression to the guild.</p></font></h4> </center><br>";   // Can include html

$thanks_text = "<center><h3><font color=red>Thanks for applying. Your application has been submitted successfully. We'll review your application and get back to you.</h3></font></center>"; // what is displayed after the form is submitted

// Define your fields. All of these values need to be defined, even if they are empty.
// The fields will be displayed in the order in which they are listed in the array.
// $fielddef =
//   array(
//     array(
//       'caption' =>      "", // caption to be displayed on the form. Can include symbols and spaces.
//       'name' =>         "", // a unique name for the field. No symbols or spaces
//       'type' =>         "", // text, radio, select, checkbox, textarea, heading
//       'options' =>      "", // for radio and select fields. List in order you wish them to appear, separated by commas; for checkboxes, it's the value to be saved and displayed next to the box
//       'defaultvalue' => "", // the default value for the field. Can be a variable or text. Be sure to enclose text in quotation marks
//       'required' =>     0   // 0 or 1 -- use 1 if the field must be filled out. use 0 if it's optional; never set a checkbox to be required
//     ),
//   );

$fielddef =
  array(
       array(
      'caption' =>      "Personal Info",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
          ),
array(
      'caption' =>      "Name",
      'name' =>         "realname",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
array(
      'caption' =>      "Age",
      'name' =>         "age",
      'type' =>         "select",
      'options' =>      "18,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40+",
      'defaultvalue' => "18",
      'required' =>     1
    ), 
       array(
      'caption' =>      "Email",
      'name' =>         "charemail",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
  ),
array(
      'caption' =>      "Character Info",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
array(
      'caption' =>      "Character Name",
      'name' =>         "charname",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
array(
      'caption' =>      "Level",
      'name' =>         "charlevel",
      'type' =>         "select",
      'options' =>      "80,79,78,77,76,75,74,73,72,71",
      'defaultvalue' => "80",
      'required' =>     1
    ),
array(
      'caption' =>      "Race",
      'name' =>         "charrace",
      'type' =>         "select",
      'options' =>      "Draenei,Dwarf,Gnome,Human,Night Elf",
      'defaultvalue' => "Draenei",
      'required' =>     1
    ),
array(
      'caption' =>      "Class",
      'name' =>         "charclass",
      'type' =>         "select",
      'options' =>      "Death Knight,Druid,Hunter,Mage,Paladin,Priest,Rogue,Shaman,Warlock,Warrior",
      'defaultvalue' => "Death Knight",
      'required' =>     1
    ),
array(
      'caption' =>      "Days played",
      'name' =>         "charplayed",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
       array(
      'caption' =>      "Profession 1",
      'name' =>         "prof1",
      'type' =>         "select",
      'options' =>      "None,Herbalism,Mining,Skinning,Alchemy,Blacksmithing,Enchanting,Engineering,Leatherworking,Tailoring,Jewelcrafting,Inscription",
      'defaultvalue' => "None",
      'required' =>     1
    ),
array(
      'caption' =>      "Profession 2",
      'name' =>         "prof2",
      'type' =>         "select",
      'options' =>      "None,Herbalism,Mining,Skinning,Alchemy,Blacksmithing,Enchanting,Engineering,Leatherworking,Tailoring,Jewelcrafting,Inscription",
      'defaultvalue' => "None",
      'required' =>     1
    ),
array(
      'caption' =>      "Primary Spec?",
      'name' =>         "primaryspec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Secondary Spec?",
      'name' =>         "secondaryspec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Armory Link?",
      'name' =>         "armory",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Why you speced this way",
      'name' =>         "specinfo",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "What are you class important stats and why",
      'name' =>         "specstats",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
       array(
      'caption' =>      "Additional Questions",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
          ),
array(
      'caption' =>      "What can you offer Dark Aftermath?",
      'name' =>         "offer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "What are you looking for in Dark Aftermath?",
      'name' =>         "looking",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Any added information to help us make a decision?",
      'name' =>         "decision",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Member Referral?",
      'name' =>         "referral",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
);



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

// email address of recruitment staff member
$email_address='recruitment@darkaftermath.org';

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

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


//END OF CONFIGURATION SECTION



$show_form= 'true';
if (isset($_REQUEST['submitted'])) {  // Handle the form
// Check required fields
  $errors = array(); //Initialize error array
      if (!isset($_REQUEST['mathtest']) or ($_REQUEST['mathtest'] <> 12))
      $errors[] = 'You didn' . "'" . 't get the math problem correct';

  foreach ($fielddef as $field)
    if (empty($_REQUEST[$field['name']]) && ($field['required'] == 1)){ $errors[] = $field['name']; }

// There's at least one field missing
  if (isset($errors[0])) {
    foreach ($_REQUEST as $key => $value)
      $fieldvalue[$key] = $value;
  }
  else { // all is well
 
    $show_form='false';
    if ($enable_email) {  // email an application
  $subject = 'Recruitment Application';
  $body = 'Recruitment application has been made by ' . $context['user']['name'] .
          ' from IP Address ' . $user_info['ip'] . '
              ';
      foreach ($fielddef as $field) {
        $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '
        ';
      }
      mail($email_address, $subject, $body,"From: " . $user_info['email']);
    }

    if ($enable_post) {  //create new forum post with application

      $postbody = 'Recruitment application has been made by ' . $context['user']['name'] .'<br /><br/>';
  foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
          $postbody .= '[color=red][u][b]' . $field['caption'] . '[/b][/u][/color]<br />';
        else
          $postbody .= '[color=green]' . $field['caption'] . '[/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }
      $postbody .= '';

      $msgOptions = array(
        'id' =>  0 ,
        'subject' => '[Pending] Application of ' . $_REQUEST['charname'] . ' ' . $_REQUEST['charclass'],
        '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,
      );
      createPost($msgOptions, $topicOptions, $posterOptions);
    }
// Text for thank you page

    echo $thanks_text;
  }
}

// Looks like you want the form,
if ($show_form == 'true') {
  echo $intro_form . "<br>";
  if (isset($errors[0])) { echo '<div style="color: red;">Please fill in all fields with a *.</div>';  }
  echo '<form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
        <center><table width="50%">';
  $bg = 'windowbg2';
  foreach ($fielddef as $field) {
    if ($field['type'] == 'text') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><INPUT id="' . $field['name'] . '" name="' . $field['name'] . '" type="text" value ="' . $fieldvalue[$field['name']] . '" /></TD>
            </TR>';
    }
    elseif ($field['type'] == 'radio') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left">';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<INPUT TYPE="RADIO" NAME="' . $field['name'] . '" VALUE="'. $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' CHECKED'; }
                echo '>' . $option . ' ';
              }
              echo '</TD>
            </TR>';   
    }
    elseif ($field['type'] == 'checkbox') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              echo $field['caption'] . ':</TD>
              <TD align="left">';
                echo '<INPUT TYPE="CHECKBOX" NAME="' . $field['name'] . '" VALUE="'. $field['options'] . '"';
                if (isset($fieldvalue[$field['name']]) && ($fieldvalue[$field['name']]==$field['options'])) { echo ' CHECKED'; }
                echo '>' . $field['options'] . ' </TD>
            </TR>';   
    }
    elseif ($field['type'] == 'select') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><SELECT name="' . $field['name'] . '" style="WIDTH: 152px" />';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<OPTION value="' . $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' selected'; }
                echo '>' . $option . '</OPTION>';
            }
            echo '</SELECT></TD>
            </TR>';
    }   
    elseif ($field['type'] == 'textarea') {
      echo '<TR class ="' . $bg . '">
            <TD colspan=2">';
            if ($field['required'] == 1) { echo '* '; }
            echo $field['caption'] . ':<br />
            <TEXTAREA id="' . $field['name'] . '" name="' . $field['name'] . '" rows="4" cols="40">';
            echo $fieldvalue[$field['name']];
            echo '</' . 'TEXTAREA></TD>
  </TR>';
    }
  elseif ($field['type'] == 'heading') {
      echo '<tr><TD colspan="2"><center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline;"><font size="4">' .
            $field['caption'] .
            '</font></TD></TR></table></center></td></tr>';
    }
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
  }

    echo '
     <TR class ="' . $bg . '"><td>What is 5 + 7? (enter a number)</td>
     <td><input type="text" name="mathtest" value=""></td></tr>';
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
    echo '
    <TR class ="' . $bg . '">
      <TD colspan="2" align="center">
  <br>
        <INPUT type="submit" value="Submit">
        <INPUT type="reset" value="Reset"></TD>
    </TR></TABLE></center></form>';
}
}


QuoteSo it will see they typed 800 words in 1 sentence and it will auto wrap at lets say 300 words.

I don't think you mean that. There is no way that 300 words would fit onto one line. I don't think that even 300 characters will fit on one line in most browsers. Possibly 30 characters is what you meant.

Also there is not nearly the flexibility with BBC code that there is with html. I can set it up to put things in a table. No problem at all. But things like headings that normally would span two columns just won't work.

If you can set it up in a forum post here, using BBC code the way you want it, I can (probably) figure out how to make the script do it.

Azphat12

The word wrap feature I can look at.  300 was just an example to try and show once it reached a certain amount it would go to the next line.  I am not overy code literate, except being able to do edits and things, lol.

I will look at the code you posted, but if it is the same as the other, there was a small issue with it not formatting properly.

I will look when I get home shortly, and if it isnt right I will try to atleast make it look the way I want and post a screenshot so you can see how I am trying to make it look, and see if it is possible to make the code do that.

JPDeni

Quotethere was a small issue with it not formatting properly.

What was the issue?

Azphat12

Ok had some time to play around with things.....the application itself will be fine with the login info added.  All I would like is to see if the output can be worked on.  Here is the current code since I changed a few colors around and moved some boxes to make it look better..

global $sourcedir, $ID_MEMBER, $context ;


if ($ID_MEMBER == 0)
{
    echo 'You must be logged in before you can apply.';
}
else {

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


// CONFIGURATION SECTION

$intro_form = "<center><h4><font color=white>Even if this is nothing like the normal Applications that you are used too, we still expect that every field that requires a written answer to be well written.<p>Please take the time to fill out each field, as this is your first impression to the guild.</p></font></h4> </center><br>";   // Can include html

$thanks_text = "<center><h3><font color=white>Thanks for applying. Your application has been submitted successfully.<br>We'll review your application and get back to you.<p>Typical response time is 24-48 hours.</p>If you are not contacted by then, please message an officer ingame to discuss your application status.<p>Thank You,<br>Dark Aftermath Recruitment</p></h3></font></center>"; // what is displayed after the form is submitted

// Define your fields. All of these values need to be defined, even if they are empty.
// The fields will be displayed in the order in which they are listed in the array.
// $fielddef =
//   array(
//     array(
//       'caption' =>      "", // caption to be displayed on the form. Can include symbols and spaces.
//       'name' =>         "", // a unique name for the field. No symbols or spaces
//       'type' =>         "", // text, radio, select, checkbox, textarea, heading
//       'options' =>      "", // for radio and select fields. List in order you wish them to appear, separated by commas; for checkboxes, it's the value to be saved and displayed next to the box
//       'defaultvalue' => "", // the default value for the field. Can be a variable or text. Be sure to enclose text in quotation marks
//       'required' =>     0   // 0 or 1 -- use 1 if the field must be filled out. use 0 if it's optional; never set a checkbox to be required
//     ),
//   );

$fielddef =
  array(
       array(
      'caption' =>      "Personal Info",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
          ),
array(
      'caption' =>      "Name",
      'name' =>         "realname",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
array(
      'caption' =>      "Age",
      'name' =>         "age",
      'type' =>         "select",
      'options' =>      "18,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40+",
      'defaultvalue' => "18",
      'required' =>     1
    ), 
       array(
      'caption' =>      "Email",
      'name' =>         "charemail",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Member Referral",
      'name' =>         "referral",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
array(
      'caption' =>      "Character Info",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
array(
      'caption' =>      "Character Name",
      'name' =>         "charname",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
array(
      'caption' =>      "Level",
      'name' =>         "charlevel",
      'type' =>         "select",
      'options' =>      "80,79,78,77,76,75,74,73,72,71",
      'defaultvalue' => "80",
      'required' =>     1
    ),
array(
      'caption' =>      "Race",
      'name' =>         "charrace",
      'type' =>         "select",
      'options' =>      "Draenei,Dwarf,Gnome,Human,Night Elf",
      'defaultvalue' => "Draenei",
      'required' =>     1
    ),
array(
      'caption' =>      "Class",
      'name' =>         "charclass",
      'type' =>         "select",
      'options' =>      "Death Knight,Druid,Hunter,Mage,Paladin,Priest,Rogue,Shaman,Warlock,Warrior",
      'defaultvalue' => "Death Knight",
      'required' =>     1
    ),
array(
      'caption' =>      "Days played",
      'name' =>         "charplayed",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1   
    ),
       array(
      'caption' =>      "Profession 1",
      'name' =>         "prof1",
      'type' =>         "select",
      'options' =>      "None,Herbalism,Mining,Skinning,Alchemy,Blacksmithing,Enchanting,Engineering,Leatherworking,Tailoring,Jewelcrafting,Inscription",
      'defaultvalue' => "None",
      'required' =>     1
    ),
array(
      'caption' =>      "Profession 2",
      'name' =>         "prof2",
      'type' =>         "select",
      'options' =>      "None,Herbalism,Mining,Skinning,Alchemy,Blacksmithing,Enchanting,Engineering,Leatherworking,Tailoring,Jewelcrafting,Inscription",
      'defaultvalue' => "None",
      'required' =>     1
    ),
array(
      'caption' =>      "Primary Spec?",
      'name' =>         "primaryspec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Secondary Spec?",
      'name' =>         "secondaryspec",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Armory Link?",
      'name' =>         "armory",
      'type' =>         "text",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Why you speced this way",
      'name' =>         "specinfo",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
     'caption' =>      "Willing to respec?",
      'name' =>         "specstats",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
       array(
      'caption' =>      "Additional Questions",
      'name' =>         "heading1",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
          ),
array(
      'caption' =>      "What can you offer<br>Dark Aftermath?",
      'name' =>         "offer",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "What are you looking<br>for in Dark Aftermath?",
      'name' =>         "looking",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Additional Comments?",
      'name' =>         "decision",
      'type' =>         "textarea",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     1
    ),
array(
      'caption' =>      "Competency Test",
      'name' =>         "test",
      'type' =>         "heading",
      'options' =>      "",
      'defaultvalue' => "",
      'required' =>     0
    ),
);



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

// email address of recruitment staff member
$email_address='recruitment@darkaftermath.org';

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

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


//END OF CONFIGURATION SECTION



$show_form= 'true';
if (isset($_REQUEST['submitted'])) {  // Handle the form
// Check required fields
  $errors = array(); //Initialize error array
      if (!isset($_REQUEST['mathtest']) or ($_REQUEST['mathtest'] <> 12))
      $errors[] = 'You didn' . "'" . 't get the math problem correct';

  foreach ($fielddef as $field)
    if (empty($_REQUEST[$field['name']]) && ($field['required'] == 1)){ $errors[] = $field['name']; }

// There's at least one field missing
  if (isset($errors[0])) {
    foreach ($_REQUEST as $key => $value)
      $fieldvalue[$key] = $value;
  }
  else { // all is well
 
    $show_form='false';
    if ($enable_email) {  // email an application
  $subject = 'Recruitment Application';
  $body = 'Recruitment application has been made by ' . $context['user']['name'] .
          ' from IP Address ' . $user_info['ip'] . '
              ';
      foreach ($fielddef as $field) {
        $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '
        ';
      }
      mail($email_address, $subject, $body,"From: " . $user_info['email']);
    }

    if ($enable_post) {  //create new forum post with application

      $postbody = 'Recruitment application has been made by ' . $context['user']['name'] .'<br /><br/>';
  foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
          $postbody .= '[color=white][u][b]' . $field['caption'] . '[/b][/u][/color]  ' . $_REQUEST[$field['name']] . '<br />';
        else
          $postbody .= '[color=#5BAFDF]' . $field['caption'] . '[/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }
      $postbody .= '';

      $msgOptions = array(
        'id' =>  0 ,
        'subject' => '[Pending] Application of ' . $_REQUEST['charname'] . ' ' . $_REQUEST['charclass'],
        '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,
      );
      createPost($msgOptions, $topicOptions, $posterOptions);
    }
// Text for thank you page

    echo $thanks_text;
  }
}

// Looks like you want the form,
if ($show_form == 'true') {
  echo $intro_form . "<br>";
  if (isset($errors[0])) { echo '<div style="color: red;">Please fill in all fields with a *.</div>';  }
  echo '<form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
        <center><table width="50%">';
  $bg = 'windowbg2';
  foreach ($fielddef as $field) {
    if ($field['type'] == 'text') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><INPUT id="' . $field['name'] . '" name="' . $field['name'] . '" type="text" value ="' . $fieldvalue[$field['name']] . '" /></TD>
            </TR>';
    }
    elseif ($field['type'] == 'radio') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left">';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<INPUT TYPE="RADIO" NAME="' . $field['name'] . '" VALUE="'. $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' CHECKED'; }
                echo '>' . $option . ' ';
              }
              echo '</TD>
            </TR>';   
    }
    elseif ($field['type'] == 'checkbox') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              echo $field['caption'] . ':</TD>
              <TD align="left">';
                echo '<INPUT TYPE="CHECKBOX" NAME="' . $field['name'] . '" VALUE="'. $field['options'] . '"';
                if (isset($fieldvalue[$field['name']]) && ($fieldvalue[$field['name']]==$field['options'])) { echo ' CHECKED'; }
                echo '>' . $field['options'] . '
            </TR>';   
    }
    elseif ($field['type'] == 'select') {
      echo '<TR class ="' . $bg . '">
              <TD width = "200px" align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':</TD>
              <TD align="left"><SELECT id="' . $field['name'] . '" name="' . $field['name'] . '" style="WIDTH: 152px" value ="';
              echo '" />';
              $options = explode(',',$field['options']);
              foreach ($options as $option) {
                echo '<OPTION value="' . $option . '"';
                if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' selected'; }
                echo '>' . $option . '</OPTION>';
            }
            echo '</SELECT></TD>
            </TR>';
    }   
    elseif ($field['type'] == 'textarea') {
      echo '<TR class ="' . $bg . '">
            <TD width = "200px" align="right">';
            if ($field['required'] == 1) { echo '* '; }
            echo $field['caption'] . ':</TD>
            <TD align="left"><TEXTAREA id="' . $field['name'] . '" name="' . $field['name'] . '" rows="4" cols="40">';
            echo $fieldvalue[$field['name']];
            echo '</' . 'TEXTAREA></TD>
  </TR>';
    }
  elseif ($field['type'] == 'heading') {
      echo '<tr><TD colspan="2"><center><table cellSpacing="1" cellPadding="1" width="50%"><TR>
            <font size="8"><TD style="text-align: center; text-decoration: underline;"><font size="4">' .
            $field['caption'] .
            '</font></TD></TR></table></center></td></tr>';
    }
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
  }

    echo '
     <TR class ="' . $bg . '"><td>What is 5 + 7? (enter a number)</td>
     <td><input type="text" name="mathtest" value=""></td></tr>';
    if ($bg == 'windowbg2') { $bg = 'windowbg'; }
    else { $bg = 'windowbg2'; }
    echo '
    <TR class ="' . $bg . '">
      <TD colspan="2" align="center">
  <br>
        <INPUT type="submit" value="Submit">
        <INPUT type="reset" value="Reset"></TD>
    </TR></TABLE></center></form>';
}
}


And here is the screen shot of what I was looking for

JPDeni

Okay. This will put the textarea stuff below the label, rather than next to it.


  foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
          $postbody .= '[color=white][u][b]' . $field['caption'] . '[/b][/u][/color]<br />';
        elseif ($field['type'] == 'textarea') {
          $postbody .= '[color=#5BAFDF]' . $field['caption'] . '[/color]<br />' . $_REQUEST[$field['name']] . '<br />';        }
        else
          $postbody .= '[color=#5BAFDF]' . $field['caption'] . '[/color]  ' . $_REQUEST[$field['name']] . '<br />';
      }


The thing I haven't a clue about is "to only go out as far as the armory link." What is the "armory link" and how can I know how long it is?

Azphat12

Well, with the answers posting under the questions I think this might be good enough.  The idea of the "armory link" was to give an example in the screenshot of how far out I wanted the text to go. 

After looking at it here, I think it might be ok.  Need to get some applications in to see, aswell as a few of the other recruiters.

JPDeni

I can't see anything that says "armory link", possibly because I can't read the green text against the dark blue background.

I did create a word wrap function which you can use, though. You can set your own character length.


foreach ($fielddef as $field) {
        if ($field['type'] == 'heading')
           $postbody .= '[color=white][u][b]' . $field['caption'] . '[/b][/u][/color]<br />';
        elseif ($field['type'] == 'textarea') {
$text = $_REQUEST[$field['name']];
$length = 30; // maximum length of a line
$output = '';
while (strlen($text) > $length) {
$textlen = strlen($text);
$part = substr($text,0,$length);
$partlen = $length;
while (substr($part,-1) <> ' ') {
$part = substr($part,0,-1);
--$partlen;
}
$output .= $part . '<br />';
$text = substr($text,$partlen,($textlen-$partlen));
}
$output .= $text;
          $postbody .= '[color=#5BAFDF]' . $field['caption'] . '[/color]<br />' . $output . '<br />';        }
        else
          $postbody .= '[color=#5BAFDF]' . $field['caption'] . '[/color]  ' . $_REQUEST[$field['name']] . '<br />';
}

Azphat12

I added that code, and I get no errors.  However I do not see anything posting on my board at all.  Not even an attempt to post it.

I am getting the thank you for posting though, after I hit submit.

JPDeni

It shouldn't have had that effect. I can't guarantee that you put it in the right place.

Please post the code that you have -- the one that doesn't work -- so I can figure out what's wrong.

This website is proudly hosted on Crocweb Cloud Website Hosting.