nick list dans fichier html
#10
Bon, avant que ça ne me fatigue:
Le script tcl
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 ::v(op) $cnick } } save:log } proc save:log {} { set fp [open $::fichier w] set fi [open $::fsource r] set tpl [read $fi -nonewline $fi] close $fi $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 fputs $fp $tpl close $fp } ########## # Putlog # ########## # putlog "nick list par CrazyCat"

Le fichier template
A mettre dans /home/loulou/liste.tpl
Code :
<html> <head> <title>Les %count connectés sur %channel</title> <style>body { background-color: black; }</style> </head> <body> <table> <tr><th>Il y a %count personnes sur %channel</th></tr> %list </table> </body> </html>
Et je n'aide plus sur ce sujet, tu as toute la solution.
Présent sur le Tchat francophone
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é - Transitionnez vers Linux - Discussions dans le Lauragais - Communauté LGBT respectueuse - soutien aux victimes de cybermalveillance - pour les filles par les filles Le forum pour passer le temps