Got a request from guild members to be able to have the guild roster on web portal and connected members as well.
This is really just a simple SQL query and an HTML table is generated.
The whole is then published as a part of a Drupal content.
Thought that might be helpful for some of you.
Example:
http://manants.hyboria.info/membres-des-manantsThis is all in french and would need some translation. Please note that if you wish to use the original names, you might want to edit the query to remove the translation part.
<?php
//Connexion à la base de donnée
mysql_connect("localhost", "user", "password") or die (mysql_error());
mysql_select_db("bot_database") or die (mysql_error());
//Récupération des données
$botdata = mysql_query("SELECT whois.nickname, class_translation.French, whois.level, alts.main, whois.online
FROM whois
INNER JOIN class_translation ON whois.class = class_translation.English
LEFT JOIN alts ON whois.nickname = alts.alt
INNER JOIN bot_users ON whois.nickname = bot_users.nickname
WHERE bot_users.deleted_by IS NULL
ORDER BY whois.online DESC , whois.nickname") or die (mysql_error());
//Création de la table
print'<table border="0" cellpadding="2" width="550" valign="center">
<tr>
<td width="150">Nom</td>
<td width="150">Classe</td>
<td width="30">Niveau</td>
<td width="130">Alt de</td>
<td width="90" align="center">En jeu</td>
</tr>';
while($botinfo = mysql_fetch_array($botdata))
{
print'
<tr>
<td>'.$botinfo['nickname'].'</td>
<td>'.$botinfo['French'].'</td>
<td>'.$botinfo['level'].'</td>
<td>'.$botinfo['main'].'</td>
<td><img src="http://manants.hyboria.info/~bot/'.$botinfo['online'].'.png"</td>
</tr>';
}
print'</table>';
?>