×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Ban Script: Difference between revisions

    Content added Content deleted
    imported>mutante
    mNo edit summary
     
    imported>mutante
    mNo edit summary
     
    (6 intermediate revisions by the same user not shown)
    Line 8: Line 8:
    proc wikiban {nick host hand chan args} {
    proc wikiban {nick host hand chan args} {
    set db [mysqlconnect -host localhost -user wikiuser -password $PASSWORD -db wikidb]
    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');}
    mysqlsel $db {INSERT INTO `ipblocks` (ipb_address,ipb_by,ipb_reason,ipb_timestamp,ipb_expiry) VALUES ('$IP',$IRC_USER_ID,'$REASON','$CURRENT_TIME','$EXPIRY_TIME');}


    # $IP and $REASON should be arguments from IRC user ,after trigger
    # $IP and $REASON should be arguments from IRC user ,after trigger
    Line 14: Line 14:
    # $CURRENT_TIME needs to be created by this script
    # $CURRENT_TIME needs to be created by this script
    # $EXPIRY_TIME needs to be calculated by this script $CURRENT_TIME+23 days or also supplied as argument
    # $EXPIRY_TIME needs to be calculated by this script $CURRENT_TIME+23 days or also supplied as argument
    # DATE FORMAT in Mediawiki is like YYYYMMDDHHMMSS (20051003141052)

    putquick "privmsg $chan :Ok, placed ban on $IP expiring at $EXPIRY_TIME_HUMAN_READABLE)"
    # We need $EXPIRY_TIME in human readable form here to pass back to channel


    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
    mysqlclose $db
    }
    }


    {{Under construction}}</pre>
    </pre>

    {{UnderConstruction}}

    [[Category:Scripts]]

    Latest revision as of 23:38, 4 October 2005

    set file /usr/local/lib/mysqltcl-2.40/libmysqltcl2.40
    load ${file}[info sharedlibextension]
    
    bind pub - !wikiban wikiban 
    # 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 `ipblocks` (ipb_address,ipb_by,ipb_reason,ipb_timestamp,ipb_expiry) VALUES ('$IP',$IRC_USER_ID,'$REASON','$CURRENT_TIME','$EXPIRY_TIME');}
    
    # $IP and $REASON should be arguments from IRC user ,after trigger
    # $IRC_USER_ID can be hardcoded, lets just setup a user for that
    # $CURRENT_TIME needs to be created by this script 
    # $EXPIRY_TIME needs to be calculated by this script $CURRENT_TIME+23 days or also supplied as argument
    # DATE FORMAT in Mediawiki is like YYYYMMDDHHMMSS (20051003141052)
    
    putquick "privmsg $chan :Ok, placed ban on $IP expiring at $EXPIRY_TIME_HUMAN_READABLE)"
    # We need $EXPIRY_TIME in human readable form here to pass back to channel
    
    mysqlclose $db
    }
    
    
    This page is still under construction.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.