Hax'd this up a little. Here are the changes I made to make it purdier for a page.
proc netstats_do_final {} {
global netstats_setting netstats_links_data netstats_localserver netstats_list_data netstats_lusers_data
set ffd [open $netstats_setting(file_output) w+]
puts $ffd "<center>"
puts $ffd "Network Stats"
puts $ffd "Connected to $netstats_localserver"
puts $ffd "n"
puts $ffd "/LUSERS:"
foreach i [array names netstats_lusers_data] {
puts $ffd "$netstats_lusers_data($i)"
}
# puts $ffd "n"
# puts $ffd "/LIST:"
# foreach i [array names netstats_list_data] {
# regsub -all -- ":$" "[join $netstats_list_data($i)]" "" text2
# puts $ffd "$i $text2"
# }
puts $ffd "n"
puts $ffd "/MAP:"
puts $ffd " $netstats_localserver "
netstats_do_netmap " " $ffd $netstats_localserver
puts $ffd "n"
puts $ffd "/LINKS:"
foreach i [array names netstats_links_data] {
puts $ffd "[join $netstats_links_data($i)]"
}
puts $ffd "</center>"
close $ffd
puthelp "[exec /bin/netstats]"
}
Notice the <center> and </center> added, and the puthelp "[exec /bin/netstats]" I would have had the regular execute, but tcl didn't like the pipes, etc, so here's my /bin/netstats:
cat /www/htdocs/netstats/netstats.txt|perl -p -e 's/n/<br>n/g'>/www/htdocs/netstats/netstats2.txt
just chmod +x that so it's executable, which just puts <br>s at the end of each line, so it's not all jumbled together. Then I just <?php include("netstats2.txt"); ?> cause php is the shizit. here is my page with it if you want to see it in action.
http://wagd.com/netstats/ Thanks everyone! *Hugs WCC*