<%
function OtherMenu(PID)
Dim str,rs,sql,AutoUrl
if PID="" then PID=0
sql="select ID,SortName from ["&Datapre&"_OthersSort] where Viewflag and ParentID="&PID&" order by ID"
set rs=db(sql,2)
if rs.eof then
PID=db("select ParentID from ["&Datapre&"_OthersSort] where Viewflag and ID="&PID&"",1)(0)
rs.close:set rs=nothing
sql="select ID,SortName from ["&Datapre&"_OthersSort] where Viewflag and ParentID="&PID&" order by ID"
set rs=db(sql,2)
end if
if not rs.eof then
do while not rs.eof
if IsHtml=1 then
AutoUrl=""&OtherSortName&""&Separated&""&rs("ID")&"."&HTMLName&""
else
AutoUrl="OtherList.asp?SortID="&rs(0)&""
end if
str=str&"<li><a href='"&AutoUrl&"'><span>"&rs(1)&"</span></a></li>"
rs.movenext
loop
end if
rs.close:set rs=nothing
OtherMenu=str
end function

Function WebContentOtherList(DataFrom, ID, SortPath)
    Dim rs, sql
    Dim HideSort,StringText
   StringText=""
    Set rs = server.CreateObject("adodb.recordset")
    If ID = "" Then
        SortPath = "0,"
    ElseIf Not IsNumeric(ID) Then
StringText=StringText&"<center>暂无相关信息</center>"
        Exit Function
    ElseIf conn.Execute("select * from ["&DataFrom&"] Where ViewFlag and  ID="&ID).EOF Then
StringText=StringText&"<center>暂无相关信息</center>"
        Exit Function
    Else
        SortPath = db("select * from ["&DataFrom&"] Where ViewFlag and  ID="&ID,1)("SortPath")
        call db("update ["&DataFrom&"] set Click_Count=Click_Count+1 Where ID="&ID,0)
    End If
    sql = "select * from ["&DataFrom&"] Where not(ViewFlag) and Instr(SortPath,'"&SortPath&"')>0"
    set rs=db(sql,2)
    While Not rs.EOF
        HideSort = "and not(Instr(SortPath,'"&rs("SortPath")&"')>0) "&HideSort
        rs.movenext
    Wend
    rs.Close:set rs=nothing
    Dim idCount
    Dim pages
    pages = OtherInfo
    Dim pagec
    Dim page
    page = CLng(request("Page"))
    Dim pagenc
    pagenc = 5
    Dim pagenmax
    Dim pagenmin
    Dim pageprevious
    Dim pagenext
    datafrom = ""&Datapre&"_Others"
    Dim datawhere
    datawhere = "where ViewFlag and Instr(SortPath,'"&SortPath&"')>0 "&HideSort& " "
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")'
    If QUERY_STRING = "" Then
        Myself = PATH_INFO & "?"
    ElseIf InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?" & QUERY_STRING & "&"
    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
    sql = "select count(ID) as idCount from ["& datafrom &"]" & datawhere
    Set rs = db(sql,4)
    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 = db(sql,2)
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 = db(sql,4)
StringText=StringText&"<ul class=""nl"">"&vbCrLf
Dim AutoLink
While Not rs.EOF
    If ISHTML = 1 Then
        AutoLink = ""&OtherName&""&Separated&""&rs("ID")&"."&HTMLName&""
    Else
        AutoLink = "OtherView.Asp?ID="&rs("ID")&""
    End If
StringText=StringText&"<li><span class=""addTime"">"&FormatDate(rs("Updatetime"), 13)&"</span><span class=""className""><a href="""&AutoLink&""">"&rs("OthersName")&"</a></span></li>"&vbCrLf
StringText=StringText&"<li class=""newsLine""></li>"&vbCrLf
    rs.movenext
Wend
StringText=StringText&"</ul>"&vbCrLf
Else
StringText=StringText&"<center>暂无相关信息</center>"
    Exit Function
End If
StringText=StringText&"<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbCrLf
StringText=StringText&"<tr height=""35"">"&vbCrLf
StringText=StringText&"  <td align=""center"">"&vbCrLf
StringText=StringText&"共<strong style=""color:red"">"&idcount&"</strong>条记录 页次：<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页：<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If ISHTML = 1 Then
    If ID = "" Then
        If(page>1) Then StringText=StringText&"<a href="""&OtherSortName&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> "
    Else
        If(page>1) Then StringText=StringText&"<a href="""&OtherSortName&""&Separated&""&ID&""&Separated&"1."&HTMLName&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> "
    End If
