Hey guys. So the BBCode issue is still one I need help solving. I have it displaying but not being executed. Second, the PHP I am attempting to put in a direct evaluation page through CMS is below, except I have changed everything from "echo" to $var = or$var.=, then set $output = $var; at the end. This code IS working on the site on a non-VMS page.
PHP Code:
//Get List of Divisions
$sql = "SELECT * FROM " . TABLE_PREFIX . "gamelist ORDER BY gamename ASC";
$result = $db->query_read_slave($sql);
// Start Division/Area List
$areas = ["Administration", "Clan Staff"];
$alist = "'Administration', 'Clan Staff'";
while ($g = mysql_fetch_array($result)) {
$areas[] = $gn = $g[1];
$alist .= ", '$gn'";
}
$areas = ["Games in Progress"];
$alist .= ", 'Games in Progress'";
// Get the Staff Members
$sql = "SELECT * FROM " . TABLE_PREFIX . "staff ORDER BY FIELD(divdept, $alist), position DESC, username DESC";
$result = $db->query_read_slave($sql);
//Begin Output (Hopefully)
echo "<p> Zealot Gaming hosts a variety of leaders in order to help ensure that all aspects of the clan are taken care of and any issues members have may be resolved at any time. For a list of positions, please visit the <a href='index.php/info/clan-structure' target='_self'>structure page</a>.</p>";
// Set basic cell counter
$i = 1;
// Set previous area to nothing damnit.
$prev = "";
//Go through each staff member
while ($u = mysql_fetch_array($result)) {
// Let's set our data.
$userid = $u[0];
$username = $u[1];
$rname = $u[2];
$rank = $u[3];
$area = $u[4];
$facebook = $u[5];
$twitter = $u[6];
$bio = $u[7];
$img = "images/staff/" . strtolower($username) . ".png";
$email = strtolower($username) . "@zealotgaming.com";
// Check for Social Media code.
if (!empty($facebook)) { $facebook = " <a href='$facebook'><img alt=\"$username's Facebook\" src='images/staff/social/facebook.png' /></a>"; }
if (!empty($twitter)) { $twitter = " <a href='$twitter'><img alt=\"$username's Twitter\" src='images/staff/social/twitter.png' /></a>"; }
//Is this a new area?
if ($area != $prev) {
// Yes
// Do we need to close the previous table and add a cell?
if ($i % 2 == 0 && !empty($prev)) {
//Add a cell and close
echo " <td valign='top'> </td>
</tr>
</table>";
} elseif ($i % 2 == 1 && !empty($prev)) {
//Just close the table
echo "</table>";
}
// Reset the column we're in.
$i = 2;
$prev = $area;
//New Area Heading
echo "<h2 class='whiteglow' style='margin-bottom: 10px;'>$area</h2>";
//Start of Table
echo "<table border='0' cellpadding='1' class='zebra' style='width: 100%;'>";
// First column, new row.
echo "<tr>
<td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>";
} else {
//No
// Is this a new row?
if ($i % 2 == 0) {
//No
// Enter the information then close the row
echo " <td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>
</tr>";
//Set our cell counter
$i++;
$prev = $area;
} else {
//No
// Start a new row.
echo "<tr>
<td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>";
//Set our cell counter
$i++;
$prev = $area;
}
}
}
// Do we need to close the previous table and add a cell?
if ($i % 2 == 0 ) {
//Add a cell and close
echo " <td valign='top'> </td>
</tr>
</table>";
} else {
//Just close the table
echo "</table>";
}