I'm building an online support site, and I was wondering how I could make individual conversations into nodes...

I need these nodes to have a lot of hidden cck values, which I also need updated on-the-fly during the instant conversations...

Basicly, this is going to get complicated, is there anyone who knows a module that allows ajax "Actions" from button presses so that I can change cck values from them while turning a node into an IM data structure?

Comments

Raf’s picture

It might be interesting to know what exactly you're trying to do. Who knows, maybe you're making things needlessly complicated? At any rate, it's quite hard to understand what you're trying to do, based on this explanation.

jnvsor’s picture

I'm going to try and make a chatroulette/stack overflow: This way people can get live help (Beats yahoo answers) but without video and with community moderation it will run itsself...

I need taxonomy so people who specialize can answer only questions related to this, I need the chat to be logged in a data structure so the timestamps and text are logged, along with timestamps of reports, forwards, leaves, holds etc...

So how would I go about logging and attaching chat actions to nodes?

Raf’s picture

I guess you're already familiar with Ajax. Otherwise, you better work on that first. That said, I think it's easiest to either write the chat changes to the database (Typically {node} and {node_revisions}), or to a temporary cache (global var, session var, text file) and writing the cache to the database once in a while.

The first way (writing everything directly to the database) will be very strainful for your server, but will ensure that everything'll be stored.
The second way (with the caches), will be less strainful, since it's only once in a while (although with a text-file, it still has to open the file, save it, then close it), but if the chat stops before the last changes're written to database, they'll be lost (unless you solve that in your code somehow)

I guess the best way to start is to first look at what IM modules're here, and what they got to offer, since it's definitely not an easy thing you're trying to do, both code-wise and performance-wise.

jnvsor’s picture

How about if I write the chat changes to a seperate database entirely, and have the node look that database up when its being shown?

So that the chat server and web server are on seperate machines?

Raf’s picture

That'd still have the same issue, really. The problem will start when you got plenty of people visiting. If it's 5 people, each half an hour a day, then it's nothing to worry about. If it's a couple of thousand people, constantly, you'll have a couple of thousand database connection requests (and queries) every second to run. That itself'll be very strainful. On top of that, you'll have a high chance of storing or retrieving faulty data (like someone gets data from the database while someone else is writing to that same record). I believe Drupal keeps these things in mind, but even so, it's best not to lose sight of such problems when starting a project like this.

That're the performance issues I'm talking about. Getting a dedicated server just for the chat database will improve things, but it won't solve the underlying issue: performance optimalization.

jnvsor’s picture

So I should only store the logs of conversations that were reported? That way the client machines would have the data...

Unfortunately, that would mean people wouldn't get notes that similar questions were asked, and it would be harder to permaban spammers (Though I guess I could add a line or 2 to the thing that automatically records anyone on a watchlist...)

Raf’s picture

For spammers, you can use either the following:

A) Reporting
B) Flood control

The main problem with spammers is that they're not necessarily bots. They can just as well be stupid little jerks. If it's the latter, you can't really catch it programmatically. You'll have to have people report them. Flood control will help against bots and those that spam with "." per line or so.

The similar questions would still be really difficult when you're storing the entire conversation. You'd have to let your code interprete it and figure out what it's about.

Both these things're solved easily with something you explained earlier: There'll be staff on the other end of the chat, answering questions. The person they get at the other end'll be depending on the taxonomy the visitor chose.

So, in other words, you can already figure some things out from the taxonomy they chose and can already narrow the similar questions down with that. If you let that expert on the other end enter some extra info (more taxonomy, but more granular), you'll have everything you need to compare those questions.

The staff you have'll also be best suited for reporting spammers.

jnvsor’s picture

Seeing as it runs like stackoverflow (Open control, similar to wikipedia) there wouldn't be any "Staff" - but the community could vote on things that have been reported...

I think this will have to do it...

Thanks for the help...

Edit: Ok, new problem: The name phpfreechat is entirely misleading (In fact I'm pretty sure they are breaking the GPL) - I can't remove a large linkback without paying them...

Anyway, Anyone know any good chat windows that could be made 1 on 1 without giving people control over who they are talking to (That will be handled on a lower level)