[求助]勋章代码问题
以下代码是一勋章插件代码,用来显示勋章的,每5个排列一行。共10个勋章,2行。但当第一行或第二行均为“rempty”时,应该自动消失此行,可实事是出现空行,若两行均为“rempty”时,就出现两趟空行!感觉是红色部分问题,但去掉,就排一行了!请问怎么办?数据库数据说明:勋章是用"|||"分隔的,设有勋章,就是勋章图片名,没有则为“rempty”,
如:winner1.gif|||rempty|||winner2.gif|||rempty|||rempty|||rempty|||rempty|||rempty|||rempty|||rempty|||
Function Jiangzhang(jzdata)
dim jzdata1,jztyp,i,jzsm1,jzsm2,jzpic1,jzpic2,jzrs,j
set jzrs=bbs94kk.execute("select jzsm,jzpicurl from kk_jzdata")
do while not jzrs.eof
jzsm1=jzsm1&jzrs("jzsm")&"|||"
jzpic1=jzpic1&jzrs("jzpicurl")&"|||"
jzrs.movenext
loop
jzsm2=split(jzsm1,"|||")
jzpic2=split(jzpic1,"|||")
if trim(jzdata)<>"" then
jzdata1=split(jzdata,"|||")
for i=0 to ubound(jzdata1)-1
for j=0 to ubound(jzpic2)
if jzpic2(j)=jzdata1(i) then exit for '确定奖章说明
next
if jzdata1(i)<>"rempty" then jztyp=jztyp&"<span title='"&jzsm2(j)&"' style='color:red'><img src='Images/cham/"&jzdata1(i)&"'></span>"
if ((i+1) mod 5)=0 then jztyp=jztyp&"<br>"
next
else
jiangzhang=""
end if
jiangzhang=jztyp
End Function
dim jzdata1,jztyp,i,jzsm1,jzsm2,jzpic1,jzpic2,jzrs,j
set jzrs=bbs94kk.execute("select jzsm,jzpicurl from kk_jzdata")
do while not jzrs.eof
jzsm1=jzsm1&jzrs("jzsm")&"|||"
jzpic1=jzpic1&jzrs("jzpicurl")&"|||"
jzrs.movenext
loop
jzsm2=split(jzsm1,"|||")
jzpic2=split(jzpic1,"|||")
if trim(jzdata)<>"" then
jzdata1=split(jzdata,"|||")
for i=0 to ubound(jzdata1)-1
for j=0 to ubound(jzpic2)
if jzpic2(j)=jzdata1(i) then exit for '确定奖章说明
next
if jzdata1(i)<>"rempty" then jztyp=jztyp&"<span title='"&jzsm2(j)&"' style='color:red'><img src='Images/cham/"&jzdata1(i)&"'></span>"
if ((i+1) mod 5)=0 then jztyp=jztyp&"<br>"
next
else
jiangzhang=""
end if
jiangzhang=jztyp
End Function
[[it] 本帖最后由 thbwn 于 2008-2-20 15:08 编辑 [/it]]