<%
Private Sub tr_topleftnavffyd(topn)
  ishavecolumn = False
  sql = "select columnid,id,colname,jumpurl,queueid from tr_column where isopen=1 order by orderid asc "
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    columnarr = rs.getrows()
    ishavecolumn = True
  End If
  rs.Close
  If ishavecolumn Then
    tralltopleftico = Array("icon-machinery", "icon-creditlevel", "icon-viewgallery", "icon-success", "icon-pic", "icon-information", "icon-code", "icon-folder", "icon-column", "icon-favorites", "icon-shuffling-banner", "icon-data", "icon-hot", "icon-libra", "icon-security", "icon-remind1", "icon-assessedbadge", "icon-agriculture", "icon-link", "icon-pin", "icon-rfq", "icon-rfqquantity", "icon-lights", "icon-electronics", "icon-process", "icon-discount", "icon-clock", "icon-favorite", "icon-email", "icon-all", "icon-office", "icon-good", "icon-task-management", "icon-refresh")
    response.Write "<div class=""trsylefttopmenu"">" & vbCrLf
    response.Write "  <ul>" & vbCrLf
    tmptopn = 0
    For vi = 0 To UBound(columnarr, 2)
      tcolumnid = columnarr(0, vi)
      If tcolumnid = 0 Then
        tmptopn = tmptopn + 1
        If tmptopn>topn Then Exit For
        tid = columnarr(1, vi)
        tcolname = columnarr(2, vi)
        tjumpurl = columnarr(3, vi)
        tqueueid = columnarr(4, vi)
        tmpurlnav = outputurl(tid, "", tjumpurl, ishtml)
        response.Write "<li><i class=""iconfont "&tralltopleftico(tmptopn)&" trmenuliico""></i> <a href="""&tmpurlnav&""" class=""trmenulia"">"&tcolname&"</a> <i class=""iconfont icon-more trmenuliright""></i>" & vbCrLf
        response.Write "<div class=""trsubmenu"">" & vbCrLf
        response.Write "<div class=""trsubleft"">" & vbCrLf
        For si = 0 To UBound(columnarr, 2)'遍历此1级栏目的子栏目，这回是直接生成子栏目了
          scolumnid = columnarr(0, si)
          If scolumnid = tid Then'当此1级栏目有2级子栏目时，输出子栏目菜单
            sid = columnarr(1, si)
            scolname = columnarr(2, si)
            sjumpurl = columnarr(3, si)
            squeueid = columnarr(4, si)
            stmpurlnav = outputurl(sid, "", sjumpurl, ishtml)
            response.Write "<div class=""trsubtt1""><i class=""trsubtt1line""></i><a href="""&stmpurlnav&""">"&scolname&"</a></div>" & vbCrLf
            tmps3cnum = 0
            For s3i = 0 To UBound(columnarr, 2)
              '接下来判断此2级子栏目是否存在3级子栏目
              s3columnid = columnarr(0, s3i)
              If s3columnid = sid Then
                tmps3cnum = tmps3cnum + 1
                s3id = columnarr(1, s3i)
                s3colname = columnarr(2, s3i)
                s3jumpurl = columnarr(3, s3i)
                s3queueid = columnarr(4, s3i)
                s3tmpurlnav = outputurl(s3i, "", s3jumpurl, ishtml)
                If tmps3cnum = 1 Then response.Write "<div class=""trsubtt2 clearfix"">"
                response.Write "<a href="""&s3tmpurlnav&""">"&s3colname&"</a>"
              End If
            Next's3i
            If tmps3cnum>0 Then response.Write "</div>"
          End If
        Next'si
        response.Write "</div>" & vbCrLf
        response.Write "</div>" & vbCrLf
        response.Write "</li>" & vbCrLf
      End If
    Next'vi

    response.Write "</ul>" & vbCrLf
    response.Write "</div>" & vbCrLf

  End If
  Set columnarr = Nothing
End Sub

Private Sub trsytzgg810814(columnid, topn, strn, showclick, showtime, showcolumn, timetype, ordertype, data_type, ulclassname)
  If showcolumn Then
    sqlcol = "select id,colname,jumpurl from tr_column where isopen=1 "
    Set rscol = server.CreateObject("adodb.recordset")
    rscol.Open sqlcol, conn, 0, 1
    If Not rscol.EOF Then
      arrcol = rscol.getrows()
      ishavecol = True
    Else
      ishavecol = False
    End If
    rscol.Close
  End If
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0 "

  sql = trqscrfastsqlstr(columnid, sql)
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "time"
      sql = sql&" order by addtime desc , id desc "
    Case "rnd"
      If data_type = "access" Then
        Randomize
        sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
      ElseIf data_type = "mssql" Then
        sql = sql&" order by newid() "
      End If
    Case Else
      sql = sql&" order by id desc "
  End Select
  response.Write "<ul class="""&ulclassname&""">" & vbCrLf
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    Do While Not rs.EOF
      trclicks = ""
      trtime = ""
      trcolumn = ""
      columnida = rs("columnid")
      coljumpurl = outputurl(columnid, "", "", ishtml)
      If showcolumn Then
        If ishavecol Then
          For efi = 0 To UBound(arrcol, 2)
            arrcoleid = arrcol(0, efi)
            If arrcoleid = columnida Then
              arrcolecolname = arrcol(1, efi)
              arrcolejumpurl = arrcol(2, efi)

              arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)

              trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
              Exit For
            End If
          Next
        End If
      End If
      If showclick Then trclicks = rs("clicks")&"次 | "
      '      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      If showtime Then
        If DateDiff("d", Now(), rs("addtime"))>= 0 Then
          trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
        Else
          trtime = ""&FormatDate(rs("addtime"), timetype)&""
        End If
      End If

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If
      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "</ul>"

End Sub


Private Sub trsyzxhy810814( topn, strn, showtime, timetype, ordertype, data_type, ulclassname)
  sql = "select top "&topn&" * from tr_user where isfree=1 and isdel=0 "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "active"
      sql = sql&" order by lastlogintime desc , id desc "
    Case "time"
      sql = sql&" order by regtime desc , id desc "
    Case "point"
      sql = sql&" order by points desc , id desc "
    Case "rnd"
      If data_type = "access" Then
        Randomize
        sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
      ElseIf data_type = "mssql" Then
        sql = sql&" order by newid() "
      End If
    Case Else
      sql = sql&" order by id desc "
  End Select
  response.Write "<ul class="""&ulclassname&""">" & vbCrLf
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    Do While Not rs.EOF
      trcolumn = ""
	  username = rs("username")
	  leftusername=left(username,2)&"****"&right(username,2)
      If showtime Then
          trtime = ""&FormatDate(rs("regtime"), timetype)&""
      End If

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      response.Write "<li>"&spanstr&showtrtail&"<span class=""limain"" title="""&leftusername&""">"&leftusername&"</span></li>" & vbCrLf
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "</ul>"

End Sub

Private Sub trsyzxcj810814( topn, strn, showtime, timetype, ordertype, data_type, ulclassname)
  sql = "select top "&topn&" * from tr_userbuyrecharge810803 where isdel=0 "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "money"
      sql = sql&" order by moneys desc , id desc "
    Case "rnd"
      If data_type = "access" Then
        Randomize
        sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
      ElseIf data_type = "mssql" Then
        sql = sql&" order by newid() "
      End If
    Case Else
      sql = sql&" order by id desc "
  End Select
  response.Write "<ul class="""&ulclassname&""">" & vbCrLf
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    Do While Not rs.EOF
	  title = rs("title")
	  articleid = rs("articleid")
      If showtime Then
          trtime = ""&FormatDate(rs("addtime"), timetype)&""
      End If

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("articleid"), "", ishtml)
        titlestr = lefts(rs("title"), strn)
      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "</ul>"
End Sub

Function trqscrfastsqlstr(byval columnid, byval sql810518)
  'trwccrfastsqlstr=""
  If columnid<>"" Then
    If columnid = 0 Then
      sql810518 = sql810518 & " and queueid like ',0,%'"
    Else
      getqueueid = getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 2, "")
      sql810518 = sql810518 & " and queueid like '" & getqueueid & "%'"
    End If
  End If
  trqscrfastsqlstr = sql810518
End Function


Private Sub tr_articlelsthotffyd(columnid, topn, strn, showclick, showtime, showcolumn, timetype, ordertype, ulclass)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where ispass=1 and isdel=0 and isabout=0  "
sql=trqscrfastsqlstr(columnid, sql)
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "listtop"
      sql = sql&" order by islisttop desc id desc "
    Case "commend"
      sql = sql&" order by iscommend desc id desc "
    Case "rnd"
'      Randomize
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
  End Select
  response.Write "    <ul class="""&ulclass&""">" & vbCrLf
    rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
      If istophot = 1 Then
        dd = dd + 1
        cc = cc + 1
        If dd>4 Then cc = 4
        spanstr = "<span class=""hotsp trbg"&cc&" "">"&dd&"</span>"
      End If
      If pagetype = 1 Then
        If pagei>= page_size Then Exit Do
        pagei = pagei + 1
        n = n + 1
      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if


      If showclick Then trclicks = rs("clicks")&"次 | "
      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write "      <li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  Else
    If pagetype = 1 Then
      response.Write "<div class=""trzwnr"">抱歉暂无内容</div>"
    End If
  End If
  response.Write "      </ul>" & vbCrLf
  rs.Close
End Sub


private sub tr_focusffyd(columnid, Width, height, topn, textn,trfocuspc,trfocusm)
If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
Sql = "select top "&topn&" Id,title,picfiles,jumpurl,titlecolor,mpicfiles from tr_article where "&andsql&" ispass=1 and isfocus=1 and isdel=0 and isabout=0 "
  Sql = Sql & " order by Id desc"
'  response.write sql
  Rs.Open Sql, Conn, 0, 1
  If rs.EOF Then
    rs.Close
    Exit Sub
  End If
response.write "<div class=""trslider"" id=""trslider""> <a href=""javascript:void(0)"" class=""unslider-arrow prev glyphicon glyphicon-menu-left"" target=""_self"" id=""trleftimg""></a>" & vbCrLf
response.write "<a href=""javascript:void(0)"" class=""unslider-arrow next glyphicon glyphicon-menu-right"" target=""_self"" id=""trrightimg""></a>" & vbCrLf
response.write "<ul class=""tabcon"">" & vbCrLf
  rscount = rs.getrows()
  rs.Close
  i = 0
  ubrscount = UBound(rscount, 2)
  if ubrscount=0 then
  trisdot="false"
  else
  trisdot="true"
  end if

  For i = 0 To ubrscount
    id = rscount(0, i)
    titles = Lefts(rscount(1, i), textn)
    picfiles = rscount(2, i)
    jumpurl = outputurl("", id, rscount(3, i), ishtml)
	mpicfiles = rscount(5, i)
    titlecolor = rscount(4, i)
	    If titlecolor<>"" Then
      titlestr = "<font color="""&rscount(4, i)&""">"&titles&"</font>"
    Else
      titlestr = titles
    End If
response.write "<li><a href="""&jumpurl&""" target=""_blank""><img src="""&picfiles&""" alt="""&rscount(1, i)&""" class=""trfocus1200 "&trfocuspc&""" width="""& Width &""" height="""& height &""" ><img src="""&mpicfiles&""" alt="""&rscount(1, i)&""" class=""trfocus1199 "&trfocusm&""" width=""1000"" height=""300"">" & vbCrLf
if ubrscount<>0 then
response.write "<p>"&titlestr&"</p>" & vbCrLf
end if
response.write "</a></li>" & vbCrLf
Next

