'id 这里其实是 classId 'mbStr1 最右边的栏目模板 由于是当前本页面 就不带链接了 建议默认值:<span class='mbxC'>$title</span> 'mbStr2 递归模板 带链接 建议默认值:<span class='mbx'><a href='newslist.asp?classId=$id' target=_blank>$title</a></span> >> Public function mianbaoxue(id,mbStr1,mbStr2) set rs_getSelect = db.getRs(rs_getSelect,"select * from "&tName&" where oDel = False and id = "&id) if not rs_getSelect.eof then t = replace(mbStr1,"$title",lib.code2html(rs_getSelect("title"))) t = replace(t,"$id",rs_getSelect("id")) '有没有上级目录 并递归 if Cstr(rs_getSelect("pid")) <> "0" then t = mbxDigui(rs_getSelect("pid"),mbStr2,"") & t end if end if mianbaoxue = t end function Public function mbxDigui(id,mb,lsStr) set rs_getSelect = db.getRs(rs_getSelect,"select * from "&tName&" where oDel = False and id = "&id) if not rs_getSelect.eof then mb1 = replace(mb,"$id",rs_getSelect("id")) mb1 = replace(mb1,"$title",rs_getSelect("title")) lsStr = mb1 & lsStr if Cstr(rs_getSelect("pid")) <> "0" then mbxDigui = mbxDigui(rs_getSelect("pid"),mb,lsStr) else mbxDigui = lsStr end if else mbxDigui = "err" end if end function '面包屑调用方法 ' mbStr1 = "<span class='mbxC'>$title</span>" ' mbStr2 = "<span class='mbx'><a href='newslist.asp?classId=$id' target=_blank>$title</a></span> >> " 'Response.write( newsmulu.mianbaoxue(request.QueryString("classId"),mbStr1,mbStr2) )
经过一次修改,发现调用的时候,目录列表页和内页的模板不一样
列表页的 mbStr1 不用带链接
内页的 mbStr1 需要带链接
所以在函数替换时候加入了一句 mb1 = replace(mb,"$id",rs_getSelect("id"))