nick list dans fichier html
#13
Effectivement, il y avait quelques erreurs de frappe.

Celui-ci est testé et donc fonctionnel.
Code :
###################################
########### Liste users ###########
###################################

set canal "#accueil"
set fsource "/home/loulou/liste.tpl"
set fichier "/home/loulou/public_html/liste.html"

bind join - "$canal *" list:join
bind part - "$canal *" list:part
bind sign - "$canal *" list:quit

proc list:join {nick uhost handle chan} { list:log; }
proc list:part {nick uhost handle chan text} {
    if {$nick != $::botnick} { list:log; }
}
proc list:quit {nick uhost handle chan text} {
    if {$nick != $::botnick} { list:log; }
}

proc list:log {} {
   set ::u(op) {}
   set ::u(hop) {}
   set ::u(vop) {}
   set ::u(nop) {}
   set ::count 0
    foreach cnick [chanlist $::canal] {
        if { $cnick == $::botnick } { continue; }
        incr ::count
        if { [isop $cnick $::canal] == 1 } {
            lappend ::u(op) $cnick
        } elseif { [ishalfop $cnick $::canal] == 1 } {
            lappend ::u(hop) $cnick
        } elseif { [isvoice $cnick $::canal] == 1 } {
            lappend ::u(vop) $cnick
        } else {
            lappend ::u(nop) $cnick
        }
    }
    save:log
}

proc save:log {} {
   set fp [open $::fichier w]
   set fi [open $::fsource r]
   set tpl [read -nonewline $fi]
   close $fi
   set ::ulist ""
   foreach nick $::u(op) {
       append ::ulist "<tr><td style='color:red;'>@$nick</td></tr>\n"
   }
   foreach nick $::u(hop) {
      append ::ulist "<tr><td style='color:blue;'>%$nick</td></tr>\n"
   }
   foreach nick $::u(vop) {
      append ::ulist "<tr><td style='color:yellow;'>+$nick</td></tr>\n"
   }
   foreach nick $::u(nop) {
      append ::ulist "<tr><td style='color:green;'>$nick</td></tr>\n"
   }
   regsub -all %count $tpl $::count tpl
   regsub -all %channel $tpl $::canal tpl
   regsub -all %list $tpl $::ulist tpl
   puts $fp $tpl
   close $fp
}

##########
# Putlog #
##########
#
putlog "nick list par CrazyCat"
Répondre


Messages dans ce sujet
nick list dans fichier html - par loulou7593 - 30/01/2012, 03:10
RE: nick list dans fichier html - par CrazyCat - 30/01/2012, 10:20
RE: nick list dans fichier html - par CrazyCat - 30/01/2012, 23:15
RE: nick list dans fichier html - par CrazyCat - 31/01/2012, 00:05
RE: nick list dans fichier html - par CrazyCat - 31/01/2012, 11:17
RE: nick list dans fichier html - par CrazyCat - 01/02/2012, 14:36
RE: nick list dans fichier html - par CrazyCat - 03/02/2012, 16:43
RE: nick list dans fichier html - par djkenny - 04/02/2012, 09:08
RE: nick list dans fichier html - par CrazyCat - 04/02/2012, 14:51
RE: nick list dans fichier html - par djkenny - 04/02/2012, 18:43

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté