This seems to work fine, obviously this is just an output, and can be modified like crazy, can add more info to it, etc. Its fairly easy to tweak once its setup. Enjoy!
Code: Select all
<?php
//use 127.0.0.1 if hosted on same server as ffxi server
//for databasename, by default if you followed instructions, is dspdb
mysql_connect("yourdatabaseip", "dbusername", "dbpassword") or die(mysql_error());
mysql_select_db("databasename") or die(mysql_error());
$query = "SELECT chars.charid, chars.charname, accounts_sessions.charid, zone_settings.zoneid, zone_settings.name, chars.pos_zone FROM accounts_sessions, chars, zone_settings WHERE accounts_sessions.charid = chars.charid AND zone_settings.zoneid = chars.pos_zone";
$result = mysql_query($query) or die(mysql_error());
// Print out the contents of each row into a table
while($row = mysql_fetch_array($result)){
echo $row['charname']. " - ". $row['name'];
echo "<br />";
}
?>
Code: Select all
<?php
mysql_connect("SERVERIP", "SQLUSER", "SQLPASS") or die(mysql_error());
mysql_select_db("DATABASENAME") or die(mysql_error());
$query = "SELECT * FROM audit_chat";
$result = mysql_query($query) or die(mysql_error());
// Print out the contents of each row into a table
while($row = mysql_fetch_array($result)){
echo $row['datetime'] . " : " . $row['speaker']. " - ". $row['message'] ." - (" . $row['type'] .")";
echo "<br />";
}
?>
http://bnet.cc/ffxi/index.php -- Users Online
http://bnet.cc/ffxi/chat.php -- Chat (Audits only Yell/Shouts for now, manually modified the rest to not display here as I was worried about ballooning the database. Could easily add a script to this to go into the database and delete anything older than say.. 5 days? But thats future.
Best Regards,
Tagban