<!--#include file="Conn.asp" --> <!--#include file="Admin/Inc/Const.asp" --> <% Function GetParentID(SortID) Dim Rs,Sql Sql="select parentID From TbSort where SortID="&SortID Set Rs=server.CreateObject("adodb.recordset") If Rs.state=1 Then Rs.close Rs.open Sql,conn,1,1 If NOT Rs.eof Then GetParentID=Rs(0) End if End Function Function GetParentName(ParentID) Dim Rs,Sql Sql="select SortName From TbSort where SortID="&ParentID Set Rs=server.CreateObject("adodb.recordset") If Rs.state=1 Then Rs.close Rs.open Sql,conn,1,1 If NOT Rs.eof Then GetParentName=Rs(0) End if End function Function GetSortName(SortID) Dim Rs,Sql Sql="select SortName From TbSort where SortID="&SortID Set Rs=server.CreateObject("adodb.recordset") If Rs.state=1 Then Rs.close Rs.open Sql,conn,1,1 If NOT Rs.eof Then GetSortName=Rs(0) End if End Function Set Rs=server.CreateObject("adodb.recordset") If Trim(Request("ParentID"))<>"" Then ParentID=Trim(Request("ParentID"))
Else If Trim(Request("SortID"))<>"" Then ParentID=GetParentID(Trim(Request("SortID"))) End if End if ParentName=GetParentName(ParentID) If Trim(Request("ParentID"))<>"" Then SortID=Trim(Request("ParentID")) Else If Trim(Request("SortID"))<>"" Then SortID=Trim(Request("SortID")) End if End if SortName=GetSortName(SortID) %> <table width="164" border="0" cellspacing="3" cellpadding="4"> <% Sql="select SortID,SortName From TbSort where ParentID=41" IF Rs.state=1 Then Rs.close Rs.open Sql,conn,1,1 Do while Not Rs.eof %> <tr> <td width="24" align="right"><img src="images/00000icon90.gif" width="9" height="9"> </td> <td width="132"><a href="publishshow.asp?SortID=<%=Rs("SortID")%>"><%=Rs("SortName")%></a></td> </tr> <% Rs.movenext Loop%> </table> <table width="91%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><% If Rs.state=1 Then Rs.close Sql="select top 1 * from TbArticle where SortID="&SortID Rs.open Sql,conn,1,1 If Not Rs.eof Then Subject=Rs("Subject") AddTime=Rs("AddTime") Content=Rs("Content") WordFile=Rs("wordFile") pic=rs("pic") End if %></td> </tr> <tr> <td height="27"> <table width="527" height="23" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="23" align="center" valign="bottom" class="title1"><strong><font color="#009900"><%=Subject%></font></strong> </td> </tr> </table></td> </tr> <tr> <td><table width="529" height="31" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="529" align="center"><font color="#666666"> <%=Formatdatetime(AddTime,1)%></font></td> </tr> </table></td> </tr> </table> <table width="529" height="235" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="529" valign="top" class="lineheight26"> <% If WordFile<>"" Then Response.Write("相关文档下载:<a href='admin/totalproduct/upword/"&WordFile&"' target=_blank>"&WordFile&"</a>" ) End if %> <br> <%=Content%> </td> </tr> </table> 要怎么判断才能达到上面的效果啊!!大家帮帮忙啊!
<SCRIPT language=javascript> function clickpimg(div_id){ if(eval(div_id).innerHTML==""||eval(div_id).style.display == "block"){ return "Images/folderopen.gif" } else { return "Images/folder.gif" } } function diva_show(div_id,clickp) { if (eval(div_id).style.display == "block") { eval(div_id).style.display = "none"; eval(clickp).src=clickpimg(div_id); //eval(statep).src="img/folder.gif"; } else { eval(div_id).style.display = "block"; eval(clickp).src=clickpimg(div_id); //eval(statep).src="img/folderopen.gif"; } } function openall(){ var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ DivLen[i].style.display="" eval(DivLen[i].id.replace("a","f")).src="Images/folderopen.gif" } }
function closeall(){ var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ DivLen[i].style.display="none" eval(DivLen[i].id.replace("a","f")).src="Images/folder.gif" } } function ShowuGetvalue(SortID,SortName,ParentID,LevelID){ parent.document.theform.SortID.value=SortID parent.document.theform.SortName.value=SortName parent.document.theform.ParentID.value=ParentID parent.document.theform.LevelID.value=LevelID } </SCRIPT> <!--#include file="Inc/Conn.asp" --> <% Response.CharSet="gb2312" Response.ContentType="text/html" Response.Expires = 0
%> <%
Sub Recur(SortID,SortName,ParentID,LevelID,Ecap) Dim sql,Treestr,Rs Set Rs=server.CreateObject("adodb.recordset") Rs.activeconnection=Conn Ecapstr="" for i=0 to Ecap Ecapstr=Ecapstr+"   " next Treestr=Ecapstr&"<img name=f"&SortID&" src=Images/folderopen.gif style=cursor:hand onclick=diva_show('a"&SortID&"','f"&SortID&"')>" Treestr=Treestr&"<a style=cursor:hand onclick=ShowuGetvalue('"&SortID&"','"&SortName&"','"&ParentID&"','"&LevelID&"');this.style.backgroundColor='#0099cc' onmouseout=this.style.backgroundColor=''>"&SortName&"</a><br>"&vbcrlf Treestr=Treestr&"<div id=a"&SortID&" >"&vbcrlf Response.write Treestr sql="select * from TbSort where ParentID="&SortID 'response.write sql If Rs.state=1 Then Rs.close Rs.open sql Do while Not Rs.eof SortID=Rs("SortID") SortName=Rs("SortName") ParentID=Rs("ParentID") LevelID=Rs("LevelID") call Recur(SortID,SortName,ParentID,LevelID,Ecap+1) Rs.movenext Loop Rs.close Set Rs=Nothing Response.write "</div>"&vbcrlf End sub SortID=Trim(Request("SortID")) SortName=Trim(Request("SortName")) ParentID=Trim(Request("ParentID")) LevelID=Trim(Request("LevelID")) call Recur(SortID,SortName,ParentID,LevelID,0) Conn.close Set Conn=Nothing %> <script> var DivLen=document.all.tags("Div") for(var i=0;i<DivLen.length;i++){ if(DivLen[i].innerHTML==""){ var DivID=DivLen[i].id eval("f"+DivID.replace("a","")).src="Images/folderopen.gif" } } /*alert(DivLen.length)*/ </script> 这段代码是什么意思啊!!!!!请哪位大虾知道告诉我啊!