damn! gjorde några kassa funktioner till ett community som skulle göras...
detta är ju ett typiskt fall av smink-funktion...
detta handlar dock inte om <body bakgrund blabla> utan <box>, men det är inte jättesvårt att ändra...
<%
function box_checker(smink, klart)
if instr(lcase(smink), "<box") <> 0 then
box_checker = box_func(smink, klart)
else
box_checker = klart&smink
end if
end function
' ##### BOX #####
function box_func(smink, done)
box_l = instr(lcase(smink), "<box")
box = right(lcase(smink), len(smink)-box_l+1)
x = 0
do until box_end = ">"
x = x --1
box_end = right(left(box, 4+x), 4)
if x > len(box) OR box_end = vbcrlf then
exit do
end if
loop
if box_end = ">" then
box_txt = left(right(smink, len(smink)-box_l+1), 4+x)
end if
' >> bakgrunds färg
if instr(lcase(box_txt), "color=") <> 0 then
col_loc = instr(lcase(box_txt), "color=")+6
col = right(box_txt, len(box_txt)-col_loc+1)
col = replace(col, """ , """")
col = replace(col, ">" , ">")
z = 0
do until col_end = " " OR col_end = ">"
z = z --1
col_end = right(left(col, z), 1)
color = color&col_end
if z > len(col) then
exit do
end if
loop
color = " bgcolor="&left(replace(color, " ", ""), len(color)-1)
end if
' >> ramfärg
if instr(lcase(box_txt), "border=") <> 0 then
bor_loc = instr(lcase(box_txt), "border=")+7
bor = right(box_txt, len(box_txt)-bor_loc+1)
bor = replace(bor, """ , """")
bor = replace(bor, ">" , ">")
z = 0
do until bor_end = " " OR bor_end = ">"
z = z --1
bor_end = right(left(bor, z), 1)
border = border&bor_end
if z > len(bor) then
exit do
end if
loop
border = left(replace(border, " ", ""), len(border)-1)
border = replace(border, """", "")
border = replace(border, "'", "")
border = " style=""border: 1 "&border&" solid;"""
end if
' >> bredd
if instr(lcase(box_txt), "width=") <> 0 then
wid_loc = instr(lcase(box_txt), "width=")+6
wid = right(box_txt, len(box_txt)-wid_loc+1)
wid = replace(wid, """ , """")
wid = replace(wid, ">" , ">")
z = 0
do until wid_end = " " OR wid_end = ">"
z = z --1
wid_end = right(left(wid, z), 1)
width = width&wid_end
if z > len(wid) then
exit do
end if
loop
width = left(replace(width, " ", ""), len(width)-1)
width_ = replace(width, """", "")
width_ = replace(width_, "'", "")
on error resume next
if right(width_, 1) <> "%" then
if int(width_) > 410 then
width = """100%"""
end if
end if
width = " width="&width
end if
on error resume next
if right(box_txt, 4) = ">" then
klart = done&left(smink, box_l-1)&"<table"&color&border&width&"><td> "
kvar = " "&right(smink, len(smink)-box_l-(x+4)+1)
box_func = box_checker(kvar, klart)
else
klart = done&smink&" "
kvar = ""
box_func = box_checker(kvar, klart)
end if
end function
%>
hmm... gammal o kass som sagt =/