I'm working with a closed community site (PHP-based) of about 100 users, and one of the features we've implemented is an ajax shoutbox that works as a "chatroom" on the site frontpage when users logged in. The dev team is using a private irc server for collaboration, and in one channel we're running a quizbot. We came up with the idea to try and make a web interface for connecting to irc through our site, so all the (non-tech-savvy) users of our site can participate in our irc quizzes.
Now, I'm no IRC expert, but I've looked into a few PHP-IRC tutorials, and it seems to me that in order to connect to IRC, PHP needs to maintain an open connection.. which means that we need to do a comet-style trick and let the PHP script execute without timing out. However, this means that if the user navigates away from the page or closes the tab, we loose control of that php execution. We could probably figure out a way to stop the connection if this happens, but even so the user would have to reconnect to irc if he navigates back to the chatroom.
What we want to achieve is a way for users to be perpetually connected to the irc server, even if they aren't logged in to the site. The dev team all have shell accounts on one of our servers, and we use screen and irssi to stay connected. I figure it should be somehow possible to have a php script connect to irc through a shell account that is always connected to irc. Because of our limited number of users, it isn't a problem to set up shell accoutns for all of them, but I haven't yet figured out the missing link - a command-line irc client that allows php access in some way.
Anyone have any suggestions?