Code:<?php
/*
==========================================
PHP-NUKE: Application Settings module
Version 2.2.2
==========================================
Copyright (c) 2007
by Nathan Burke
based on work by:
Arioch - http://www.black-blades.org
This program is free software. You can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation
==========================================
*/
/*
A note on function abstraction:
The functions were written such to make rearranging the form simple.
The main function calls any number of get function.
get function extract some informtion from the arrays and then call display functions
display functions have harcoded formatting information (eg. a field size of 2 for a level field) then call show functions
show function are what actually output the html code. they do little to no data shaping, simply outputting what was passed to them.
Nearly every html tag that is output is contained within the show functions.
The exception being table and row tags, those can be found in the new/exit table/row functions
All get functions are completely independant and can be called in any order, any number of times.
showSubmit can be called wherever you feel submit/reset buttons would be useful(calling it multiple times is ok)
If any function doens't follow the guidelines above, I aplogise, this code was expanded, shrunk, rewritten, sliced, diced and fed the Ravenous Bug-Bladder Beast of Trall during construction
*/
//Array References
/* Keys Array
Array (
[0] => Array (
[type] => Array ( [name] => KeyType1 [value] => Pre-BC Attunements/Keys [show] => 0 )
[keys] => Array (
[0] => Array ( [name] => Key1 [value] => Onyxia [show] => 0 [required] => 0 )
[1] => Array ( [name] => Key2 [value] => Molten Core [show] => 0 [required] => 0 )
[2] => Array ( [name] => Key3 [value] => Blackwing Lair [show] => 0 [required] => 0 )
[3] => Array ( [name] => Key4 [value] => Naxxramas [show] => 0 [required] => 0 )
)
)
[1] => Array (
[type] => Array ( [name] => KeyType2 [value] => Heroic Mode Keys [show] => 1 )
[keys] => Array (
[0] => Array ( [name] => Key5 [value] => Auchenai [show] => 1 [required] => 0 )
[1] => Array ( [name] => Key6 [value] => Warpforged [show] => 1 [required] => 0 )
[2] => Array ( [name] => Key7 [value] => Reservoir [show] => 1 [required] => 0 )
[3] => Array ( [name] => Key8 [value] => Flamewrought [show] => 1 [required] => 0 )
[4] => Array ( [name] => Key9 [value] => Key of Time [show] => 1 [required] => 0 )
)
)
[2] => Array (
[type] => Array ( [name] => KeyType3 [value] => BC Instance Keys [show] => 0 )
[keys] => Array (
[0] => Array ( [name] => Key10 [value] => Shattered Halls [show] => 0 [required] => 0 )
[1] => Array ( [name] => Key11 [value] => Shadow Labyrinth [show] => 0 [required] => 0 )
[2] => Array ( [name] => Key12 [value] => Arcatraz [show] => 0 [required] => 0 )
)
)
[3] => Array (
[type] => Array ( [name] => KeyType4 [value] => Endgame Keys [show] => 1 )
[keys] => Array (
[0] => Array ( [name] => Key13 [value] => Karazhan [show] => 1 [required] => 0 )
[1] => Array ( [name] => Key14 [value] => Tempest Keep: The Eye [show] => 1 [required] => 0 )
[2] => Array ( [name] => Key15 [value] => Serpentshrine Cavern [show] => 1 [required] => 0 )
)
)
)
*/
//CharData
/*
Array (
[0] => Array (
[name] => Array ( [name] => name [value] => Name [show] => 1 [required] => 1 )
[class] => Array ( [name] => class [value] => Class [show] => 1 [required] => 1 )
[level] => Array ( [name] => level [value] => Level [show] => 1 [required] => 1 )
[prof1] => Array ( [name] => prof1 [value] => Profession 1 [show] => 1 [required] => 1 )
[prof2] => Array ( [name] => prof2 [value] => Profession 2 [show] => 1 [required] => 1 )
[aid] => Array ( [name] => aid [value] => First Aid [show] => 1 [required] => 1 )
[gear] => Array ( [name] => gear [value] => Gear [show] => 1 [required] => 1 )
[build] => Array ( [name] => build [value] => Talent Build [show] => 1 [required] => 1 )
[resist] => Array ( [name] => resist [value] => Resistance (Unbuffed) [show] => 1 [required] => 1 )
[resistances] => Array (
[fire] => Array ( [name] => fire [value] => Fire [show] => 1 [required] => 1 )
[shadow] => Array ( [name] => shadow [value] => Shadow [show] => 1 [required] => 1 )
[nature] => Array ( [name] => nature [value] => Nature [show] => 1 [required] => 1 )
[arcane] => Array ( [name] => arcane [value] => Arcane [show] => 1 [required] => 1 )
[frost] => Array ( [name] => frost [value] => Frost [show] => 1 [required] => 1 )
)
)
[1] => Array (
[name] => Array ( [name] => name [value] => Name [show] => 1 [required] => 0 )
[class] => Array ( [name] => class [value] => Class [show] => 1 [required] => 1 )
[level] => Array ( [name] => level [value] => Level [show] => 1 [required] => 1 )
[prof1] => Array ( [name] => prof1 [value] => Profession 1 [show] => 1 [required] => 1 )
[prof2] => Array ( [name] => prof2 [value] => Profession 2 [show] => 1 [required] => 1 )
[aid] => Array ( [name] => aid [value] => First Aid [show] => 1 [required] => 1 )
[gear] => Array ( [name] => gear [value] => Gear [show] => 1 [required] => 1 )
[build] => Array ( [name] => build [value] => Talent Build [show] => 1 [required] => 1 )
[resist] => Array ( [name] => resist [value] => Resistance (Unbuffed) [show] => 1 [required] => 1 )
[resistances] => Array (
[fire] => Array ( [name] => fire [value] => Fire [show] => 1 [required] => 1 )
[shadow] => Array ( [name] => shadow [value] => Shadow [show] => 1 [required] => 1 )
[nature] => Array ( [name] => nature [value] => Nature [show] => 1 [required] => 1 )
[arcane] => Array ( [name] => arcane [value] => Arcane [show] => 1 [required] => 1 )
[frost] => Array ( [name] => frost [value] => Frost [show] => 1 [required] => 1 )
)
)
[2] => Array ( [name] => Array ( [name] => name [value] => Name [show] => 1 [required] => 0 ) [class] => Array ( [name] => class [value] => Class [show] => 1 [required] => 1 ) [level] => Array ( [name] => level [value] => Level [show] => 1 [required] => 1 ) [prof1] => Array ( [name] => prof1 [value] => Profession 1 [show] => 1 [required] => 1 ) [prof2] => Array ( [name] => prof2 [value] => Profession 2 [show] => 1 [required] => 1 ) [aid] => Array ( [name] => aid [value] => First Aid [show] => 1 [required] => 1 ) [gear] => Array ( [name] => gear [value] => Gear [show] => 1 [required] => 1 ) [build] => Array ( [name] => build [value] => Talent Build [show] => 1 [required] => 1 ) [resist] => Array ( [name] => resist [value] => Resistance (Unbuffed) [show] => 1 [required] => 1 ) [resistances] => Array ( [fire] => Array ( [name] => fire [value] => Fire [show] => 1 [required] => 1 ) [shadow] => Array ( [name] => shadow [value] => Shadow [show] => 1 [required] => 1 ) [nature] => Array ( [name] => nature [value] => Nature [show] => 1 [required] => 1 ) [arcane] => Array ( [name] => arcane [value] => Arcane [show] => 1 [required] => 1 ) [frost] => Array ( [name] => frost [value] => Frost [show] => 1 [required] => 1 ) ) ) [3] => Array ( [name] => Array ( [name] => name [value] => Name [show] => 1 [required] => 0 ) [class] => Array ( [name] => class [value] => Class [show] => 1 [required] => 1 ) [level] => Array ( [name] => level [value] => Level [show] => 1 [required] => 1 ) [prof1] => Array ( [name] => prof1 [value] => Profession 1 [show] => 1 [required] => 1 ) [prof2] => Array ( [name] => prof2 [value] => Profession 2 [show] => 1 [required] => 1 ) [aid] => Array ( [name] => aid [value] => First Aid [show] => 1 [required] => 1 ) [gear] => Array ( [name] => gear [value] => Gear [show] => 1 [required] => 1 ) [build] => Array ( [name] => build [value] => Talent Build [show] => 1 [required] => 1 ) [resist] => Array ( [name] => resist [value] => Resistance (Unbuffed) [show] => 1 [required] => 1 ) [resistances] => Array ( [fire] => Array ( [name] => fire [value] => Fire [show] => 1 [required] => 1 ) [shadow] => Array ( [name] => shadow [value] => Shadow [show] => 1 [required] => 1 ) [nature] => Array ( [name] => nature [value] => Nature [show] => 1 [required] => 1 ) [arcane] => Array ( [name] => arcane [value] => Arcane [show] => 1 [required] => 1 ) [frost] => Array ( [name] => frost [value] => Frost [show] => 1 [required] => 1 ) ) ) )
*/
//TextBoxes
/*
Array (
[TextBox1] => Array ( [name] => TextBox1 [value] => List any guilds (and their server) that you have been in or are currently in and reason(s) for leaving.<br>If you are a transfer to Anvilmar, why have you chosen this server? [show] => 1 [required] => 1 )
[TextBox2] => Array ( [name] => TextBox2 [value] => Please tell us a little bit about yourself.<br>What hours/days are you usually logged into WoW?<br>Why do you want to join Hybrid? [show] => 1 [required] => 1 )
[TextBox3] => Array ( [name] => TextBox3 [value] => Please describe in detail your pre-BC raiding experience. [show] => 1 [required] => 1 )
[TextBox4] => Array ( [name] => TextBox4 [value] => Are you currently on or have you completed 'The Trials of the Naaru'?<br>If have not completed this quest line, what step are you on? [show] => 1 [required] => 1 )
)
*/
define('NO_EDITOR', TRUE); //Supress WYSIWYG editor
$module_name = basename(dirname(__FILE__));
function requestform($UserData=array(), $CharData="", $KeyData="", $TextBoxData="", $Variables="", $Processed=false)
{
//Load variables into arrays
require_once("variables.php");
if($Processed == false)
{
initialize($Variables, $KeyData, $TextBoxData);
gimmeData($UserData, "userinfo");
gimmeCharData($CharData, $Variables['numalts']['value']);
gimmeData($GearData, "geardata");
}
$show = 0;
//The application form itself
echo "<form action=\"modules.php?name=Application&file=confirm\" method=\"POST\">\n";
//The order of the get...() calls below can be changed at will
//TODO: Integrate rearranging into admin module
getTitle("{$Variables['guildname']['value']} Application"); //The title of the form
getHeader($Variables['headertext']); //The header text
showRequired(); //The * info
$show += getUserinfo($UserData); //Information about the player
$show += getMaininfo($CharData[0]); //Information about the main character
$show += getAltinfo($CharData); //Information about their alts
$show += getKeys($KeyData); //Information about the keys
$show += getTextBoxes($TextBoxData); //Multiline text boxes
$show += getOther(); //Anything that didn't fit into the above
if($show != 0)
showSubmit(); //The submit/reset buttons
//Do not move any of the get...() calls below this line
echo "</form>";
}
function getHeader($text) //Shows the header information
{
if($text == "")
return 0;
newTable();
if ($text['show'])
echo $text['value'];
exitTable();
return 1;
}
function getTitle($text) //Shows the title of the application
{
if($text == "")
return 0;
newTable();
hDivider($text, 1);
exitTable();
return 1;
}
function getUserinfo($UserData) //Shows the user information fields
{
$show = 0;
foreach($UserData as $row)
$show += $row['show'];
if($show == 0)
return 0;
newTable();
hDivider("Your Information");
exitTable();
newTable();
newRow();
displayUserName($UserData['username']);
displayUserEmail($UserData['useremail']);
exitRow();
exitTable();
newTable();
newRow();
displayUserAge($UserData['userage']);
displayUserTime($UserData['usertime']);
displayUserPlay($UserData['userplay']);
exitRow();
exitTable();
displayCustom($UserData);
return 1;
}
function getMaininfo($MainData) //Show main character fields
{
$show = 0;
foreach($MainData as $row)
$show += $row['show'];
if($show == 0)
return 0;
newTable();
hDivider("Main Character Information");
exitTable();
newTable();
newRow();
displayCharName("mainname", $MainData['name']);
displayClassMenu("mainclass", $MainData['class']);
displayCharLevel("mainlevel", $MainData['level']);
exitRow();
exitTable();
newTable();
newRow();
displayCharFirstAid("mainaid", $MainData['aid']);
displayProfMenu("mainprof1", $MainData['prof1']);
displayProfMenu("mainprof2", $MainData['prof2']);
exitRow();
exitTable();
displayArmory("maingear", $MainData['gear']);
displayBuild("mainbuild", $MainData);
displayResist("mainresist", $MainData['resist'], $MainData['resistances']);
displayCustom($MainData);
return 1;
}
function getAltinfo($CharData)
{
if(count($CharData) == 1)
return 0;
newTable();
hDivider("Alternate Character(s)");
exitTable();
showRequired(1);
$i = -1;
foreach($CharData as $row)
{
if($i == -1)//skip the first row because it contains main character data
{
$i = 0;
continue;
}
newTable();
newRow();
displayCharName("alt".$i."name", $row['name'], 1);
displayClassMenu("alt".$i."class", $row['class'], 1);
displayCharLevel("alt".$i."level", $row['level'], 1);
exitRow();
exitTable();
newTable();
newRow();
displayCharFirstAid("alt".$i."aid", $row['aid'], 1);
displayProfMenu("alt".$i."prof1", $row['prof1'], 1);
displayProfMenu("alt".$i."prof2", $row['prof2'], 1);
exitRow();
exitTable();
displayArmory("alt".$i."gear", $row['gear'], 1);
displayBuild("alt".$i."build", $row, 1);
displayResist("alt".$i."resist", $row['resist'], $row['resistances'], 1);
displayCustom($row, 1);
if($i < count($CharData) - 2)
hSpace();
$i++;
}
return 1;
}
function getKeys($KeyData)
{
$first = 2;
foreach($KeyData as $type)
if($type['type']['show'] == 1)
{
if($first == 2)
{
newTable();
hDivider("Keys");
exitTable();
$first = 1;
}
if($first != 1)
{
hSpace();
$first = 1;
}
displayKeyType($type['type']);
displayKeys($type['keys']);
$first = 0;
}
if($first == 0)
return 1;
else
return 0;
}
function getTextBoxes($TextBoxData)
{
$show = 0;
foreach($TextBoxData as $row)
$show += $row['show'];
if($show == 0)
return 0;
newTable();
hDivider("Additional Information");
exitTable();
foreach($TextBoxData as $box)
{
displayTextBox($box['name'], $box);
newTable();
newRow(2);
exitRow(2);
exitTable();
}
return 1;
}
function getOther()
{
return 0;
newTable();
//TODO: MAKE THIS DO SOMETHING
exitTable();
}
function displayBuild($ID, $array, $isAlt = 0)
{
if($array['build']['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
newTable("Provide information on your Talent Build");
showTextField($ID, $array['build'], $fontColor);
showText("Point Distribution", $array['build']['missing'], 2);
showTextField($ID."0", $array['build0'], $fontColor, 1, 2, 2, 1);
showText("/ ", $array['build']['missing'], 2, 1);
showTextField($ID."1", $array['build1'], $fontColor, 1, 2, 2, 1);
showText("/ ", $array['build']['missing'], 2, 1);
showTextField($ID."2", $array['build2'], $fontColor, 1, 2, 2, 1);
exitTable();
}
}
function displayResist($ID, $title, $array, $isAlt = 0)
{
if($title['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
newTable($title['value']);
foreach($array as $row)
{
$row['required'] = $title['required'];
showText($row['value'], $row['missing'], 2);
showTextField($ID.$row['name'], $row, $fontColor, 1, 2, 3, 1);
}
exitTable();
}
}
function displayTextBox($ID, $array)
{
if($array['show'] == 1)
{
newTable();
showTextBox($ID, $array);
exitTable();
}
}
function displayUsername($array)
{
if($array['show'] == 1)
showTextField($array['name'], $array);
}
function displayUserEmail($array)
{
if($array['show'] == 1)
showTextField($array['name'], $array);
}
function displayUserAge($array)
{
if($array['show'] == 1)
showOptions($array['name'], "age", $array['text'], $array);
}
function displayUserTime($array)
{
if($array['show'] == 1)
showOptions($array['name'], "time", $array['text'], $array);
}
function displayUserPlay($array)
{
if($array['show'] == 1)
showOptions($array['name'], "play", $array['text'], $array);
}
function displayCharFirstAid($ID, $array, $isAlt = 0)
{
if($array['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
showTextField($ID, $array, $fontColor, "", $size = 3, 3);
}
}
function displayCustom($array)
{
$i = 0;
foreach($array as $row) //Check for custom fields and output
if(strtolower(substr($row['name'], 4, 4)) == "cust" && $row['show'] == 1)
{
newTable();
newRow();
showLgTextField($row['name'], $row);
exitRow();
exitTable();
}
}
function displayKeyType($array)
{
if($array['show'])
{
newTable();
newRow();
// echo "<td align = \"center\" height=\"25\" bgcolor=\"#333333\">";
echo "<td align = \"center\" height=\"25\"><strong>";
showText($array['value'], $array['missing'], 3, 1);
echo "</strong>";
exitRow();
exitTable();
}
}
function displayKeys($array)
{
newTable();
newRow();
$LineLength = 0;
foreach($array as $key)
{
if($key['show'])
{
$CurrLength = ceil(strlen($key['value']) * 10);
$LineLength += $CurrLength;
if($LineLength > 550)
{
exitRow();
exitTable();
newTable();
newRow();
}
showCheckBox($key['name'], $key);
}
}
exitRow();
exitTable();
}
function displayCharName($ID, $array, $isAlt = 0)
{
if($array['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
showTextField($ID, $array, $fontColor, "", 35);
}
}
function displayClassMenu($ID, $array, $isAlt = 0)
{
if($array['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
showOptions($ID, "class", $array['text'], $array, $fontColor);
}
}
function displayProfMenu($ID, $array, $isAlt = 0)
{
if($array['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
showOptions($ID, "prof", $array['text'], $array, $fontColor);
}
}
function displayCharLevel($ID, $array, $isAlt = 0)
{
if($array['show'] == 1)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
showTextField($ID, $array, $fontColor, "", $size = 2, 2);
}
}
function displayArmory($ID, $array, $isAlt = 0)
{
if($isAlt == 1)
$fontColor = "#FFFF00";
else
$fontColor = "#FF0000";
if($array['show'])
{
gimmeData($GearData, "geardata");
if($GearData['geartype']['value'] == "link")
{
showArmoryText($GearData['gearlink']['value'], $GearData['geartitle']['value'], $array);
newTable();
newRow();
showTextField($ID, $array, $fontColor, 0, 90, "", 1);
exitRow();
exitTable();
}
else
{
$tempArray = array('value' => $GearData['geartitle']['value'], 'missing' => $array['missing'], 'text' => $array['text']);
showTextBox($ID, $tempArray);
}
}
}
function showArray($array)
{
newTable();
newRow();
echo print_r($array);
exitRow();
exitTable();
}
function showRequired($isAlt = 0) //Outputs the description of the *
{
newTable();
newRow(2);
if($isAlt == 1)
echo "<div align=\"center\"><font color=\"#FFF000\">*</font> Required if Name entered</p></div>\n";
else
echo "<div align=\"center\"><font color=\"#FF0000\">*</font> Required Items</p></div>\n";
exitRow(2);
exitTable();
}
function showCheckBox($ID, $array)
{
showText($array['value'], $array['missing'], 2, 1);
if($array['required'] == 1)
echo "<font color=\"#FF0000\">*</font>";
echo "<input id=\"".$ID."_text\" type=\"checkbox\" name=\"".$ID."_text\"";
if ($array['text'] == "on")
echo "checked";
echo "></td>\n";
}
function showTextBox($ID, $array)//Displays a multi-line text box
{
newRow();
showText($array['value'], $array['missing'], 2, 1, "center");
if($array['required'] == 1)
echo "<font color=\"#FF0000\">*</font>";
exitRow(2);
newRow(2);
echo " <textarea id=\"".$ID."_text\" name=\"".$ID."_text\" rows=\"15\" cols=\"99\" >{$array['text']}</textarea>\n";
exitRow(2);
}
function showSubmit() //
{
newTable();
newRow(1);
echo " <td align=\"center\">";
echo " <input id=\"Submit_value\" name=\"Submit_value\" type=\"SUBMIT\" value=\"Submit\"> \n";
echo " <input id=\"Reset\" name=\"Reset\" type=\"RESET\" value=\"Reset Form\">\n";
exitRow(2);
exitTable();
}
function showOptions($ID, $type = "", $selected, $array = "", $requireColor = "FF0000")
{
if($array != "")
showText($array['value'], $array['missing']);
echo "<td>\n<select id=\"".$ID."_text\" name=\"".$ID."_text\">\n";
switch(strtolower($type))
{
case "age":
echo " <option value=\"\">Age</option>\n";
echo " <option value=\"1\""; if($selected == 1) echo " selected=\"selected\""; echo ">Under 16</option>\n";
echo " <option value=\"2\""; if($selected == 2) echo " selected=\"selected\""; echo ">16-20</option>\n";
echo " <option value=\"3\""; if($selected == 3) echo " selected=\"selected\""; echo ">21-30</option>\n";
echo " <option value=\"4\""; if($selected == 4) echo " selected=\"selected\""; echo ">Over 30</option>\n";
break;
case "class":
echo " <option value=\"\">Class</option>\n";
echo " <option value=\"1\""; if($selected == 1) echo " selected=\"selected\""; echo ">Warrior</option>\n";
echo " <option value=\"2\""; if($selected == 2) echo " selected=\"selected\""; echo ">Hunter</option>\n";
echo " <option value=\"3\""; if($selected == 3) echo " selected=\"selected\""; echo ">Rogue</option>\n";
echo " <option value=\"4\""; if($selected == 4) echo " selected=\"selected\""; echo ">Priest</option>\n";
echo " <option value=\"5\""; if($selected == 5) echo " selected=\"selected\""; echo ">Shaman</option>\n";
echo " <option value=\"6\""; if($selected == 6) echo " selected=\"selected\""; echo ">Druid</option>\n";
echo " <option value=\"7\""; if($selected == 7) echo " selected=\"selected\""; echo ">Mage</option>\n";
echo " <option value=\"8\""; if($selected == 8) echo " selected=\"selected\""; echo ">Warlock</option>\n";
echo " <option value=\"9\""; if($selected == 9) echo " selected=\"selected\""; echo ">Paladin</option>\n";
break;
case "time":
echo " <option value=\"\">Timezone</option>\n";
echo " <option value=\"1\""; if($selected == 1) echo " selected=\"selected\""; echo ">Eastern</option>\n";
echo " <option value=\"2\""; if($selected == 2) echo " selected=\"selected\""; echo ">Central</option>\n";
echo " <option value=\"3\""; if($selected == 3) echo " selected=\"selected\""; echo ">Mountain</option>\n";
echo " <option value=\"4\""; if($selected == 4) echo " selected=\"selected\""; echo ">Pacific</option>\n";
echo " <option value=\"5\""; if($selected == 5) echo " selected=\"selected\""; echo ">Other</option>\n";
break;
case "play":
echo " <option value=\"\">PlayStyle\n";
echo " <option value=\"1\""; if($selected == 1) echo " selected=\"selected\""; echo ">1(casual)</option>\n";
echo " <option value=\"2\""; if($selected == 2) echo " selected=\"selected\""; echo ">2</option>\n";
echo " <option value=\"3\""; if($selected == 3) echo " selected=\"selected\""; echo ">3</option>\n";
echo " <option value=\"4\""; if($selected == 4) echo " selected=\"selected\""; echo ">4</option>\n";
echo " <option value=\"5\""; if($selected == 5) echo " selected=\"selected\""; echo ">5</option>\n";
echo " <option value=\"6\""; if($selected == 6) echo " selected=\"selected\""; echo ">6</option>\n";
echo " <option value=\"7\""; if($selected == 7) echo " selected=\"selected\""; echo ">7</option>\n";
echo " <option value=\"8\""; if($selected == 8) echo " selected=\"selected\""; echo ">8</option>\n";
echo " <option value=\"9\""; if($selected == 9) echo " selected=\"selected\""; echo ">9</option>\n";
echo " <option value=\"10\""; if($selected == 10) echo " selected=\"selected\""; echo ">10(hardcore)</option>\n";
break;
case "prof":
echo "<option value=\"\">Profession</option>\n";
echo "<option value=\"1\""; if($selected == 1) echo " selected=\"selected\""; echo ">Alchemy</option>\n";
echo "<option value=\"2\""; if($selected == 2) echo " selected=\"selected\""; echo ">Blacksmithing</option>\n";
echo "<option value=\"3\""; if($selected == 3) echo " selected=\"selected\""; echo ">Enchanting</option>\n";
echo "<option value=\"4\""; if($selected == 4) echo " selected=\"selected\""; echo ">Engineering</option>\n";
echo "<option value=\"5\""; if($selected == 5) echo " selected=\"selected\""; echo ">Herbalism</option>\n";
echo "<option value=\"6\""; if($selected == 6) echo " selected=\"selected\""; echo ">Leatherworking</option>\n";
echo "<option value=\"7\""; if($selected == 7) echo " selected=\"selected\""; echo ">Mining</option>\n";
echo "<option value=\"8\""; if($selected == 8) echo " selected=\"selected\""; echo ">Skinning</option>\n";
echo "<option value=\"9\""; if($selected == 9) echo " selected=\"selected\""; echo ">Tailoring</option>\n";
echo "<option value=\"10\""; if($selected == 10) echo " selected=\"selected\""; echo ">Jewel Crafting</option>\n";
break;
}
echo "</select>";
if($array != "" && $array['required'] == 1)
echo "<font color=\"$requireColor\">*</font>\n";
echo "</td>\n";
}
function showArmoryText($url, $title, $array)
{
newTable();
newRow();
showText("Provide a link to your profile on ", $array['missing'], 2, 1, "center");
echo "<a href=\"#\" onClick=window.open(\"$url\",\"\")>$title</a>";
showText("", $array['missing'], 1);
exitRow();
exitTable();
}
function showText($text, $missing = 0, $noTags = 0, $noColon = 0, $align = "right")
{
if($noColon == 0)
$text = $text.":";
if($noTags != 1 && $noTags != 3)
echo "<td align=\"$align\">";
if($missing == 1)
echo "<font color=\"#FF0000\">$text</font>";
else
echo $text;
if($noTags != 2 && $noTags != 3)
echo "</td>\n";
}
function showTextField($ID, $array, $requiredColor = "#FF0000", $noTags = 0, $size = 28, $maxLength = "", $noText = 0)
{
if($noText == 0)
showText($array['value'], $array['missing']);
if($noTags != 1 && $noTags != 3)
if($noText == 0)
echo "<td align=\"left\">";
else
echo "<td align=\"center\">";
echo "<input type=\"text\" id=\"".$ID."_text\" name=\"".$ID."_text\" value=\"{$array['text']}\" size=\"$size\" maxlength=\"$maxLength\">";
if($array['required'] == 1)
echo "<font color=\"$requiredColor\">*</font>";
if($noTags != 2 && $noTags != 3)
echo "</td>\n";
}
function showLgTextField($ID, $array)//Displays a line of text with a single-line input box below it
{
newRow();
echo " <td width=\"150\">{$array['value']}</td>\n";
if($array['required'] == 1)
$size == 68;
else
$size == 70;
echo "<td width=\"400\"><input type=\"text\" id=\"".$ID."_text\" name=\"".$ID."_text\" value=\"{$array['text']}\" size=\"$size\" />";
if($array['required'] == 1)
echo "<font color=\"$requiredColor\">*</font>";
exitRow(2);
}
function exitRow($tags = 1)
{
if($tags == 1)
echo "</tr>\n";
elseif($tags == 2)
echo "</td>\n</tr>\n";
}
function newRow($tags = 1)
{
if($tags == 1)
echo "<tr>\n";
elseif($tags == 2)
echo "<tr>\n<td>\n";
}
function newTable($title = "", $width = 550)
{
if($title != "")
echo "<center><font class=\"option\"><b>$title</b></font></center>\n";
echo "<table align=\"center\" width=\"$width\" border=\"0\" cellpadding=\"0\">\n";
}
function exitTable()
{
echo "</table>\n";
}
function hDivider($text, $size = 0)
{
echo "<tr><td height=\"20\"></td></tr>\n";
echo "<tr>\n";
echo " <td colspan=\"4\"><table border=\"0\" cellpading=\"0\">\n";
echo " <tr>\n";
echo " <td width=\"100\"></td><td width=\"350\"><hr></td><td />\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td colspan=\"3\" width=\"550\"><center>";
if($size == 0)
echo "<strong>$text</strong>";
else
echo "<h1>$text</h1>";
echo "</center></td><td />\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td width=\"100\"></td><td width=\"350\"><hr></td>\n";
echo " </tr>\n";
echo " </table></td>\n";
echo "</tr>\n";
}
function hSpace()
{
newTable();
newRow();
echo "<td height=\"10\" width=\"250\"></td><td height=\"10\" width=\"50\"><hr></td><td height=\"10\" width=\"250\"></td>";
exitRow();
exitTable();
}
?>
|