You are still hitting the database for each board, which is kinda expensive. How about doing it like this:
// --------------------------------------------------------------------
// Get all the moderators and store them in a hash
//
$query = "SELECT Mod_Board, Mod_Username
FROM w3t_Moderators
";
$moderators = $dbh -> do_query($query);
// ----------------------------
// Cycle through the moderators
while ( $row = $dbh -> fetch_array($moderators)) {
$ModBoard = $row[0];
$ModUserName = $row[1];
$moderatorHash[$ModBoard][$ModUserName] = true;
}
//-- Then, down below, in the big for while (before the "This closes out the table we opened for the category:" comment
//----- MODERATOR SECTION -----//
echo "<td width="10%" class="forumtitle">";
if (is_array($moderatorHash[$Keyword]))
{
$i = 0;
foreach ($moderatorHash[$Keyword] as $key => $value) {
$i++;
if ($i > 1){
echo ", ";
}
echo "<A HREF="$config[phpurl]/showprofile.php?User=" . urlencode($key) . "&what=wwwthreads">$key</A>";
}
}
else
{
echo " - ";
}
echo "</tr>";
}
It works really well, prints a "-" if there is no moderator for that forum, and links each moderator to their profile.
I'll post a link to where we are doing this later in the week.
-F