Raised This Month: $95 Target: $400
 23% 

Chat Logger SQL


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Statistical        Approver:   Hawk552 (427)
aake
New Member
Join Date: Mar 2006
Old 04-13-2008 , 18:32   Chat Logger SQL
Reply With Quote #1

This plugin save chat message to MySQL Database

installing the plugin:
1. Copy chat_logger_sql.amxx file to plugins folder
2. Add line chat_logger_sql.amxx to plugins.ini file
3 Copy ChatLoggerSQL_NoSaveWords.ini file to your config folder.

Plugins upgrade 14-04-2008:
Added to plugin:
1. Plugin has been chanced so it will automaticaly create database if it doesn't excist yet.
2. Added feature that will not save any selected messages to database. This funciont will search unwanted words from ChatLoggerSQL_NoSaveWords.ini file. If any words writen in file will match to chat messages, the message will not be saved into database.


PHP Example http://naputtaja.no-ip.biz/chat_log/
Attached Files
File Type: sma Get Plugin or Get Source (chat_logger_sql.sma - 4849 views - 5.3 KB)
File Type: ini ChatLoggerSQL_NoSaveWords.ini (92 Bytes, 2164 views)
File Type: rar php_examples.rar (17.1 KB, 2222 views)

Last edited by aake; 06-20-2008 at 08:26.
aake is offline
Send a message via MSN to aake
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-13-2008 , 19:00   Re: Chat Logger SQL
Reply With Quote #2

Surprisingly useful, but you should close the SQL connection. You never have to open it in the first place as threaded querying demands only the tuple.

I'm going to approve it for now, but please make that change.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
chris
Senior Member
Join Date: Mar 2007
Location: America
Old 04-13-2008 , 20:16   Re: Chat Logger SQL
Reply With Quote #3

Wow nice job!
__________________
chris is offline
Send a message via AIM to chris
Min2liz
AlliedModders Donor
Join Date: Feb 2008
Location: Street
Old 04-14-2008 , 11:37   Re: Chat Logger SQL
Reply With Quote #4

What need to add that dont insert into MySQL for example /cp /tp and so on. I trying

Quote:
if (message != '/cp' && message != '/tp') {
format(query,1000,"INSERT into %s (name,authid,ip,alive,team,date,time,message, cmd) values ('%s','%s','%s','%d','%s','%s','%s','%s','%s' )",table,name,authid,ip,is_user_alive(id),TEA MNAME[_:team],datestr,timestr,message,cmd)
}
and get errors like:
Error: Invalid character constant on line 99
Error: Undefined symbol "cp" on line 99
Error: Undefined symbol "tp" on line 99
Warning: Loose indentation on line 98

I'm totaly newbie on amxx scripting :/
Min2liz is offline
Old 04-14-2008, 12:45
rudle
This message has been deleted by rudle. Reason: nvm
illu.sports | Leader
New Member
Join Date: Mar 2008
Old 05-11-2008 , 08:39   Re: Chat Logger SQL
Reply With Quote #5

If I open www.mydomain.com/chatlog/index.php i get this:
illu.sports | Leader is offline
Curryking
AMX Mod X German Moderator
Join Date: Jun 2004
Location: 51.22N / 6.77E
Old 05-17-2008 , 11:21   Re: Chat Logger SQL
Reply With Quote #6

Very nice plugin, I love it. Thanks! (http://forums.team-bbq.org/bbq_chatlog.php)

Future request: Is it possible to log also the map which is currently played?

e.g.

Quote:
2008-05-17 15:24:20 <de_dust> <STEAM_0:1:28635> <62.226.64.232> Curryking : hello world
Curry
__________________
Full speed - no brakes!

Last edited by Curryking; 05-17-2008 at 11:31.
Curryking is offline
illu.sports | Leader
New Member
Join Date: Mar 2008
Old 05-17-2008 , 12:56   Re: Chat Logger SQL
Reply With Quote #7

Could someone tell me how to install the sql-part of the plugin?
I get the following errors:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /mnt/web5/10/62/51539562/htdocs/illusports/chatlog/index.php on line 28

and:
Table 'Databasename.amx_chat_log' doesn't exist

Hope for help
Mark
illu.sports | Leader is offline
Curryking
AMX Mod X German Moderator
Join Date: Jun 2004
Location: 51.22N / 6.77E
Old 05-17-2008 , 13:03   Re: Chat Logger SQL
Reply With Quote #8

Quote:
Originally Posted by illu.sports | Leader View Post
[...]
[/B]and:
Table 'Databasename.amx_chat_log' doesn't exist
[...]
Just install the plugin properly and after the next mapchange/restart the plugin will automatically create the needed tables (as long as you have the SQL database with amxx running, of course )

Another feature request: Sometimes the plugin logs messages with no content. Would be nice if thouse could be excluded/wouldn't be logged anymore...

Messages like this:
Quote:
2008-05-17 15:24:20 <STEAM_0:1:28635> <62.226.64.232> Curryking :
Regards, Curry
__________________
Full speed - no brakes!

Last edited by Curryking; 05-17-2008 at 13:05.
Curryking is offline
illu.sports | Leader
New Member
Join Date: Mar 2008
Old 05-17-2008 , 13:38   Re: Chat Logger SQL
Reply With Quote #9

These empty messages I think is when someone types something, deletes it and pushes Enter.
You now u wanna write something and then think mhh, i think i shouldnt write that

Last edited by illu.sports | Leader; 05-17-2008 at 13:47.
illu.sports | Leader is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 05-28-2008 , 11:16   Re: Chat Logger SQL
Reply With Quote #10

This plugin code got some bugs, compile error codes 217 and 225. I don't know if it will make any troubles but preffer plugins without compile error messages.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Reply


Thread Tools
Display Modes

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 23:08.


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