This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

WebBanList.tcl by Wcc

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

can helpe with this tcl webbanlist

Post by Nor7on »

i used this tcl weBbanlist.tcl

Code: Select all

##################################
### WebBanList.tcl             ###
### Version 1.1                ###
### By Wcc                     ###
### wcc@techmonkeys.org        ###
### http://www.dawgtcl.com:81/ ###
### EFnet #|DAWG|Tcl           ###
##################################

############################################################################
### Copyright © 2000 - 2002 |DAWG| Scripting Group. All rights reserved. ###
############################################################################

##############################################################################
## This script generates a web page listing all global and channel bans in  ##
## the bot's banlist.                                                       ##
##############################################################################

##########################################################
## Just load the script, edit the settings, and rehash. ##
##########################################################

######################################################################
# Set here the path to the DAWG template file you would like to use. #
# You can obtain templates by visiting http://dawg.oc255.net:81/ and #
# clicking the templates link.                                       #
######################################################################

set webbanlist_setting(tpl) "./scripts/WebBanList_DAWG.tpl"

##########################################
# Set the filename of the web page here. #
##########################################

set webbanlist_setting(page) "../web/banlist.html"

####################
# Code begins here #
####################

if {![string match 1.6.* $version]} { putlog "\002WEBBANLIST:\002 \002WARNING:\002 This script is intended to run on eggdrop 1.6.x or later." }
if {[info tclversion] < 8.2} { putlog "\002WEBBANLIST:\002 \002WARNING:\002 This script is intended to run on Tcl Version 8.2 or later." }

bind time - "*0 * * * *" webbanlist_createhtml
bind time - "*5 * * * *" webbanlist_createhtml

set webbanlist_setting(version) "1.1"
set webbanlist_notpl 0