Else
    If(page>1) Then StringText=StringText&"<a href="""& myself &"Page=1"" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> "
End If
If page - (pagenc * 2 + 1)<= 0 Then
    pageprevious = 1
Else
    pageprevious = page - (pagenc * 2 + 1)
End If
If ISHTML = 1 Then
    If ID = "" Then
        If(pagenmin>1) Then StringText=StringText&"<a href="""&OtherSortName&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> "
    Else
        If(pagenmin>1) Then StringText=StringText&"<a href="""&OtherSortName&""&Separated&""&ID&""&Separated&""&pageprevious&"."&HTMLName&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> "
    End If
Else
    If(pagenmin>1) Then StringText=StringText&"<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> "
End If
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    StringText=StringText&"&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;"
Else
    If ISHTML = 1 Then
        If ID = "" Then
   StringText=StringText&"[<a href="""&OtherSortName&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]"
        Else
   StringText=StringText&"[<a href="""&OtherSortName&""&Separated&""&ID&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]"
        End If
    Else
   StringText=StringText&"[<a href="""& myself &"Page="&i&""">"& i &"</a>]"
    End If
End If
Next
If page+(pagenc * 2 + 1)>= pagec Then
    pagenext = pagec
Else
    pagenext = page+(pagenc * 2 + 1)
End If
If ISHTML = 1 Then
    If ID = "" Then
        If(pagenmax<pagec) Then StringText=StringText&" <a href="""&OtherSortName&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> "
        If(page<pagec) Then StringText=StringText&" <a href="""&OtherSortName&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>"
    Else
        If(pagenmax<pagec) Then StringText=StringText&" <a href="""&OtherSortName&""&Separated&""&ID&""&Separated&""&pagenext&"."&HTMLName&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> "
        If(page<pagec) Then StringText=StringText&" <a href="""&OtherSortName&""&Separated&""&ID&""&Separated&""&pagec&"."&HTMLName&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>"
    End If
Else
    If(pagenmax<pagec) Then StringText=StringText&" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> "
    If(page<pagec) Then StringText=StringText&" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>"
End If
StringText=StringText&"   </td>"&vbCrLf
StringText=StringText&"  </tr>"&vbCrLf
StringText=StringText&"</table>"&vbCrLf
rs.Close
Set rs = Nothing
WebContentOtherList=StringText
End Function
Function OtherViewdetail()
Dim StringText,ContentStr
StringText=""
ID = request.QueryString("ID")
If ID = "" Or Not IsNumeric(ID) Then
  StringText=StringText&"<center>暂无相关信息</center>"
ElseIf conn.Execute("select * from "&Datapre&"_Others Where ViewFlag and  ID="&ID).EOF Then
   StringText=StringText&"<center>暂无相关信息</center>"
Else
    Dim rs, sql
    
    sql = "select * from ["&Datapre&"_Others] where ViewFlag and ID="&ID
    Set rs = db(sql,3)
End If

   StringText=StringText&"<div class=""mm"">更新时间：<font color=""#666666"">"&FormatDate(rs("UpdateTime"),13)&"</font> 浏览次数：<font color=""#666666"">"
   StringText=StringText&"<script language=""javascript"" src=""HitCount.Asp?id="&rs("ID")&"&LX="&Datapre&"_Others""></script>"
   StringText=StringText&"<script language=""javascript"" src=""HitCount.Asp?action=count&LX="&Datapre&"_Others&id="&rs("ID")&"""></script>"
   StringText=StringText&"</font></div>"
   StringText=StringText&"<div class=""mm"">"
   ContentStr = Split(rs("Content"), "{＄html_Paging＄}")
   Dim i
   Dim pageNum:pageNum=Ubound(ContentStr)
   For i = 0 To pageNum
 StringText=StringText&""&ContentStr(i)
          Next 
      StringText=StringText&" </div>"
	  Dim p
      StringText=StringText&"<div class=""mm"">本文共分"
     For p = 0 to ubound(ContentStr)
      StringText=StringText&"<a href=""OtherView.Asp?ID="&request("ID")&"&page="&p&"""><font color=""red"">"&p+1&"</font></a>"
        Next
      StringText=StringText&"页</div>"

     rs.update
     rs.Close:Set rs = Nothing
	 OtherViewdetail=StringText
End Function
%>