Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3938444
chanlist2html.tcl
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
chanlist2html.tcl
View Options
#
# This eggdrop TCL script lets you print channel users on a web page.
#
#
# Configuration
# Paths are relative to eggdrop
#
#The channel to save
set
chanlist2html
(
channel
)
#
wolfplex
#The HTML file to write
set
chanlist2html
(
file
)
users.html
#The HTML template
#Remplace the list code by %%chanlist%%
set
chanlist2html
(
tmpl
)
users.tmpl
#The interval to regenerate the page in minutes
set
chanlist2html
(
time
)
5
#
# Helper procs
#
#Generates a <ul><li>...<li><li>...<li></ul> HTML code from a list
proc
list2ul
{
list
{
lineprefix
""
}}
{
set
html
"${lineprefix}<ul>\n"
foreach
item
$list
{
append
html
"${lineprefix}\t<li>${item}</li>\n"
}
append
html
"${lineprefix}</ul>"
}
#Writes $target with the $channel users list from $template
proc
chanlist2html_write
{
channel
template target
}
{
if
[
file
exists
$template
]
{
set
fd
[
open
$template
r
]
while
{
!
[
eof
$fd
]}
{
append
buffer
[
gets
$fd
]
}
close
$fd
}
{
set
buffer
"%%chanlist%%"
}
set
fd
[
open
$target
w
]
set
chanlist
[
list2ul
[
chanlist
$channel
]]
puts
$fd
[
string
map
[
list
%%
chanlist
%%
$chanlist
]
$buffer
]
flush
$fd
close
$fd
}
#
# Timer
#
proc
chanlist2html
{}
{
global
chanlist2html
chanlist2html_write
$chanlist2html
(
channel
)
$chanlist2html
(
tmpl
)
$chanlist2html
(
file
)
timer
$chanlist2html
(
time
)
chanlist2html
}
chanlist2html
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 02:12 (18 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314113
Default Alt Text
chanlist2html.tcl (1 KB)
Attached To
Mode
rVIPERSERV ViperServ scripts [legacy Mercurial repo]
Attached
Detach File
Event Timeline
Log In to Comment