Version: , by pets.ca
Developer Last Online: Apr 2014
Version: Unknown
Rating:
Released: 03-07-2005
Last Update: Never
Installs: 0
No support by the author.
Hi there,
I require the ability to keep a log of all chat activity on my board. I plan to have a single chat room only. Is there a way to dump all activity (time/date stamped) to a text file?
thanks
dave
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Is it possible to make some modifications to this to allowing viewing logs for the created rooms as well? Perhaps a menu to "view Logs for X room"?
If there is need I could modify the code for you, to show logs per room. It works as it is for me, my board's chat is not that much used, so the users are pretty happy with the Main Room only.
As it is now, the log shows all messages, from all rooms.
Displaying for specific rooms is definetly a need! I use multiple rooms for roleplay plus private discussions outside of the main room!
I don't need logs saved as a text file, though if I could download/save them I'd actually preffer them in a html that also display the fonts/colors.
An also uncessary wish would be to display logs with/without the PMs incase I wanted to quick copy logs to display elsewhere; like a community event, planning, ect without comprimising the privacy of PMs!
The problem is that the various chat rooms are stored in the database as numbers, in a way that does not allow consistency. This is at least my understanding on how things work, maybe Zero can shed some more light on this one. Let's take this example:
Your main room is number 0.
The admin creates a permanent room, this gets number 1.
A user creates another room (temporary), which gets number 2.
In the database, messages are all stored in the same table, with a column indicating which room each message was posted in.
So let's assume there are people in every one of the rooms above and they are discussing. Then the users from room 2 log out and soon after that, the room is deleted. Then, the admin decides that he no longer wants room 1 and he deletes that too. And soon after that another user creates a new temporary room, which now gets number 1. People start posting new messages in this new temporary room. Guess what happens?
Messages from the old permanent room, which had number 1 and messages from the new temporary room 1, get mixed up and if you ask for the log, they will show together. This is a byproduct of how the program handles rooms and messages. In order to have proper logs per chat room, the chatrooms should have a unique index, as they are created, which never gets given to another chatroom. And every message stored in the database would be characterized by that index, so that at any time, you can ask for the log of that room, and the program would get the messages, based on that index.
As you understand, this would require a lot of changes in the existing code, and the only one responsible for deciding if this should be done or not, is ZT.
As for logs not showing the Personal Messages, that's easy to do, you just change the query which generates the log, from this:
PHP Code:
$Get_Chat_MSG = $DB_site->query("select m.*,u.*,t.username AS tusername, t.userid AS tuserid from ".TABLE_PREFIX."{$file} m
left join ".TABLE_PREFIX."user u on (u.userid = m.s_postby)
left join ".TABLE_PREFIX."user t on (t.userid = m.s_foruser)
order by m.s_postime DESC LIMIT $startat, $perpage");
to something like this:
PHP Code:
$Get_Chat_MSG = $DB_site->query("select m.*,u.*,t.username AS tusername, t.userid AS tuserid from ".TABLE_PREFIX."{$file} m
left join ".TABLE_PREFIX."user u on (u.userid = m.s_postby)
left join ".TABLE_PREFIX."user t on (t.userid = m.s_foruser)
where s_foruser='0' order by m.s_postime DESC LIMIT $startat, $perpage");
That will give you a reverse-sorted (newer messages first) log, containing only the messages which were public (to all users).