Glad to hear back.
I have spent the afternoon coding more, and now I have completed a solid version of the chat with online user lists.
Features:
1. There is an external function that can be called anywhere:
getchatusers($mode)
$mode=0-> number of users; $mode=1-> array of active usernames
2. The same ajax call is used (we think alike, it appears), and one div on top of the other is used to display the active users then the chat itself. This required a bit of modification in the styles of the divs, but seems to work now.
It would be a good idea, perhaps, to move it to a side div in the future. That might look nicer, but it works for now.
3. When a user enters the chat, they are logged in.
4. Messages are only displayed if sent after initial login time.
5. When a user does the "get" action, their activity is updated.
6. When any user does the "get" action, inactive users are pruned (time()-60).
Regarding languages, I'm not sure how this would best be implemented in a "simple" way. SMF uses a very opaque system of translation: each phrase is given a number (sometimes an abbreviation?), but not in any clear way. I suppose you could try to integrate with their system, but I find it annoying to work with. My system works outside of that (for everything on the site except the board, though integrated with its language setting), and is a little more straightforward to use, I think.
The way they handle translation is to have a user who knows SMF well translate the entire board using some sort of (hidden) language admin system at the SMF site.
For my purposes, I need something more direct.
To explain my purpose, my website is going to be an all-encompassing language learning website. It will be designed to be "flat" in the sense that users can access anything at any time, rather than having incremental "courses" where most learners don't need at least half of the material. (For example, some can skip grammar, some can skip vocab, some can skip to halfway through the material, and some need everything from the start). It'll have a forum, chat, user system (extracted from smf), and then another half of the site that has resources, tools, vocab lists, etc.
Because of this, having full language support is crucial (so users of any language can access the site in their language, or to practice using websites in a target language).
Anyway, enough about that--
I am happy now with the chat, though the code is quite messy (yours + my haphazard additions/changes), and it would be smoother to extract all the styling into CSS if possible.
I agree with you about working with SMF's admin system. That seems difficult. Really, though, I don't think many more "admin" features are needed. Clearing the chat and deleting individual messages is plenty. The only other thing that people may want to have control over is whether guests can view/participate in the chat.
I just disabled it entirely (and it would be somewhat difficult to get that code back in there).
If you'd like to talk by IM it might be a bit faster, but for now go ahead and take a look at the site here:
http://lingkit.com/chatYou will need to register an account to get access to the chat.
To look at*:
--/chat, obviously
--note the links in the top bar-- chat(#) displays the current number of users in the chat. I'm not sure I'll keep this, but it's available and easy to place anywhere by just calling the function.
--Change the language by dropping down the "English US" menu to something else. I don't have any translations up right now, so I'll put together a rough Italian translation and you can see that. Note that the actual messages are translated for the user viewing the chat AFTER they are retrieved from the database-- they are stored in the DB as "untranslated" with variable strings in them.
(*if you go to other links on the site, many will be broken. The framework for everything is there, but many things are not up.)
Moving forward:
1. I'll gladly send you my code, though as I said it's messy.
2. I'd be happy to help you expand, some, but I want to limit my time because this site is taking up all the time I have right now. If you have trouble reading my code, though, of course I'll explain it. I can comment it also.
3. My purpose with this was direct: get it working in a single environment (my site), so I hope that's a good starting point. It may take a good bit of work to expand this to a "portable" and "plugable" system for everyone.
4. Regardless of anything, though, this proves the code is a good base.
5. I haven't changed the Javascript at all and I think that's solid-- that's why I like this chat (the no flicker thing, its general reliability, etc).
6. An eventual goal with this should be to clean up all the code and make a few things customizable (ex. guests). And then get all of the styling out and into a .css file. Making an extra .css file fit into the smf system might be difficult.
As for credit, etc., sure, if you'd like, but I'm more than happy to just share what I've done to help you improve the chat-- return the favor for sharing your work in the first place.
Note: my approach to using SMF is to disable code I don't want and find a way to get some minimal other things working. I wouldn't consider myself an expert on integration/expansion of the board, just that I know where most stuff is / what it does, and where to start if I have to fix something.