All pastes #915439 Raw Edit

Jemand

public text v1 · immutable
#915439 ·published 2008-02-23 20:08 UTC
rendered paste body
############## 
### getold ### 
############## 
proc no:pre:chk {nick uhost handle chan arg} { 
    global mysql table mychan limit error 
        set count $arg
	 set arg [mysqlescape $arg]
                
        if { $count == "" } { set count $nolimit(dupe) }
                
            set mysql(conn) [mysqlconnect -host $mysql(hst) -port $mysql(prt) -user $mysql(usr) -password $mysql(pwd) -db $mysql(db)] 
	     set checkdupe [mysqlsel $mysql(conn) "SELECT $table(id),$table(tim),$table(sec),$table(rls),$table(fil),$table(meg),$table(genre) FROM $mysql(table) WHERE $table(rls) ='rls' ORDER BY $table(tim) DESC LIMIT $limit(pre)" -flatlist]
            set table_db_id [lindex $checkdupe 0]
                        
        if {$table_db_id != ""} {
                
            foreach {id tim sec rls fil meg genre reason} $checkdupe {
                        
                        
                if {$fil == "NULL" || $fil == "" || $fil == "0"} {
                    set fil "-"
            }
            if {$meg == "NULL" || $meg == "" || $meg == "0" || $meg == "0.0"} {
                set meg "-"
            }
            if {$genre == "NULL" || $genre == ""} {
                set genre "-"
            }
            if {$reason == "NULL" || $reason == "" || $reason == "0"} {
                set reason "-"
            }
        
            set thetime [unixtime] 
            set tim_ago [no:dupe:ago $thetime $tim] 
            set tim_day [no:dupe:day $tim] 
                        
        putquick "PRIVMSG $chan :!addold $rls $sec $tim $fil $meg $genre $reason" 
} 
catch {mysqlclose $mysql(conn)} 
catch {mysqlclose} 
}
}