response.write "</ul>" & vbCrLf
response.write "</div>" & vbCrLf
response.write "<script type=""text/javascript"">" & vbCrLf
if ubrscount<>0 then

response.write "var otrslider=document.getElementById('trslider');" & vbCrLf
response.write "var otrleftimg=document.getElementById('trleftimg');" & vbCrLf
response.write "var otrrightimg=document.getElementById('trrightimg');" & vbCrLf
response.write "otrslider.onmouseover=function(){" & vbCrLf
response.write "otrleftimg.style.display=""block"";" & vbCrLf
response.write "otrrightimg.style.display=""block"";" & vbCrLf
response.write "}" & vbCrLf
response.write "otrslider.onmouseout=function(){" & vbCrLf
response.write "otrleftimg.style.display=""none"";" & vbCrLf
response.write "otrrightimg.style.display=""none"";" & vbCrLf
response.write "}" & vbCrLf
end if
response.write "$(function() {" & vbCrLf
response.write "	if(window.chrome){$('.trslider li').css('background-size', '100% 100%');}" & vbCrLf
response.write "	$('.trslider').unslider({" & vbCrLf
response.write "		speed: 500," & vbCrLf
response.write "		delay: 3000," & vbCrLf
response.write "		complete: function() {}," & vbCrLf
response.write "		keys: false," & vbCrLf
response.write "		dots: "&trisdot&"," & vbCrLf
response.write "		fluid: true" & vbCrLf
response.write "	});" & vbCrLf
response.write "	var unslider = $('.trslider').unslider();" & vbCrLf
response.write "	$('.unslider-arrow').click(function(){" & vbCrLf
response.write "		var fn = this.className.split(' ')[1];" & vbCrLf
response.write "		unslider.data('unslider')[fn]();" & vbCrLf
response.write "	});" & vbCrLf
response.write "var slides = jQuery('.trslider')," & vbCrLf
response.write "i = 0;" & vbCrLf
response.write "slides.on('swipeleft', function(e) {" & vbCrLf
response.write "unslider.data('unslider')['next']();" & vbCrLf
response.write "}).on('swiperight', function(e) {" & vbCrLf
response.write "unslider.data('unslider')['prev']();" & vbCrLf
response.write "});" & vbCrLf
response.write "});" & vbCrLf
response.write "" & vbCrLf
response.write "</script>" & vbCrLf


End Sub


private sub tr_rolltextffyd810714(columnid, topn, strn, updown, showtype)

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and "
else
andsql =  " queueid like ',0,%' and "
end if
  sql = "select top "&topn&" id,title,jumpurl,titlecolor from tr_article where "&andsql&" isroll=1 and ispass=1 and isdel=0 and isabout=0 "
  sql = sql & " order by id desc"
  rs.Open sql, conn, 0, 1
  response.Write "    <div id=""notice"" class=""trtopnotice "">" & vbCrLf
  response.Write "    <div class=""trtopnoticenr"">" & vbCrLf
  response.Write "      <ul id=""noticecontent"">" & vbCrLf
  If Not rs.EOF Then
    Do While Not rs.EOF
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If
      response.Write "<li><a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "      </ul>" & vbCrLf
  response.Write "    </div>" & vbCrLf
  response.Write "    </div>" & vbCrLf
  response.Write "    <script type=""text/javascript"">" & vbCrLf