if {![info exists webbanlist_setting(tpl)] || [catch {source $webbanlist_setting(tpl)}]} {
	putlog "\002WEBBANLIST:\002 The template file could not be opened; using default."
	set webbanlist_notpl 1
}
foreach {s v} [list Page_CC #000000 Page_HC #000000 Page_LinkC #0000FF Page_TTextC #000000 Page_TextC #000000 Page_BGC \
	#FFFFFF Page_TCC_2 #E0E0E0 Page_TCC_1 #C0C0C0 Page_THC_2 #8080E0 Page_THC_1 #8080C0 Page_TCS 4 Page_THS 5 Page_TitleS 6 \
	Page_Title {Ban List} Page_TitleTag {Ban List} Page_Img {}] {
	if {$webbanlist_notpl || ![info exists webbanlist_setting($s)]} { set webbanlist_setting($s) $v  }
}
proc webbanlist_format_td {type line center text} {
	switch -- $type {
		"title" { return "<font size=\"$::webbanlist_setting(Page_THS)\" color=\"$::webbanlist_setting(Page_TextC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font>" }
		"header" { return "<td align=\"left\" bgcolor=\"$::webbanlist_setting(Page_THC_${line})\"><font size=\"$::webbanlist_setting(Page_THS)\" color=\"$::webbanlist_setting(Page_HC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font></td>" }
		"cell" { return "<td align=\"left\" bgcolor=\"$::webbanlist_setting(Page_TCC_${line})\"><font size=\"$::webbanlist_setting(Page_TCS)\" color=\"$::webbanlist_setting(Page_CC)\">[expr ($center)?{<center>}:{}]$text[expr ($center)?{</center>}:{}]</font></td>" }
	}
}
proc webbanlist_timedate {unixtime} {
	if {$unixtime == 0} { return "Never" }
	return [clock format $unixtime -format {%I:%M %p %D}]
}
proc webbanlist_createhtml {args} {
	set dt [clock format [clock seconds] -format {%I:%M %p %D}]
	set page [open $::webbanlist_setting(page) w]
	puts $page "<html>\n  <head>\n    <title>$::webbanlist_setting(Page_TitleTag)</title>\n    <META NAME=\"description\" CONTENT=\"Ban List\">\n    <META NAME=\"keywords\" CONTENT=\"bans, irc, eggdrop, tcl, link\">\n  </head>\n\n  <body bgcolor=\"$::webbanlist_setting(Page_BGC)\" link=\"$::webbanlist_setting(Page_LinkC)\" alink=\"$::webbanlist_setting(Page_LinkC)\" vlink=\"$::webbanlist_setting(Page_LinkC)\">"
	if {[string compare $::webbanlist_setting(Page_Img) ""] != 0} { puts $page "    <center><img src=\"$::webbanlist_setting(Page_Img)\"></img></center>" }
	puts $page "    <center><font size=\"$::webbanlist_setting(Page_TitleS)\" color=\"$::webbanlist_setting(Page_TTextC)\">$::webbanlist_setting(Page_Title)</font></center>\n    <br>"
	puts $page "    <br>\n    <br>\n    [webbanlist_format_td title 0 1 {Global Bans}]\n    <br>\n    <table align=\"center\">\n      <tr>"
	foreach {a b} [list 1 Number 2 Ban 1 Comment 2 Expires 1 Added 2 {Last Used} 1 Creator] { puts $page "        [webbanlist_format_td header $a 1 $b]" }
	puts $page "      </tr>"
	if {[string compare [banlist] ""] == 0} {
		puts $page "      <tr>"
		foreach {a b} [list 1 - 2 - 1 - 2 - 1 - 2 - 1 -] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
		puts $page "      </tr>"
	} {
		set bnum 0
		foreach b [banlist] {
			incr bnum
			puts $page "      <tr>"
			foreach {a b} [list 1 $bnum 2 [lindex $b 0] 1 [lindex $b 1] 2 [webbanlist_timedate [lindex $b 2]] 1 [webbanlist_timedate [lindex $b 3]] 2 [webbanlist_timedate [lindex $b 4]] 1 [lindex $b 5]] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
			puts $page "      </tr>"
		}
	}
	puts $page "    </table>\n    <br>\n    <br>"
	foreach chan [channels] {
		if {[string compare [banlist $chan] ""] == 0} { continue } 
		set servernum 0
		puts $page "    [webbanlist_format_td title 0 1 "$chan Bans"]\n    <br>\n    <table align=\"center\">\n      <tr>"
		foreach {a b} [list 1 Number 2 Ban 1 Comment 2 Expires 1 Added 2 {Last Used} 1 Creator] { puts $page "        [webbanlist_format_td header $a 1 $b]" }
		puts $page "      </tr>"
		set bnum 0
		foreach b [banlist $chan] {
			incr bnum
			puts $page "      <tr>"
			foreach {a b} [list 1 $bnum 2 [lindex $b 0] 1 [lindex $b 1] 2 [webbanlist_timedate [lindex $b 2]] 1 [webbanlist_timedate [lindex $b 3]] 2 [webbanlist_timedate [lindex $b 4]] 1 [lindex $b 5]] { puts $page "        [webbanlist_format_td cell $a 1 $b]" }
			puts $page "      </tr>"
		}
		puts $page "    </table>\n    <br>\n    <br>"
	}
	puts $page "    <center><font color=\"$::webbanlist_setting(Page_TextC)\">Last Updated: $dt</font></center>\n    <center><font color=\"$::webbanlist_setting(Page_TextC)\">Generated By: $::botnick</font></center>\n  </body>\n</html>\n<!--<DAWGID>WebBanList $::webbanlist_setting(version)</DAWGID>-->"
	close $page
}

putlog "\002WEBBANLIST:\002 WebBanList Version $webbanlist_setting(version) by Wcc is loaded."
How erase all the line "CREATOR" ?
when create the html, the site "global ban" is perfect, the wide.
but the site "$chan Bans" is very wide ;/ i like how the "global ban" the wide.

look here: http://www.nor7on.org/madrid/banlist.html
i want delete all the line "Creador". and modif the wide in "#Madrid bans"

Can someone helpme ?

Thanks. :roll:
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

it would be inappropriate for anyone to just modify this, or any, script without first attempting to contact the author. Give wcc an email, ask him to do it
wcc@techmonkeys.org <--
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

hi.

i send and re send an email. but no response my emails.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Nor7on wrote:hi.

i send and re send an email. but no response my emails.
http://www.eggheads.org/

Try the Mailing List to contact Wcc (he's the lead developer of eggdrop). ;)
Last edited by Alchera on Tue Feb 12, 2008 6:58 am, edited 1 time in total.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

uh?

Post by Nor7on »

What u say Alchera?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Re: uh?

Post by Alchera »

Nor7on wrote:What u say Alchera?
errrr... sorry, I've edited my post .. left bits off. :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply