Raised This Month: $51 Target: $400
 12% 

ChatLog v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Nephyrin
SourceMod Donor
Join Date: Mar 2008
Plugin ID:
734
Plugin Version:
1.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Logs all chat occurring in your server(s) to a database. Multi-server friendly. Comes with a small PHP web UI to demonstrate using the database.
    Unapprover:
    Reason for Unapproving:
    Because it's Neph.
    Old 01-23-2009 , 15:17   ChatLog v1.2
    Reply With Quote #1

    Update: Muukis has made an improved version of this plugin with some encoding fixes available here: http://forums.alliedmods.net/showthread.php?t=91331
    This version is obsolete


    Summary

    Logs all chat occurring in your server(s) to a database. Based on a script bl4nk put together for #hlserveradmins on GameSurge. Multi-server friendly. Comes with a small PHP web UI to demonstrate using the database.

    Installation
    This plugin creates a 'chatlogs' table automatically if it doesn't exist, so simply make sure you have a sql database setup in databases.cfg, install the plugin, and set a unique sm_chatlog_id for each server.

    Table Structure
    Code:
    +---------+------------------+------+-----+-------------------+----------------+
    | Field   | Type             | Null | Key | Default           | Extra          |
    +---------+------------------+------+-----+-------------------+----------------+
    | seqid   | int(10) unsigned | NO   | PRI | NULL              | auto_increment | 
    | srvid   | varchar(255)     | NO   | MUL | NULL              |                | 
    | date    | timestamp        | NO   |     | CURRENT_TIMESTAMP |                | 
    | name    | varchar(32)      | NO   |     | NULL              |                | 
    | steamid | varchar(32)      | NO   | MUL | NULL              |                | 
    | text    | varchar(192)     | NO   |     | NULL              |                | 
    | team    | int(1)           | NO   |     | NULL              |                | 
    | type    | int(2)           | NO   |     | NULL              |                | 
    +---------+------------------+------+-----+-------------------+----------------+
    The 'type' field is a flag bits field - (type & 1) is dead, (type & 2) is teamchat. More flags may be added in the future.

    Commands/CVars
    • sm_chatlog_id - The ID for each server. Must be set before chat will be entered into the database. EX myserver1.cfg: sm_chatlog_id "myserver1" OR sm_chatlog_id "1". This allows you to categorize chat in your database and differentiate between servers.
    • sm_chatlog_filtermode - 1 [default] causes ChatLog to log messages post-processing by other addons. This means chat messages will be logged as they are seen by players, and wont include @commands or censored chat. 0 means ChatLog will directly log 'say' commands, which will include admin messages, messages that are ultimately changed by other plugins, and might not include chat events generated by other plugins.
    • If you want to use a database besides 'default', modify the SQL_TConnect(sql_Connect, "default"); line in the plugin and recompile it. It would be rather messy to make this a cvar.
    Using the web UI
    The small web UI that comes with this should be easy to setup. Modify the 5 $DB_ variables at the beginning of it to match your database, and set it free. This script was made on php 5.2, I didn't really test it on php4 (or much in general).
    The webUI requires jQuery 1.2+ for its pretty effects. The .zip attached comes bundled with jQuery 1.3.1.

    Web UI Example
    http://nemu.doublezen.net/chatlog.php
    ChangeLog
    • 1.2
      • Web UI should now handle srvid's that contain non-alphanumeric characters.
      • "Console" (IE typing 'say' in server console/rcon) is now properly logged in both filter modes.
      • Fixed a javascript bug that was breaking the ajax part of the web UI for pretty much anyone. I told you I didn't test it much!
      • Changed a line to make it more obvious what to edit to use a database besides 'default'. Making this a cvar would be too messy atm (see further info in CVars section of this post)
    • 1.1-r4 - the php file should now work with php setups using short tags. Short tags arn't going away until php6 it seems T_T
    • 1.1-r3 - Another scrolling fix because a certain someone is really nitpicky. No change to the plugin, just a minor javascript fix in the php.
    • 1.1-r2 - Fixed a scrolling bug in the php file - no changes to the actual plugin.
    • 1.1 - My initial version with juicy featuretasticness.
    • 1.0 - Initial version from bl4nk
    Thanks
    • bl4nk for writing the original plugin, which accounts for much of the plugin's code.
    • msleeper, psychonic, mauirixxx, and everyone else in #hlserveradmins for requesting it, badgering me, and making fun of my taste in music.
    • Nimoi for helping me test it on our servers.
    • Mythical for responding to nonsensical requests on steam
    • jQuery for being useful and to the point.
    License
    Both the plugin and the webUI example are GPL3'd. See the copyright notice in the header of both files. jQuery (used by the webUI and bundled in the zip) is dual licensed under the MIT and GPL licenses.
    Attached Files
    File Type: zip chatlog_1.2.php.zip (21.5 KB, 965 views)
    File Type: sp Get Plugin or Get Source (chatlog.sp - 1645 views - 6.2 KB)

    Last edited by Nephyrin; 10-19-2009 at 16:36. Reason: Out of date
    Nephyrin is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 01-23-2009 , 15:23   Re: ChatLog (Fixed Post)
    Reply With Quote #2

    to many heroes, no medics, np patience, all noobs

    Great plugin, even if I can't find a use for it myself.
    __________________
    msleeper is offline
    mauirixxx
    Member
    Join Date: Mar 2006
    Old 01-23-2009 , 15:36   Re: ChatLog (Fixed Post)
    Reply With Quote #3

    yay! <3 Neph. And I never once made fun of your taste in music, I just didn't know wtf DotA was

    Thanks for posting this!
    mauirixxx is offline
    Send a message via AIM to mauirixxx Send a message via MSN to mauirixxx Send a message via Yahoo to mauirixxx
    NoNameYan
    New Member
    Join Date: Jan 2009
    Old 01-28-2009 , 08:36   Re: ChatLog v1.1-r3
    Reply With Quote #4

    http://l4d.noname.hk/chatlog.php

    why i can't display anything?

    and have javascript error..

    i'm come from hong kong..

    thx.
    NoNameYan is offline
    Chris-_-
    SourceMod Donor
    Join Date: Oct 2008
    Old 01-28-2009 , 11:11   Re: ChatLog v1.1-r3
    Reply With Quote #5

    Quote:
    Parse error: syntax error, unexpected T_STRING in /home/surf/public_html/chatlog.php on line 101
    and:

    EDIT: Fixed plugin error, dont get the syntax error in php file tho

    Last edited by Chris-_-; 01-28-2009 at 11:56.
    Chris-_- is offline
    Chris-_-
    SourceMod Donor
    Join Date: Oct 2008
    Old 01-28-2009 , 16:22   Re: ChatLog v1.1-r3
    Reply With Quote #6

    Someone?
    Chris-_- is offline
    Icettiflow
    Senior Member
    Join Date: Jan 2009
    Old 01-28-2009 , 17:12   Re: ChatLog v1.1-r3
    Reply With Quote #7

    I too receive:

    Code:
    Parse error: syntax error, unexpected T_STRING in /home/username/public_html/administration/chatlog/chatlog.php on line 101
    Running PHP 5.2.6.

    Also confirmed that no tables have been created.
    Icettiflow is offline
    Chris-_-
    SourceMod Donor
    Join Date: Oct 2008
    Old 01-28-2009 , 17:13   Re: ChatLog v1.1-r3
    Reply With Quote #8

    Me too, either the coder got 4.x.x , or it's an actual syntax error, havent figured it out yet.
    Chris-_- is offline
    Nephyrin
    SourceMod Donor
    Join Date: Mar 2008
    Old 01-28-2009 , 17:32   Re: ChatLog v1.1-r4
    Reply With Quote #9

    Chris - the r4 zip should work for you. The problem is your php setup has 'short tags' enabled, which was causing it to choke on the <?xml declaration. Short tags are still on by default in php5 (they're going away entirely in 6) so i should've caught this :-P

    You also mentioned a plugin error? I'd like to fix any issues so let me know if you had to tweak anything in the sp.

    NoNameYan - Try using sm_chatlog_id's without spaces. I think that may be the problem. I'll fix up the php file when i have some time to deal with space'd names.

    Last edited by Nephyrin; 01-28-2009 at 17:33. Reason: typo
    Nephyrin is offline
    mauirixxx
    Member
    Join Date: Mar 2006
    Old 01-28-2009 , 17:40   Re: ChatLog v1.1-r4
    Reply With Quote #10

    Apparently I'm of the heathen variety as well. I too probably would've caught this if I installed the php script .... thanks for helping us heathens out Neph.

    <3
    mauirixxx is offline
    Send a message via AIM to mauirixxx Send a message via MSN to mauirixxx Send a message via Yahoo to mauirixxx
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 06:09.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode