Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc dupe:top {nick uhost handle chan arg} {
- global db_handle mysql_ chan_ infotable_ bopen bclose bdiv
- set days [expr 30 - [strftime %u]]
- set days2go [expr {$days==1?"1 day":"$days days"}]
- set quota_(amount) "20"
- set place 0
- set refine ""
- if {[llength $arg] >= 1} { set refine "WHERE `user` = '[mysqlescape [string trim [lindex $arg 0]]]'" }
- putnow "PRIVMSG $chan_(kadd) :${bopen}\00303KNOWN \00311MP3 \00303RELEASE GROUP\003${bclose} ${bopen}\00303HONOR \00311TV \00303RELEASE GROUP\003${bclose} ${bopen}\00303KNiSO \00311APPS \00303RELEASE GROUP\003${bclose}"
- putnow "PRIVMSG $chan_(kadd) :This month has $days2go left to go! - Get Uploading if your failing the $quota_(amount) releases per month quota."
- set monthrls [mysqlsel $db_handle "SELECT `user`,COUNT(`user`) AS count FROM `info` WHERE `timestamp` >= UNIX_TIMESTAMP((LAST_DAY(NOW())+ INTERVAL 1 DAY)-INTERVAL 1 MONTH) AND `timestamp` < UNIX_TIMESTAMP(LAST_DAY(NOW())+ INTERVAL 1 DAY) $refine GROUP BY `user` ORDER BY `count` DESC" -list]
- if {![mysqlsel $db_handle "SELECT `user`,COUNT(`user`) AS count FROM `info` $refine GROUP BY `user` ORDER BY `count` DESC"]} {
- putnow "PRIVMSG $chan_(kadd) :No results found\."
- return 0
- }
- mysqlmap $db_handle {user count} {
- set re {(?i)^}
- append re $user {\s\d+$}
- set res [lsearch -regexp $monthrls $re]
- if {$res != ""} { set mnup "[lindex [lindex $monthrls $res] 1]" } else { set mnup "0" }
- putnow "PRIVMSG $chan_(kadd) : \[\00314[num [incr place]]\003\] \00314$user\003 has \00314$count\003 releases. - ${bopen}\00314$mnup\003${bclose}"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement