...I had a need for this sort of thing last year and the majority of the regular users in my chat now don't use the java client anymore so there was no accurate way to do it with mysql

- So I just set up an eggdrop bot in the channel and have it running a simple TCL script I wrote that writes out the # of people in the channel to disk every time someone joins (didn't bother to have it do it when someone leaves - but that's easy to add too)
..then set up a crontab to copy the file over to my web directory (since the bot runs as user nobody) and within global.php have:
$fd = fopen ("path/to/file_with_number_in_chat", "r");
$num_in_chat = fgets($fd, 3);
fclose ($fd);
...then just insert $num_in_chat in a template or wherever and I have easy access to it..