<% if Instr(session("AdminPurview"),"|12,")=0 then response.write ("

您沒有管理該模塊的權限 !
") response.end end if %> <% dim Result,Keyword,SortID,SortPath Result=request.QueryString("Result") Keyword=request.QueryString("Keyword") SortID=request.QueryString("SortID") SortPath=request.QueryString("SortPath") function PlaceFlag() if Result="Search" then If Keyword<>"" Then Response.Write "圖文 :列表 -> 檢索 -> 關鍵字 :"&Keyword&"" Else Response.Write "圖文 :列表 -> 檢索 -> 關鍵字為空(顯示全部圖文)" End If else if SortPath<>"" then Response.Write "圖文 :列表 -> 全部" TextPath(SortID) else Response.Write "圖文 :列表 -> 全部" end if end if end function %>
【圖文檢索及分類查看】
關鍵字 :
<%PlaceFlag()%>

<% ProductsList() %>
ID 生效 圖文編號 圖文標題 狀態 操作 選擇
<% function ProductsList() dim idCount dim pages pages=20 dim pagec dim page page=clng(request("Page")) dim pagenc pagenc=2 dim pagenmax dim pagenmin dim datafrom datafrom="Qianbo_tp" dim datawhere if Result="Search" then datawhere="where ProductName like '%" & Keyword &_ "%' " else if SortPath<>"" then datawhere="where Instr(SortPath,'"&SortPath&"')>0 " else datawhere="" end if end if dim sqlid dim Myself,PATH_INFO,QUERY_STRING PATH_INFO = request.servervariables("PATH_INFO") QUERY_STRING = request.ServerVariables("QUERY_STRING")' if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then Myself = PATH_INFO & "?" else Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1) end if dim taxis taxis="order by id desc" dim i dim rs,sql sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere set rs=server.createobject("adodb.recordset") rs.open sql,conn,0,1 idCount=rs("idCount") if(idcount>0) then if(idcount mod pages=0)then pagec=int(idcount/pages) else pagec=int(idcount/pages)+1 end if sql="select id from ["& datafrom &"] " & datawhere & taxis set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 rs.pagesize = pages if page < 1 then page = 1 if page > pagec then page = pagec if pagec > 0 then rs.absolutepage = page for i=1 to rs.pagesize if rs.eof then exit for if(i=1)then sqlid=rs("id") else sqlid=sqlid &","&rs("id") end if rs.movenext next end if if(idcount>0 and sqlid<>"") then sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis set rs=server.createobject("adodb.recordset") rs.open sql,conn,0,1 while(not rs.eof) Response.Write "" & vbCrLf Response.Write ""&rs("ID")&"" & vbCrLf if rs("ViewFlag") then Response.Write "生效" & vbCrLf else Response.Write "未生效" & vbCrLf end If Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf if rs("NewFlag") then Response.Write "不鏈接 " if rs("CommendFlag") then Response.Write "推薦" if rs("NewFlag") = false And rs("CommendFlag") = false then Response.Write "普通" Response.Write "" Response.Write "添加 修改" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf rs.movenext wend Response.Write "" & vbCrLf Response.Write " " & vbCrLf Response.Write "" & vbCrLf else response.write "暫無圖文信息" end if Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "
共計 :"&idcount&"條記錄 頁次 :"&page&"/"&pagec&" 每頁 :"&pages&"" & vbCrLf pagenmin=page-pagenc pagenmax=page+pagenc if(pagenmin<1) then pagenmin=1 if(page>1) then response.write ("9 ") if(pagenmin>1) then response.write ("7 ") if(pagenmax>pagec) then pagenmax=pagec for i = pagenmin to pagenmax if(i=page) then response.write (" "& i &" ") else response.write ("["& i &"]") end if next if(pagenmax8 ") if(page: ") Response.Write "第頁" & vbCrLf Response.Write "" & vbCrLf Response.Write "
" & vbCrLf rs.close set rs=nothing Response.Write "" & vbCrLf Response.Write "" & vbCrLf end Function Function TextPath(ID) Dim rs,sql Set rs=server.CreateObject("adodb.recordset") sql="Select * From Qianbo_ProductSort where ID="&ID rs.open sql,conn,1,1 TextPath=" -> "&rs("SortName")&"" if rs("ParentID")<>0 then TextPath rs("ParentID") response.write(TextPath) End Function Function SortText(ID) Dim rs,sql Set rs=server.CreateObject("adodb.recordset") sql="Select * From Qianbo_ProductSort where ID="&ID rs.open sql,conn,1,1 SortText=rs("SortName") rs.close set rs=nothing End Function %> <% if Instr(session("AdminPurview"),"|11,")=0 then response.write ("

您沒有管理該模塊的權限 !
") response.end end if %> <% function changechr(str) changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"
")," "," ") changechr=replace(replace(replace(replace(changechr,"[img]",""),"[red]",""),"[big]","") changechr=replace(replace(replace(replace(changechr,"[/img]",">"),"[/b]",""),"[/red]",""),"[/big]","") end function %> <% Dim Action Action=request.QueryString("Action") Select Case Action Case "Add" addFolder CallFolderView() Case "Del" Dim rs,sql,SortPath Set rs=server.CreateObject("adodb.recordset") sql="Select * From Qianbo_Tpsort where ID="&request.QueryString("id") rs.open sql,conn,1,1 SortPath=rs("SortPath") conn.execute("delete from Qianbo_Tpsort where Instr(SortPath,'"&SortPath&"')>0") conn.execute("delete from Qianbo_Tp where Instr(SortPath,'"&SortPath&"')>0") response.write ("") Case "Save" saveFolder () Case "Edit" editFolder CallFolderView() Case "Move" moveFolderForm () CallFolderView() Case "MoveSave" saveMoveFolder () Case Else CallFolderView() End Select %> <%Function CallFolderView()%>
【管理圖文類別】
添加一級分類 | 查看所有圖文
<%Folder(0)%>
<% End Function Function Folder(id) Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType Set rs=server.CreateObject("adodb.recordset") sql="Select * From Qianbo_Tpsort where ParentID="&id&" order by id" rs.open sql,conn,1,1 if id=0 and rs.recordcount=0 then response.write ("
暫無圖文分類
") response.end end if i=1 response.write("") while not rs.eof ChildCount=conn.execute("select count(*) from Qianbo_Tpsort where ParentID="&rs("id"))(0) if ChildCount=0 then if i=rs.recordcount then FolderType="SortFileEnd" else FolderType="SortFile" end if FolderName=rs("SortName") onMouseUp="" else if i=rs.recordcount then FolderType="SortEndFolderClose" ListType="SortEndListline" onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');" else FolderType="SortFolderClose" ListType="SortListline" onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');" end if FolderName=rs("SortName") end If datafrom="Qianbo_Tpsort" response.write("") response.write("
"&FolderName&" ") if rs("ViewFlag") then Response.Write "(生效)" else Response.Write "(未生效)" end if response.write("        操作 :") If rs("ParentID") < 1 Then response.write("添加 | ") End If response.write("修改") response.write(" | ") response.write("→") response.write(" | -->