Hello Leatherback and thanks for looking at my issue.
I did manage to affect a resolve which works as a temporary fix, but I'm still searching for a final fix which I'm sure you know how that goes.
I'm not exactly sure what you mean when you ask 'what is the value for 'none'?'. At the moment, players select 'none' from a drop down menu so the 'value' passed is 'none' The drop down is built based on other available characters so it's an ever changing list, with the only constant being the word 'none' which is the first selection in the drop down.
And I'm sure that your right in that I need to fix some stuff, what exactly I'm not sure as I'm just guessing a lot of the time, and if it works i leave it alone until I understand why I should tinker with it further. I don't want to break it if it works - 'Work' being defined as 'Getting the result I was looking for'.
Could you elaborate on how i need to fix the table tags? What's wrong with them and why? Any explanations is appreciated and gets you a free ride on any Willy Wonka themed ride in coder's heaven I promise (I don't know if thats true but I promise if it is your getting the tickets - and you can even have mine! 😉 )
I did try to 'parse out' my code before posting it so it'd be more presentable. I don't really understand the exact when to when not to tab/indent and or why. It's still confusing me, but I am trying to improve! Any help is always always appreciated.
THANKS - CHEZ
P.S. That wasn't the entire code for the page. I posted the entire code once on another site and some person flamed me for doing so so I thought i wasn't to do that as it made people mad.
And i can't post the code as it's more then 10,000 characters long which is the limit for this sites posts as i just found out when trying to post it.
But here is the fix i affected - I dropped out some if statements which seems to work, but requires that an advisor be selected if a mentor is to be selected and if a tutor is to be selected, then a mentor and an advisor must also be selected. I'm trying to figure out how to have it display if a mentor or a tutor is selected but no advisor is selected, that the tutor or mentor will show.
<?php
if ($gradeLevels)
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Education/Degree:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $gradeLevels[$educationDB] . "</p></td></tr>\n";
}
if ($room) { echo "<tr><td align=\"right\" valign=\"top\"><p><b>Room Assignment:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>";
$roomNumber = preg_replace("/^(GD|BD)(\d\d\d).+/i","$1$2",$room);
$roomExtra = preg_replace("/^(GD|BD)(\d\d\d)/i","",$room);
if (preg_match("/^GD/",$roomNumber))
{
echo "<a href=\"javascript:openimage('/institute/floorplan.php?floor=2&dorm=girls',800,625,true)\" title=\"Click for an interactive floor plan of the mansion\" onmouseover=\"window.status='Click for an interactive floor plan of the mansion'\">$roomNumber</a>";
} else {
echo "<a href=\"javascript:openimage('/institute/floorplan.php?floor=2&dorm=boys',800,625,true)\" title=\"Click for an interactive floor plan of the mansion\" onmouseover=\"window.status='Click for an interactive floor plan of the mansion'\">$roomNumber</a>";
} // end if boys
if ($roomExtra)
{
echo linkChars($roomExtra);
} // end if extra text
echo "</p></td></tr>\n";
} // end if room
if ($schoolclubs)
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>School Clubs:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . implode(", ", explode("^",$schoolclubs)) . "</p></td></tr>\n";
} // end if clubs
if ($squadronNames)
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Training Squadron:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $squadronNames[$squadronDB] . "</p></td></tr>\n";
}
if ($advisor)
{
echo "<!-- Advisor: $advisor -->\n";
$advisorName = getChar($advisor);
if ($advisorName != "Storyteller")
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Faculty Advisor:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p><a href='display.php?id=$advisor' title='Get info on character: $advisorName'>$advisorName</a></p></td></tr>\n";
}
echo "<!-- Mentor: $mentor -->\n";
$mentorName = getChar($mentor);
if ($mentorName != "Storyteller")
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Student Mentor:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p><a href='display.php?id=$mentor' title='Get info on Student Mentor: $mentorName'>$mentorName</a></p></td></tr>\n";
}
echo "<!-- Tutor: $tutor -->\n";
$tutorName = getChar($tutor);
if ($tutorName != "Storyteller")
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Assigned Tutor:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p><a href='display.php?id=$tutor' title='Get info on Student Tutor: $tutorName'>$tutorName</a></p></td></tr>\n";
}
} // end if advisor
$testy = mysql_query("SELECT id,codename from cerebra WHERE advisor = $id AND approved=\"true\" AND type=\"student\" AND player > 0");
if (mysql_num_rows($testy))
{
echo "<tr><td align=\"right\" valign=\"top\"><p><b>Advisor for:</b></p></td>\n";
$studentArray = array();
WHILE ($advisee = mysql_fetch_assoc($testy))
{
array_push($studentArray, "<a href='display.php?id=" . $advisee["id"] . "' title='Get info on character: " . $advisee["codename"] . "'>" . $advisee["codename"] . "</a>");
} // end WHILE
$studentString = implode(", ", $studentArray);
echo "<td width=\"10\"> </td><td valign=\"top\"><p>$studentString</p></td></tr>\n";
} // end if advisor to students
echo "</table>";
} // end if a resident at the institute
?>