proc battle:flagsong { nick host hand chan text } {
global head tail delim dj
set chan [string tolower $chan]
if !{ [channel get $chan advertonly] } {
if !{ [string equal $text ""] } {
putlog "\002Radio:\002 $nick \($hand\) flagged a song."
set song [battle:getxml]
if !{ [string equal $song ""] } {
regexp {<SONGTITLE>(.*?)<\/SONGTITLE>} $song match song
regsub -all {'} $song "'" song
regsub -all {<} $song "<" song
regsub -all {>} $song ">" song
regsub -all {&} $song "&" song
regsub -all {ÿ} $song "ñ" song
regsub -all {°} $song "º" song
regsub -all {&} $song "&" song
}
if { [string equal $dj ""] } {
set $currentdj "AutoDJ"
} else {
set $currentdj $dj
}
set r [open flaggedsongs.txt a+]
puts $r "[strftime "%d %b %Y, %H:%M %z"]: $song was played on air and flagged by $nick \($hand\). DJ onair was $currentdj. Reason: $text"
close $r
putserv "PRIVMSG $nick :$head I have flagged the current song, which was \($song\). It will be reviewed by management. Reason provided: $text $tail"
} else {
putserv "PRIVMSG $nick :$head You must provide a reason. $tail"
}
}
}
proc battle:flagsong {nick host hand chan text} {
global head tail delim dj
if {[channel get $chan advertonly]} { return }
if {$text != ""} {
putlog "\002Radio:\002 $nick \($hand\) flagged a song."
set song [battle:getxml]
if {$song != ""} {
regexp {<SONGTITLE>(.*?)<\/SONGTITLE>} $song match song
regsub -all {'} $song "'" song
regsub -all {<} $song "<" song
regsub -all {>} $song ">" song
regsub -all {&} $song "&" song
regsub -all {ÿ} $song "ñ" song
regsub -all {°} $song "º" song
regsub -all {&} $song "&" song
}
if {$dj == ""} {
set currentdj "AutoDj"
} else {
set currentdj $dj
}
set r [open flaggedsongs.txt a+]
puts $r "[strftime "%d %b %Y, %H:%M %z"]: $song was played on air and flagged by $nick \($hand\). DJ onair was $currentdj. Reason: $text"
close $r
putserv "PRIVMSG $nick :$head I have flagged the current song, which was \($song\). It will be reviewed by management. Reason provided: $text $tail"
} else {
putserv "PRIVMSG $nick :$head You must provide a reason. $tail"
}
}