Nice hack! The TCL works great. We added a timer as well and the updates work great, thanks.
We do however have webspace on the same server we run our eggdrop bot and were able to avoid using the FTP method. The eggdrop bot server and the Forums Server are different locations though and we get to the file created by the eggdrop's userschatting.TCL script like this...
The TCL script is in /home/username/eggdrop/scripts
The web space is at /var/www/html/
We created /var/www/html/ircstats
then we linked to /home/username/eggdrop/scripts/userlist.txt
To link the files in linux(we did it as root)...
link /home/username/eggdrop/scripts/userlist.txt /var/www/html/ircstats/userlist.txt
The second file is created by the link command and should not exist.
Now whenever the bot updates the main file, the linked file will reflect the changes to be accessable to the web via HTTP.
This is the code we used in the index.php file to fetch the userslist.txt when a user accesses index.php, the forumhome.
PHP Code:
// Begin Joey irc hack ############################################################
$openfile = @fopen ("http://your.server.com/ircstats/userlist.txt", "r");
if ($openfile ) {
while (!feof($openfile)) {
$buffer .= fgets($openfile, 4096);
}
$chatterson = str_replace("%20", ", ", $buffer);
fclose($openfile);
}
else {
$chatterson = "<center>Sorry, Statistis are offline, please logon for more information.
<br>Server: support.irclive.com | Port: 6667 | Channel: #vbcustom</center>";
}
// END Joey irc hack ##################################################################
Hope it helps someone.