'  response.Write "new Marquee([""notice"",""noticecontent""],"&updown&",10,1070,35,20,4000,3000,390,"&showtype&")" & vbCrLf
response.write "jQuery("".trtopnotice"").slide({mainCell:"".trtopnoticenr ul"",autoPage:true,effect:""left"",autoPlay:true,scroll:1,vis:3});"
  response.Write "</script>" & vbCrLf
End Sub


function tr_syindextopnewsffyd(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,data_type)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0 and isindextop=1 "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
    Case else
      sql = sql&" order by id desc "
  End Select
'  response.Write "    <ul class=""trsynewsul clearfix"">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
'      If istophot = 1 Then
'        dd = dd + 1
'        cc = cc + 1
'        If dd>4 Then cc = 4
'        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
'      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  columnid=rs("columnid")
'	  coljumpurl=outputurl(columnid, "","", ishtml)
	  
'arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
'If showcolumn Then trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "

If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if


      If showclick Then trclicks = rs("clicks")&" | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
	  
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if
	  
	  
      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write "<li class=""col-sm-6"">"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&RemoveHTML(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
'  response.Write "      </ul>" & vbCrLf
end function


function tr_synewsffyd(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,data_type)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0  "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
    Case else
      sql = sql&" order by id desc "
  End Select
'  response.Write "    <ul class=""trsynewsul clearfix"">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
'      If istophot = 1 Then
'        dd = dd + 1
'        cc = cc + 1
'        If dd>4 Then cc = 4
'        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
'      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  columnid=rs("columnid")
'	  coljumpurl=outputurl(columnid, "","", ishtml)
	  
'arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
'If showcolumn Then trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "

If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if


      If showclick Then trclicks = rs("clicks")&" | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write "<li class=""col-sm-6"">"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&RemoveHTML(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
'  response.Write "      </ul>" & vbCrLf
end function


function tr_indexcommendlistffyd(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,istophot)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  


If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=0
'if getqueueid=0 then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
'    Case "new"
'      sql = sql&" order by id desc "
'    Case "hot"
'      sql = sql&" order by clicks desc , id desc "
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
'    Case "rnd"
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0  "
'    If columnid<>"" Then
'      sql = sql & " and queueid like '%," & columnid & ",%'"
'    End If
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
'      sql = sql&" order by clicks desc , id desc "
'    Case "listtop"
'      sql = sql&" order by islisttop desc , addtime desc ,id desc "
'    Case "commend"
'      sql = sql&" order by iscommend desc , addtime desc ,id desc "
    Case "rnd"
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
  End Select
  response.Write "    <ul class=""trindexcommendul"">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
      If istophot = 1 Then
        dd = dd + 1
        cc = cc + 1
        If dd>4 Then cc = 4
        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  columnid=rs("columnid")
'	  coljumpurl=outputurl(columnid, "","", ishtml)
'arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
	  
'If showcolumn Then
'trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "

'end if

If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if

      If showclick Then trclicks = rs("clicks")&" | "
      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If
      nn = nn + 1
      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&RemoveHTML(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
  response.Write "      </ul>" & vbCrLf
end function


Private Sub tr_imgtextffyd(columnid, topn, imgw, imgh, tstrn, nstrn, isdes)

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if

  sql = "select top "&topn&" id,title,jumpurl,titlecolor,picfiles,descriptions,content from tr_article where "&andsql&" ispass=1 and isdel=0 and isimgtext=1 and isabout=0 "
  sql = sql & " order by id desc"
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
    jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
desstr = lefts(RemoveHTML(rs("descriptions")), nstrn)
if desstr="" then
desstr = lefts(RemoveHTML(left(rs("content"),500)), nstrn)
if len(desstr)<nstrn/2 then desstr = lefts(RemoveHTML(left(rs("content"),2500)), nstrn)
if len(desstr)<nstrn/2 then desstr = lefts(RemoveHTML(rs("content")), nstrn)
end if
    Do While Not rs.EOF
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
      Else
        titlestr = lefts(rs("title"), tstrn)
      End If
response.write "<div class=""trimgtext clearfix""><a href="""&jumpurl&""" ><img src="""&rs("picfiles")&""" width="""&imgw&""" height="""&imgh&"""/></a>" & vbCrLf
response.write "<div class=""trtext1 trovh "">" & vbCrLf
response.write "<h3><a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></h3>" & vbCrLf
response.write "<p>"&desstr&"</p>" & vbCrLf
response.write "</div>" & vbCrLf
response.write "</div>"
      rs.movenext
    Loop
  End If
  rs.Close
End Sub

function tr_sybksmalllistffyd(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,istophot,trnumclass)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  


andsql=""
  Select Case ordertype
    Case "listtop"
      andsql = " and islisttop=1 "
    Case "commend"
      andsql = " and iscommend=1 "
  End Select
If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  ""&andsql&" and queueid like '" & getqueueid & "%' "
end if
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where ispass=1 and isdel=0 and isabout=0 "&andsql&" "
  Select Case ordertype
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
    Case else
      sql = sql&" order by id desc "
  End Select
  response.Write "    <ul class=""tridxul "&trnumclass&""">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
'      If istophot = 1 Then
'        dd = dd + 1
'        cc = cc + 1
'        If dd>4 Then cc = 4
'        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
'      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
'If showcolumn Then
'	  columnida=rs("columnid")
'	  coljumpurl=outputurl(columnida, "","", ishtml)
'arcolname=getfieldvalue("tr_column", "colname", "and id="&columnida&"", 1, "")
'trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "
'end if

If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if

      If showclick Then trclicks = rs("clicks")&" | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
  response.Write "      </ul>" & vbCrLf
end function


Private Sub tr_rollimgkpffyd(columnid, topn, tstrn, imgw, imgh, boxw, boxh,scrollStep)

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if


  sql = "select top "&topn&" id,title,jumpurl,titlecolor,picfiles from tr_article where "&andsql&" ispass=1 and isdel=0 and isrollimg=1 and isabout=0 "
  sql = sql & " order by id desc"
  rs.Open sql, conn, 0, 1
  response.Write "  <div id=""trrollimgnr"" class=""trrollimgnr"">" & vbCrLf
  response.Write "    <ul id=""trrollimgul"">" & vbCrLf
  If Not rs.EOF Then
    Do While Not rs.EOF
      If Len(rs("picfiles"))>8 Then
        jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
        If rs("titlecolor")<>"" Then
          titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
        Else
          titlestr = lefts(rs("title"), tstrn)
        End If
        response.Write "      <li><a href="""&jumpurl&""" title="""&rs("title")&"""><img src="""&rs("picfiles")&""" width="""&imgw&""" height="""&imgh&""" alt="""&rs("title")&"""/></a><span><a href="""&jumpurl&""">"&titlestr&"</a></span></li>" & vbCrLf
      End If
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "    </ul>" & vbCrLf
  response.Write "  </div>" & vbCrLf
  response.Write "  <script type=""text/javascript"">" & vbCrLf
  response.Write "new Marquee(" & vbCrLf
  response.Write "{" & vbCrLf
  response.Write "	MSClass	  : [""trrollimgnr"",""trrollimgul""]," & vbCrLf
  response.Write "	Direction : 2," & vbCrLf
  response.Write "	Step	  : 0.3," & vbCrLf
  response.Write "	Width	  : "&boxw&"," & vbCrLf
  response.Write "	Height	  : "&boxh&"," & vbCrLf
  response.Write "	Timer	  : 20," & vbCrLf
  response.Write "	DelayTime : 3000," & vbCrLf
  response.Write "	WaitTime  : 0," & vbCrLf
  response.Write "	ScrollStep: "&scrollStep&"," & vbCrLf
  response.Write "	SwitchType: 0," & vbCrLf
  response.Write "	AutoStart : true" & vbCrLf
  response.Write "});" & vbCrLf
  response.Write "</script> " & vbCrLf
End Sub


private sub trqssyimglistffyd(columnid,topn,strn, ordertype,data_type,trqscolbs3)
If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,picfiles,content from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0 "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	elseif data_type="mssql" then
      sql = sql&" order by newid() "
	end if
  End Select
rs.open sql,conn,0,1
  If Not rs.EOF Then
'    trtail = ""
'    nn = 0
'    dd = 0
    Do While Not rs.EOF

      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

'      nn = nn + 1
'      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&nohtmldelimg810518(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf

      If Len(rs("picfiles"))>8 Then
	  rspicfiles170422=formaturl(rs("picfiles"))
	  else
	  if instr(rs("content"),"<img")>0 then
	  rspicfiles170422=formaturl(Frist_Pic810518(rs("content")))
	  else
	  rspicfiles170422=""
	  end if
	  end if


response.write "<li class=""col-lg-3 col-md-3 col-sm-4 col-xs-6 "&trqscolbs3&"""><a href="""&jumpurl&""" title="""&rs("title")&""" class=""trqsindeximga""><img src=""" & rspicfiles170422 & """ alt="""&rs("title")&"""/></a><p><a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></p></li>" & vbCrLf




rs.movenext
loop
end if
rs.close

end sub


Private Sub tr_getlinkffyd(topn, imgw, imgh, strn)
  sql = "select top "&topn&" id,title,homepage,types,picfile from tr_link where ispass=1 order by orderid asc "
  rs.Open sql, conn, 0, 1
  response.Write "  <div class="" linktext clearfix"">" & vbCrLf
  response.write "<ul>" & vbCrLf
  haveimglink = 0
  If Not rs.EOF Then
    Do While Not rs.EOF
      If rs("types") = 1 Then
        response.Write "      <li><a href="""&rs("homepage")&""" title="""&rs("title")&""">"&lefts(rs("title"), strn)&"</a></li>" & vbCrLf
      ElseIf rs("types") = 2 Then
        imglinktmp = imglinktmp&" <li><a href="""&rs("homepage")&""" title="""&rs("title")&"""><img src="""&rs("picfile")&""" width="""&imgw&""" height="""&imgh&""" /></a></li>" & vbCrLf
        haveimglink = 1
      End If
      rs.movenext
    Loop
  End If
  rs.Close
  response.Write "    </ul>" & vbCrLf
  response.Write "  </div>" & vbCrLf
  If haveimglink = 1 Then
    response.Write "  <div class="" linkimg clearfix trovh"">" & vbCrLf
    response.Write "    <ul class="""">" & vbCrLf
    response.Write imglinktmp
    response.Write "    </ul>" & vbCrLf
    response.Write "  </div>" & vbCrLf
  End If
End Sub


Private Sub tr_footnavffyd(columnid, topn, tstrn)
  Sql = "select top "&topn&" Id,title,picfiles,jumpurl,titlecolor from tr_article where ispass=1 and isdel=0 and isabout=1 "
  If columnid<>"" Then Sql = Sql & " and queueid like '%," & columnid & ",%'"
  Sql = Sql & " order by Id desc"
  Rs.Open Sql, Conn, 0, 1
  hh = 0
  If Not rs.EOF Then
    Do While Not rs.EOF
      hh = hh + 1
      tmpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If hh>1 Then linestr = " | "
      response.Write linestr&" <a href="""&tmpurl&""" title="""&rs("title")&""">"&lefts(rs("title"), tstrn)&"</a>"
      rs.movenext
    Loop
  End If
  rs.Close
End Sub



private sub trqs_imgtextlisttopffyd(topn,columnid, tstrn, nstrn,isaddtime,isauthor,isshare,timetype)
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,picfiles,descriptions,content,addtime,columnid,author from tr_article where ispass=1 and isdel=0 and isabout=0 and islisttop=1 "
  sql=trqscrfastsqlstr810518(columnid,sql)
  sql = sql & " order by id desc"
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
response.write "	<!-- bdshare start -->" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshare_js"" data=""type=tools&amp;uid=483253"" ></script>" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshell_js""></script>" & vbCrLf
response.write "	<script type=""text/javascript"">" & vbCrLf
response.write "	(function(exports){" & vbCrLf
response.write "	  exports.bds_config = {" & vbCrLf
response.write "	      // appkey" & vbCrLf
response.write "	      ""snsKey"": {" & vbCrLf
response.write "	          'tsina': 'false'," & vbCrLf
response.write "	          'tqq': ''," & vbCrLf
response.write "	          't163': ''," & vbCrLf
response.write "	          'tsohu': ''" & vbCrLf
response.write "	      }," & vbCrLf
response.write "	      // @weibo id" & vbCrLf
response.write "	      'wbUid':''," & vbCrLf
response.write "	      'searchPic':false" & vbCrLf
response.write "	  };" & vbCrLf
response.write "	  document.getElementById(""bdshell_js"").src = ""http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion="" + Math.ceil(new Date()/3600000);" & vbCrLf
response.write "	})(window);" & vbCrLf
response.write "	</script>" & vbCrLf
response.write "	<style type=""text/css"">" & vbCrLf
response.write "	#bdshare{float:none !important;font-size:13px !important;padding-bottom:0 !important;}" & vbCrLf
response.write "	#bdshare span.bds_more{display:inline !important;padding:0 !important;float:none !important;font-family:""Microsoft YaHei"",""微软雅黑"" !important;background-image:none !important;}" & vbCrLf
response.write "	</style>" & vbCrLf
response.write "	<!-- bdshare end -->" & vbCrLf
    Do While Not rs.EOF
    jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
	desstr=""
      if rs("descriptions")<>"" and not isnull(rs("descriptions")) then 
	  desstr = lefts(nohtmldelimg810518(rs("descriptions")), nstrn)
	  end if
if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
      desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
	  if instr(desstr,"<")>0 then desstr=left(desstr,InStrRev (desstr,"<"))
	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
	  if instr(desstr,"<")>0 then desstr=replace(desstr,"<","")
End If


'if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
'      desstr = lefts(nohtmldelimg810518(left(rs("content"),1800)), nstrn)
''	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
'	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
'End If
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
      Else
        titlestr = lefts(rs("title"), tstrn)
      End If
      addtime = rs("addtime")
      author = rs("author")
      If Len(rs("picfiles"))>8 Then
	  rspicfiles170422=formaturl810518(rs("picfiles"))
	  else
	  if instr(rs("content"),"<img")>0 then
	  rspicfiles170422=Frist_Pic810518(rs("content")) 
	  rspicfiles170422=formaturl810518(rspicfiles170422)
	  else
	  rspicfiles170422=""
	  end if
	  end if
if isshare then
if instr(jumpurl,"http")=1 then
trqsshareurl=jumpurl
else
trqsshareurl= geturl810518https&jumpurl
end if
end if
if len(rspicfiles170422)>8 then
response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrimg"" title="""&rs("title")&"""><img src="""&rspicfiles170422&"""></a>" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3><span class=""trqslisttopstr"">置顶</span> "&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf
if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"
else
response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3><span class=""trqslisttopstr"">置顶</span> "&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf
if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"
end if
rs.movenext
Loop
End If
rs.Close
End Sub


private sub trqs_imgtextlistffyd(columnid, tstrn, nstrn,page_size,pageno,isaddtime,isauthor,isshare,timetype)
    pagei = 0
    n = (pageno -1) * page_size
  sql = "select id,title,jumpurl,titlecolor,picfiles,descriptions,content,addtime,columnid,author from tr_article where ispass=1 and isdel=0 and isabout=0 "
'  sql =  " ispass=1 and isdel=0 and isabout=0 "
  sql=trqscrfastsqlstr810518(columnid,sql)
  sql = sql & " order by id desc"

'table170720=" tr_article "
'selectstr170720=" * "
'keystr170720=" id "
'wherestr170720=sql
'pageno170720=pageno
'page_size170720=page_size
'elseorderby170720=""
'tpagecount170720=trseadatacount810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true)
'sql=trseadatasql810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true,tpagecount170720)
'ctr_page.page_count=tpagecount170720
'rs.Open sql,conn,1,1


    Call ctr_page.create_rs(sql, rs, conn, page_size, pageno)
  If Not rs.EOF Then
response.write "	<!-- bdshare start -->" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshare_js"" data=""type=tools&amp;uid=483253"" ></script>" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshell_js""></script>" & vbCrLf
response.write "	<script type=""text/javascript"">" & vbCrLf
response.write "	(function(exports){" & vbCrLf
response.write "	  exports.bds_config = {" & vbCrLf
response.write "	      // appkey" & vbCrLf
response.write "	      ""snsKey"": {" & vbCrLf
response.write "	          'tsina': 'false'," & vbCrLf
response.write "	          'tqq': ''," & vbCrLf
response.write "	          't163': ''," & vbCrLf
response.write "	          'tsohu': ''" & vbCrLf
response.write "	      }," & vbCrLf
response.write "	      // @weibo id" & vbCrLf
'response.write "	      'wbUid':'1638781994'," & vbCrLf
response.write "	      'searchPic':false" & vbCrLf
response.write "	  };" & vbCrLf
response.write "	  document.getElementById(""bdshell_js"").src = ""http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion="" + Math.ceil(new Date()/3600000);" & vbCrLf
response.write "	})(window);" & vbCrLf
response.write "	</script>" & vbCrLf
response.write "	<style type=""text/css"">" & vbCrLf
response.write "	#bdshare{float:none !important;font-size:13px !important;padding-bottom:0 !important;}" & vbCrLf
response.write "	#bdshare span.bds_more{display:inline !important;padding:0 !important;float:none !important;font-family:""Microsoft YaHei"",""微软雅黑"" !important;background-image:none !important;}" & vbCrLf
response.write "	</style>" & vbCrLf
response.write "	<!-- bdshare end -->" & vbCrLf
    Do While Not rs.EOF
        If pagei>= page_size Then Exit Do
        pagei = pagei + 1
    jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
	desstr=""
      if rs("descriptions")<>"" and not isnull(rs("descriptions")) then 
	  desstr = lefts(nohtmldelimg810518(rs("descriptions")), nstrn)
	  end if
	  
if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
      desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
	  if instr(desstr,"<")>0 then desstr=left(desstr,InStrRev (desstr,"<"))
	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
	  if instr(desstr,"<")>0 then desstr=replace(desstr,"<","")
End If
	  
	  
'if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
'      desstr = lefts(nohtmldelimg810518(left(rs("content"),1800)), nstrn)
''	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
'	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
'End If
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
      Else
        titlestr = lefts(rs("title"), tstrn)
      End If
      addtime = rs("addtime")
      author = rs("author")
      If Len(rs("picfiles"))>8 Then
	  rspicfiles170422=formaturl810518(rs("picfiles"))
	  else
	  if instr(rs("content"),"<img")>0 then
	  rspicfiles170422=Frist_Pic810518(rs("content")) 
	  rspicfiles170422=formaturl810518(rspicfiles170422)
	  else
	  rspicfiles170422=""
	  end if
	  end if
if isshare then
if instr(jumpurl,"http")=1 then
trqsshareurl=jumpurl
else
trqsshareurl= geturl810518https&jumpurl
end if
end if
if len(rspicfiles170422)>8 then
response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrimg"" title="""&rs("title")&"""><img src="""&rspicfiles170422&"""></a>" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3>"&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf
if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if
'if isaddtime then response.write "时间："&FormatDate810518(addtime, 4)&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"
else
response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3>"&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf
if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if
'if isaddtime then response.write "时间："&FormatDate810518(addtime, 4)&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"
end if
      rs.movenext
    Loop
  End If
  rs.Close
  if ishtml=1 then
    response.Write ctr_page.create_page("", ctr_page.page_count, pageno, "trpage")
	else
    response.Write ctr_page.html_page("", ctr_page.page_count, pageno, "trpage")
end if
End Sub


private sub trqs_imglistffyd(columnid, tstrn,page_size,pageno,trqscolbs3)
    pagei = 0
    n = (pageno -1) * page_size
  sql = "select id,title,jumpurl,titlecolor,picfiles,descriptions,content,addtime,columnid,author from tr_article where ispass=1 and isdel=0 and isabout=0 "
'sql =  " IsPass=1 and IsDel=0 "
  sql=trqscrfastsqlstr810518(columnid,sql)
  sql = sql & " order by id desc"



'table170720=" tr_article "
'selectstr170720=" * "
'keystr170720=" id "
'wherestr170720=sql
'pageno170720=pageno
'page_size170720=page_size
'elseorderby170720=""
'tpagecount170720=trseadatacount810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true)
'sql=trseadatasql810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true,tpagecount170720)
'ctr_page.page_count=tpagecount170720
'rs.Open sql,conn,1,1



    Call ctr_page.create_rs(sql, rs, conn, page_size, pageno)
  If Not rs.EOF Then
response.write "<div class=""trqslistimg""><ul>"
    Do While Not rs.EOF
        If pagei>= page_size Then Exit Do
        pagei = pagei + 1
    jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
	desstr=""
      if rs("descriptions")<>"" and not isnull(rs("descriptions")) then 
	  desstr = lefts(nohtmldelimg810518(rs("descriptions")), nstrn)
	  end if
if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
      desstr = lefts(nohtmldelimg810518(left(rs("content"),1800)), nstrn)
'	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
End If
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
      Else
        titlestr = lefts(rs("title"), tstrn)
      End If
      addtime = rs("addtime")
      author = rs("author")
      If Len(rs("picfiles"))>8 Then
	  rspicfiles170422=formaturl810518(rs("picfiles"))
	  else
	  if instr(rs("content"),"<img")>0 then
	  rspicfiles170422=Frist_Pic810518(rs("content")) 
	  rspicfiles170422=formaturl810518(rspicfiles170422)
	  else
	  rspicfiles170422=""
	  end if
	  end if
if isshare then
if instr(jumpurl,"http")=1 then
trqsshareurl=jumpurl
else
trqsshareurl= geturl810518https&jumpurl
end if
end if
'if len(rspicfiles170422)>8 then
response.write "<li class=""col-lg-3 col-md-3 col-sm-4 col-xs-6 "&trqscolbs3&"""><a href="""&jumpurl&""" title="""&rs("title")&""" class=""trqsindeximga""><img src=""" & rspicfiles170422 & """ alt="""&rs("title")&"""/></a><p><a href="""&jumpurl&""" title="""&rs("title")&""">"&titlestr&"</a></p></li>" & vbCrLf
      rs.movenext
    Loop
	response.write "</ul></div>"
  End If
  rs.Close
  if ishtml=1 then
    response.Write ctr_page.create_page("", ctr_page.page_count, pageno, "trpage")
	else
    response.Write ctr_page.html_page("", ctr_page.page_count, pageno, "trpage")
end if
End Sub


function tr_smalllistrightffyd(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,data_type)
If showcolumn Then
sqlcol="select id,colname,jumpurl from tr_column where isopen=1 "
set rscol=server.createobject("adodb.recordset")
rscol.open sqlcol,conn,0,1
if not rscol.eof then
arrcol=rscol.getrows()
ishavecol=true
else
ishavecol=false
end if
rscol.close
end if  

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0  "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
    Case else
      sql = sql&" order by id desc "
  End Select
  response.Write "    <ul class=""trsmallblock1ul"">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
'      If istophot = 1 Then
'        dd = dd + 1
'        cc = cc + 1
'        If dd>4 Then cc = 4
'        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
'      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  columnid=rs("columnid")
'	  coljumpurl=outputurl(columnid, "","", ishtml)
	  
'arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
'If showcolumn Then trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "
If showcolumn Then
if ishavecol then
for efi=0 to ubound(arrcol,2)
arrcoleid=arrcol(0,efi)
if arrcoleid= columnida then
arrcolecolname=arrcol(1,efi)
arrcolejumpurl=arrcol(2,efi)
arrcolejumpurl = outputurl(arrcoleid, "", arrcolejumpurl, ishtml)
trcolumn = "<a href="""&arrcolejumpurl&""" >["&lefts(arrcolecolname, 10)&"]</a> | "
exit for
end if
next
end if
end if


      If showclick Then trclicks = rs("clicks")&"次 | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if

      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write "<li>"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&RemoveHTML(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
  response.Write "      </ul>" & vbCrLf
end function


private sub trqs_imgtextscffyd(keyword, tstrn, nstrn,page_size,pageno,isaddtime,isauthor,isshare,timetype)
    pagei = 0
    n = (pageno -1) * page_size
  sql = "select id,title,jumpurl,titlecolor,picfiles,descriptions,content,addtime,columnid,author from tr_article where ispass=1 and isdel=0 and isabout=0 "
'     sql =  "  ispass=1 and isdel=0 and isabout=0  "
      sql = sql & " and title like '%" & keyword & "%'"
'  sql = sql & " order by id desc"

'table170720=" tr_article "
'selectstr170720=" * "
'keystr170720=" id "
'wherestr170720=sql
'pageno170720=pageno
'page_size170720=page_size
'elseorderby170720=""
'tpagecount170720=trseadatacount810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true)
'sql=trseadatasql810620( table170720, selectstr170720, keystr170720, wherestr170720, pageno170720, page_size170720,elseorderby170720,true,tpagecount170720)
'ctr_page.page_count=tpagecount170720
'rs.Open sql,conn,1,1



    Call ctr_page.create_rs(sql, rs, conn, page_size, pageno)
  If Not rs.EOF Then
  

response.write "	<!-- bdshare start -->" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshare_js"" data=""type=tools&amp;uid=483253"" ></script>" & vbCrLf
response.write "	<script type=""text/javascript"" id=""bdshell_js""></script>" & vbCrLf
response.write "	<script type=""text/javascript"">" & vbCrLf
response.write "	(function(exports){" & vbCrLf
response.write "	  exports.bds_config = {" & vbCrLf
response.write "	      // appkey" & vbCrLf
response.write "	      ""snsKey"": {" & vbCrLf
response.write "	          'tsina': 'false'," & vbCrLf
response.write "	          'tqq': ''," & vbCrLf
response.write "	          't163': ''," & vbCrLf
response.write "	          'tsohu': ''" & vbCrLf
response.write "	      }," & vbCrLf
response.write "	      // @weibo id" & vbCrLf
response.write "	      'wbUid':'1638781994'," & vbCrLf
response.write "	      'searchPic':false" & vbCrLf
response.write "	  };" & vbCrLf
response.write "	  document.getElementById(""bdshell_js"").src = ""http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion="" + Math.ceil(new Date()/3600000);" & vbCrLf
response.write "	})(window);" & vbCrLf
response.write "	</script>" & vbCrLf
response.write "	<style type=""text/css"">" & vbCrLf
response.write "	#bdshare{float:none !important;font-size:13px !important;padding-bottom:0 !important;}" & vbCrLf
response.write "	#bdshare span.bds_more{display:inline !important;padding:0 !important;float:none !important;font-family:""Microsoft YaHei"",""微软雅黑"" !important;background-image:none !important;}" & vbCrLf
response.write "	</style>" & vbCrLf
response.write "	<!-- bdshare end -->" & vbCrLf
  
    Do While Not rs.EOF
        If pagei>= page_size Then Exit Do
        pagei = pagei + 1
    jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
	desstr=""
      if rs("descriptions")<>"" and not isnull(rs("descriptions")) then 
	  desstr = lefts(nohtmldelimg810518(rs("descriptions")), nstrn)
	  end if
	  
if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
      desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
	  if instr(desstr,"<")>0 then desstr=left(desstr,InStrRev (desstr,"<"))
	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
	  if instr(desstr,"<")>0 then desstr=replace(desstr,"<","")
End If

'if desstr="" and rs("content")<>"" and not isnull(rs("content")) then
'      desstr = lefts(nohtmldelimg810518(left(rs("content"),1800)), nstrn)
''	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(left(rs("content"),2500)), nstrn)
'	  if len(desstr)<nstrn/2 and len(rs("content"))>nstrn then desstr = lefts(nohtmldelimg810518(rs("content")), nstrn)
'End If
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), tstrn)&"</font>"
      Else
        titlestr = lefts(rs("title"), tstrn)
      End If
'      columnid = rs("columnid")
      addtime = rs("addtime")
      author = rs("author")
	  
      If Len(rs("picfiles"))>8 Then
	  rspicfiles170422=formaturl810518(rs("picfiles"))
	  else
	  if instr(rs("content"),"<img")>0 then
	  rspicfiles170422=Frist_Pic810518(rs("content")) 
	  rspicfiles170422=formaturl810518(rspicfiles170422)
	  else
	  rspicfiles170422=""
	  end if
	  end if
if isshare then
if instr(jumpurl,"http")=1 then
trqsshareurl=jumpurl
else
trqsshareurl= geturl810518https&jumpurl
end if
end if



if len(rspicfiles170422)>8 then

response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrimg"" title="""&rs("title")&"""><img src="""&rspicfiles170422&"""></a>" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3>"&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf

if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if


'if isaddtime then response.write "时间："&FormatDate810518(addtime, 4)&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"


else

response.write "<div class=""trqslistimgstrbox clearfix"">" & vbCrLf
response.write "<a href="""&jumpurl&""" target=""_blank"" class=""trqslistimgstrdesa"">" & vbCrLf
response.write "<h3>"&titlestr&"</h3>" & vbCrLf
'response.write "<p class=""trqslistimgstrdes"">"&desstr&"</p>" & vbCrLf
response.write "</a>" & vbCrLf
response.write "<div class=""trqslistimgstrb"">" & vbCrLf

if isaddtime then
if datediff("d",now(),addtime)>=0 then
trtime = "<span class=""trnewtime178888"">"&FormatDate810518(addtime, timetype)&"</span>"
else
trtime = ""&FormatDate(rs("addtime"), timetype)&""
end if
response.write "时间："&trtime&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
else
trtime=""
end if


'if isaddtime then response.write "时间："&FormatDate810518(addtime, 4)&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isauthor then response.write "作者："&author&" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
if isshare then response.write "<span id=""bdshare"" class=""bdshare_t bds_tools get-codes-bdshare feed-card-share trwcimgstrca"" data=""text:'"&rs("title")&"',url:'"&trqsshareurl&"',pic:'"&rspicfiles170422&"'""><span class=""bds_more"">分享 <i class=""glyphicon glyphicon-share-alt trwcshare""></i> </span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & vbCrLf
response.write "</div>"
response.write "</div>"
end if
      rs.movenext
    Loop
  End If
  rs.Close
'  if ishtml=1 then
    response.Write ctr_page.create_page("", ctr_page.page_count, pageno, "trpage")
'	else
'    response.Write ctr_page.html_page("", ctr_page.page_count, pageno, "trpage")
'end if
End Sub

private sub tr_headnavffyd(topn,queueid)
trnavnum=0
ishavecolumn=false
  sql = "select top "&topn&" columnid,id,colname,jumpurl,queueid,isnav from tr_column where isopen=1 order by orderid asc "
  rs.Open sql, conn, 0, 1
  If Not rs.EOF Then
columnarr=rs.getrows()
ishavecolumn=true
end if 
rs.close
if ishavecolumn then
for vi=0 to ubound(columnarr,2)
if trnavnum>=topn then exit for
trnavnum=trnavnum+1
tcolumnid=columnarr(0,vi)
tid=columnarr(1,vi)
tcolname=columnarr(2,vi)
tjumpurl=columnarr(3,vi)
tqueueid=columnarr(4,vi)
tisnav=columnarr(5,vi)
if tcolumnid=0 then
if instr(queueid,","&tid&",")>0 then
trnavac = "class=""trnavac"""
else
trnavac = ""
end if
if tisnav=1 then
trpcnavhidestr=""
else
trpcnavhidestr="class=""trpcnavhide"""
end if
tmpurlnav = outputurl(tid, "", tjumpurl, ishtml)
for si=0 to  ubound(columnarr,2)'遍历此1级栏目的子栏目
havesoncol=false 
scolumnid=columnarr(0,si)
if scolumnid=tid then'当此栏目有子栏目时，将havesoncol设置为真，方便下一步读取
havesoncol=true
exit for
end if
next
if havesoncol then'当有子栏目时
response.Write "<li onmouseover=""display1110(this)"" onmouseout=""hide1110(this)"" "&trpcnavhidestr&"> <a href="""&tmpurlnav&""" "&trnavac&" target=""_self"">"&tcolname&"</a><i class=""glyphicon glyphicon-menu-down trmnavshowdrop""></i>" & VBCRLF
response.Write "<ul>" & VBCRLF
for si=0 to  ubound(columnarr,2)'遍历此1级栏目的子栏目，这回是直接生成子栏目了
scolumnid=columnarr(0,si)
sid=columnarr(1,si)
scolname=columnarr(2,si)
sjumpurl=columnarr(3,si)
squeueid=columnarr(4,si)
sisnav=columnarr(5,si)
if sisnav=1 then
strpcnavhidestr=""
else
strpcnavhidestr="class=""trpcnavhide"""
end if

stmpurlnav = outputurl(sid, "", sjumpurl, ishtml)
if scolumnid=tid then'当此栏目有子栏目时，输出子栏目菜单
response.Write "<li "&strpcnavhidestr&"><a href="""&stmpurlnav&""" target=""_self"">"&scolname&"</a></li>" & VBCRLF
end if
next
response.Write "</ul>" & VBCRLF
response.Write "</li>" & VBCRLF
else
response.Write "<li "&trpcnavhidestr&"> <a href="""&tmpurlnav&""" "&trnavac&" target=""_self"">"&tcolname&"</a></li>" & VBCRLF
end if
end if
next
end if
set columnarr=nothing
End sub


function tr_syindextopnewsffyd178888(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,data_type)

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0 and isindextop=1 "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "
    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
    Case else
      sql = sql&" order by id desc "
  End Select
'  response.Write "    <ul class=""trsynewsul clearfix"">" & vbCrLf
'  response.write sql
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
    Do While Not rs.EOF
'      If istophot = 1 Then
'        dd = dd + 1
'        cc = cc + 1
'        If dd>4 Then cc = 4
'        spanstr = "<span class=""hotspdw trbgdw"&cc&" "">"&dd&"</span>"
'      End If
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  columnid=rs("columnid")
	  coljumpurl=outputurl(columnid, "","", ishtml)
	  
arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
If showcolumn Then trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "
      If showclick Then trclicks = rs("clicks")&" | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
	  
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if
	  
	  
      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If

      nn = nn + 1
      response.Write tojsplcjffyd171109a("<li class=""col-sm-6"">"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&replace(rs("title")," ","")&""">"&titlestr&"</a></li>") & vbCrLf

'      response.Write "<li class=""col-sm-6"">"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&RemoveHTML(rs("title"))&""">"&titlestr&"</a></li>" & vbCrLf
      rs.movenext
    Loop
  End If
rs.close
'  response.Write "      </ul>" & vbCrLf
end function

function tr_synewlistturnpageffyd178888a(columnid,topn,strn,showclick, showtime, showcolumn, timetype, ordertype,data_type)

If columnid<>"" Then
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 1, "")
if getqueueid="" then getqueueid=",0,"
andsql =  " queueid like '" & getqueueid & "%' and"
else
andsql =  " queueid like ',0,%' and"
end if
  Select Case ordertype
    Case "listtop"
      andsql = andsql&" islisttop=1 and "
    Case "commend"
      andsql = andsql&" iscommend=1 and "
  End Select
  sql = "select top "&topn&" id,title,jumpurl,titlecolor,addtime,clicks,columnid,columnname from tr_article where "&andsql&" ispass=1 and isdel=0 and isabout=0  "
  Select Case ordertype
    Case "new"
      sql = sql&" order by id desc "

    Case "hot"
      sql = sql&" order by clicks desc , id desc "
    Case "rnd"
	if data_type="access" then
      Randomize
      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
	 elseif data_type="mssql" then
      sql = sql&" order by newid() "
	 end if
'      Randomize
'      sql = sql&" order by Rnd(-(id+"&CInt(Int((30 + 1) * Rnd) )&")) , id desc "
    Case else
      sql = sql&" order by id desc "
  End Select
'  response.Write tojsplcj171109a("    <ul class=""trsynewsul clearfix disnone"" id=""trturnpagesynewsul178888"">") & vbCrLf
'  response.write sql
'  response.end
rs.open sql,conn,0,1
  If Not rs.EOF Then
    trtail = ""
    nn = 0
    dd = 0
'	response.write "var tmptrpageturnlist178888="""""& vbCrLf
    Do While Not rs.EOF
'	for i=0 to 30
      trclicks = ""
      trtime = ""
      trcolumn = ""
	  
If showcolumn Then
columnid=rs("columnid")
coljumpurl=outputurl(columnid, "","", ishtml)
arcolname=getfieldvalue("tr_column", "colname", "and id="&columnid&"", 1, "")
trcolumn = "<a href="""&coljumpurl&""" >["&lefts(arcolname, 10)&"]</a> | "
end if
      If showclick Then trclicks = rs("clicks")&" | "
'      If showtime Then trtime = FormatDate(rs("addtime"), timetype)
      If showtime Then
	  if datediff("d",now(),rs("addtime"))>=0 then
      trtime = "<span class=""trnewtime178888"">"&FormatDate(rs("addtime"), timetype)&"</span>"
	  else
      trtime = ""&FormatDate(rs("addtime"), timetype)&""
	  end if
end if
      trtail = trcolumn&trclicks&trtime
      trtail = trhead_foot(trcolumn&trclicks&trtime, " | ")
      If trtail<>"" Then
        showtrtail = "<span class=""spw1"">"&trtail&"</span>"
      End If
      jumpurl = outputurl("", rs("id"), rs("jumpurl"), ishtml)
      If rs("titlecolor")<>"" Then
        titlestr = "<font color="""&rs("titlecolor")&""">"&lefts(rs("title"), strn)&"</font>"
      Else
        titlestr = lefts(rs("title"), strn)
      End If
      nn = nn + 1
      response.Write tojsplcjffyd171109a("<li class=""col-sm-6"">"&spanstr&showtrtail&"<a href="""&jumpurl&""" title="""&replace(rs("title")," ","")&""">"&titlestr&"</a></li>") & vbCrLf
'	  next
      rs.movenext
    Loop
  End If
rs.close
'  response.Write tojsplcj171109("      </ul>") & vbCrLf
end function

Function tojsplcjffyd171109a(Str)
  Tmp = Split(Str, Chr(13) & Chr(10))
  Str = ""
  For i = 0 To UBound(Tmp)
    s = Tmp(i)
    s = Replace(s, "/", "\/", 1, -1, 1)
    s = Replace(s, "\\", "\\\\", 1, -1, 1)
    s = Replace(s, "'", "\'", 1, -1, 1)
    s = Replace(s, """", "\""", 1, -1, 1)
    Str = Str & "tmptrpageturnlist178888=tmptrpageturnlist178888 + (""" & s & """);"& vbCrLf
    If i<>UBound(Tmp) Then Str = Str & vbCrLf
  Next
  tojsplcjffyd171109a = Str
End Function

function ishavesoncolnd(id)
  ishavesoncolnd = false
  Set rssoncol = server.CreateObject("adodb.recordset")
  sql = "select id,colname,jumpurl from tr_column where columnid="&id&" and isopen=1 and isnav=1 "
  rssoncol.Open sql, conn, 0, 1
  If Not rssoncol.EOF Then
    ishavesoncolnd = true
  Else
    ishavesoncolnd = false
  End If
  rssoncol.Close
  Set rssoncol = Nothing
end function


function trqscrfastsqlstr810518(byval columnid,byval sql810518)
'trwccrfastsqlstr=""
If columnid<>"" Then
if columnid=0 then
sql810518 = sql810518 & " and queueid like ',0,%'"
else
getqueueid=getfieldvalue("tr_column", " queueid ", " and id="&columnid&" ", 2, "")
sql810518 = sql810518 & " and queueid like '" & getqueueid & "%'"
end if
end if
trqscrfastsqlstr810518=sql810518
end function


function nohtmldelimg810518(str) 
Set   re=new   RegExp 
re.IgnoreCase   =true 
re.Global=True 
re.Pattern="<.+?>"
str=re.replace(str,"") 
re.Pattern="(<\/(?!p)[^<]?>)" 
str=re.replace(str,"") 
nohtmldelimg810518=str 
set re=nothing 
end function


Function formaturl810518(url1)
  If url1<>"" Then
If InStr(url1, "http://")<1 and InStr(url1, "https://")<1 And isweburl(url1) Then
      url1 = "http://"&url1
    End If
  End If
  If InStr(url1, "http://")<1 and InStr(url1, "https://")<1 Then
      url1 = funpath&url1
  End If
  formaturl810518 = url1
End Function


Function Frist_Pic810518(ByVal t0) 
Frist_Pic810518="" 
Dim Regs,Matches 
Set Regs=New RegExp 
Regs.Ignorecase=True 
Regs.Global=True 
Regs.Pattern="<img[^>]+src=""([^"">]+)""[^>]*>" 
Set Matches=Regs.Execute(t0) 
IF Regs.test(t0) Then 
'Frist_Pic="<img src="""&Matches(0).SubMatches(0)&"""/>" 
Frist_Pic810518=Matches(0).SubMatches(0)
End IF 
Set Matches=Nothing 
Set Regs=Nothing 
End Function


Public Function FormatDate810518(DateAndTime, para)
  On Error Resume Next
  Dim y, m, d, h, mi, s, strDateTime
  FormatDate810518 = DateAndTime
  If Not IsNumeric(para) Then Exit Function
  If Not IsDate(DateAndTime) Then Exit Function
  y = CStr(Year(DateAndTime))
  m = CStr(Month(DateAndTime))
  If Len(m) = 1 Then m = "0" & m
  d = CStr(Day(DateAndTime))
  If Len(d) = 1 Then d = "0" & d
  h = CStr(Hour(DateAndTime))
  If Len(h) = 1 Then h = "0" & h
  mi = CStr(Minute(DateAndTime))
  If Len(mi) = 1 Then mi = "0" & mi
  s = CStr(Second(DateAndTime))
  If Len(s) = 1 Then s = "0" & s
  Select Case para
    Case "1"
      strDateTime = y & "-" & m & "-" & d & " " & h & ":" & mi & ":" & s
    Case "2"
      strDateTime = y & "-" & m & "-" & d
    Case "3"
      strDateTime = y & "/" & m & "/" & d
    Case "4"
      strDateTime = y & "年" & m & "月" & d & "日"
    Case "5"
      strDateTime = m & "-" & d & " " & h & ":" & mi
    Case "6"
      strDateTime = m & "/" & d
    Case "7"
      strDateTime = m & "月" & d & "日"
    Case "8"
      strDateTime = y & "年" & m & "月"
    Case "9"
      strDateTime = y & "-" & m
    Case "10"
      strDateTime = y & "/" & m
    Case "11"
      strDateTime = Right(y, 2) & "-" &m & "-" & d & " " & h & ":" & mi
    Case "12"
      strDateTime = Right(y, 2) & "-" &m & "-" & d
    Case "13"
      strDateTime = m & "-" & d
    Case "14"
      strDateTime = y & m & d & h & mi & s
    Case Else
      strDateTime = DateAndTime
  End Select
  FormatDate810518 = strDateTime
End Function



Function geturl810518https()
  sName = Request.ServerVariables("SERVE"&"R_NAME")
  sPort = Request.ServerVariables("SERVE"&"R_PORT")
  sinfo = Request.ServerVariables("PAT"&"H_INFO")
  if sport="443" then
  httpstr="https://"
  else
  httpstr="http://"
  end if
  if sport="80" or sport="443" then
  sportsstr=""
  else
  sportsstr=sport
  end if
  url = httpstr&sName&":"&sportsstr&sinfo
  spurl = Split(url, "/")
  uburl = UBound(spurl)
  geturl810518https = Replace(url, "/"&spurl(uburl), "")&"/"

End Function




%>