Ban Script

set file /usr/local/lib/mysqltcl-2.40/libmysqltcl2.40 load ${file}[info sharedlibextension]

bind pub - !wikiban wikiban
 * 1) please add FLAG and variables passed

proc wikiban {nick host hand chan args} { set db [mysqlconnect -host localhost -user wikiuser -password $PASSWORD -db wikidb] mysqlsel $db {INSERT into INSERT INTO `ipblocks` (ipb_address,ipb_by,ipb_reason,ipb_timestamp,ipb_expiry) VALUES ('$IP',$IRC_USER_ID,'$REASON','$CURRENT_TIME','$EXPIRY_TIME');}


 * 1) $IP and $REASON should be arguments from IRC user ,after trigger
 * 2) $IRC_USER_ID can be hardcoded, lets just setup a user for that
 * 3) $CURRENT_TIME needs to be created by this script
 * 4) $EXPIRY_TIME needs to be calculated by this script $CURRENT_TIME+23 days or also supplied as argument

set i 1 set result " " putquick "privmsg $chan: Ok, placing Wiki ban.." mysqlmap $db {ss_total_views ss_total_edits ss_good_articles} { putquick "privmsg $chan :Total Views: $ss_total_views Total Edits: $ss_total_edits Good Articles: $ss_good_articles (since mediawiki setup on Feb,04 2005)" incr i } mysqlclose $db }