<%
Language="Ch"
function unicode(str) 
dim c,i
for i = 1 to Len(str) 
c = Mid(str, i, 1) 
unicode = unicode & "&#x" & Hex(AscW(c)) & ";" 
next 
end function 
'新闻
function getclassname(id)
dim rsc,sqlc
set rsc = server.createobject("adodb.recordset")
sqlc="select newsname"&" from liangjingcms_News where id="&id
rsc.open sqlc,conn,1,3
if not rsc.eof then
getclassname=unicode(rsc("newsname"))
else
getclassname=unicode("读取分类错误")
end if
end Function
'招聘 
function getclassnamej(id)
dim rsc,sqlc
set rsc = server.createobject("adodb.recordset")
sqlc="select jobname"&" from liangjingcms_jobs where id="&id
rsc.open sqlc,conn,1,3
if not rsc.eof then
getclassnamej=unicode(rsc("jobname"))
else
getclassnamej=unicode("读取分类错误")
end if
end Function
'其它
function getclassnameo(id)
dim rsc,sqlc
set rsc = server.createobject("adodb.recordset")
sqlc="select OthersName"&" from liangjingcms_Others where id="&id
rsc.open sqlc,conn,1,3
if not rsc.eof then
getclassnameo=unicode(rsc("OthersName"))
else
getclassnameo=unicode("读取分类错误")
end if
end Function
'下载
function getclassnamed(id)
dim rsc,sqlc
set rsc = server.createobject("adodb.recordset")
sqlc="select downname"&" from liangjingcms_Download where id="&id
rsc.open sqlc,conn,1,3
if not rsc.eof then
getclassnamed=unicode(rsc("downname"))
else
getclassnamed=unicode("读取分类错误")
end if
end function
'产品
function getclassnamep(id)
dim rsc,sqlc
set rsc = server.createobject("adodb.recordset")
sqlc="select ProductName"&" from liangjingcms_Products where id="&id
rsc.open sqlc,conn,1,3
if not rsc.eof then
getclassnamep=unicode(rsc("ProductName"))
else
getclassnamep=unicode("读取分类错误")
end if
end Function

Const maxPagesize=1000 '设置分页字数

Function InsertPageBreak(strText)
Dim strPagebreak,s,ss
Dim i,IsCount,c,iCount,strTemp,Temp_String,Temp_Array
strPagebreak="[hiweb_break]"
s=strText
If Len(s)<maxPagesize Then
InsertPageBreak=s
End If
s=Replace(s, strPagebreak, "")
If s<>"" and maxPagesize<>0 and InStr(1,s,strPagebreak)=0 then
IsCount=True
Temp_String=""
For i= 1 To Len(s)
c=Mid(s,i,1)
If c="<" Then
IsCount=False
ElseIf c=">" Then
IsCount=True
Else
If IsCount=True Then
If Abs(Asc(c))>255 Then
iCount=iCount+2
Else
iCount=iCount+1
End If
If iCount>=maxPagesize And i<Len(s) Then
strTemp=Left(s,i)
If CheckPagination(strTemp,"table|a|b>|i>|strong|div|span") then
Temp_String=Temp_String & Trim(CStr(i)) & "," 
iCount=0
End If
End If
End If
End If 
Next
If Len(Temp_String)>1 Then Temp_String=Left(Temp_String,Len(Temp_String)-1)
Temp_Array=Split(Temp_String,",")
For i = UBound(Temp_Array) To LBound(Temp_Array) Step -1
ss = Mid(s,Temp_Array(i)+1)
If Len(ss) > 380 Then
s=Left(s,Temp_Array(i)) & strPagebreak & ss
Else
s=Left(s,Temp_Array(i)) & ss
End If
Next
End If
InsertPageBreak=s
End Function


Function CheckPagination(strTemp,strFind)
Dim i,n,m_ingBeginNum,m_intEndNum
Dim m_strBegin,m_strEnd,FindArray
strTemp=LCase(strTemp)
strFind=LCase(strFind)
If strTemp<>"" and strFind<>"" then
FindArray=split(strFind,"|")
For i = 0 to Ubound(FindArray)
m_strBegin="<"&FindArray(i)
m_strEnd ="</"&FindArray(i)
n=0
do while instr(n+1,strTemp,m_strBegin)<>0
n=instr(n+1,strTemp,m_strBegin)
m_ingBeginNum=m_ingBeginNum+1
Loop
n=0
do while instr(n+1,strTemp,m_strEnd)<>0
n=instr(n+1,strTemp,m_strEnd)
m_intEndNum=m_intEndNum+1
Loop
If m_intEndNum=m_ingBeginNum then
CheckPagination=True
Else
CheckPagination=False
Exit Function
End If
Next
Else
CheckPagination=False
End If
End Function

Function ContentPagination(hiwebstr)
Dim ContentLen, maxperpage, Paginate
Dim arrContent, strContent, i
Dim m_strFileUrl,m_strFileExt,ArticleID,CurrentPage,ArticleContent,UserArticle,IsURLRewrite,page
ArticleID=Request.QueryString("ID")
strContent = InsertPageBreak(hiwebstr)
ContentLen = Len(strContent)
CurrentPage=Request.QueryString("Page")
If CurrentPage="" Then CurrentPage=0
If InStr(strContent, "[hiweb_break]") <= 0 Then
ArticleContent = "<div id=""NewsContentLabel"" class=""NewsContent"">" & strContent & "</div><div id=""Message"" class=""Message""></div>"
Else
arrContent = Split(strContent, "[hiweb_break]")
Paginate = UBound(arrContent) + 1
If CurrentPage = 0 Then
CurrentPage = 1
Else
CurrentPage = CLng(CurrentPage)
End If
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Paginate Then CurrentPage = Paginate
strContent = "<div id=""NewsContentLabel"" class=""NewsContent"">"& arrContent(CurrentPage - 1)

ArticleContent = ArticleContent & strContent
If UserArticle = True Then
ArticleContent = ArticleContent & "</p></div><div id=""Message"" class=""Message""></div><p align=""center""><b>"
Else
ArticleContent = ArticleContent & "</p></div><br/>-----<br/>&#x5171;"&Paginate&"&#x9875; &#x7B2C;"&CurrentPage&"&#x9875;<br/>"
End If
If IsURLRewrite Then
m_strFileUrl = ArticleID & "_"
Else
m_strFileExt = ""
m_strFileUrl = "?id=" & ArticleID & "&Page="
End If
If CurrentPage > 1 Then
If IsURLRewrite And (CurrentPage-1) = 1 Then
ArticleContent = ArticleContent & "<a href="""& ArticleID & m_strFileExt & """>上一页</a> "
Else
ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & CurrentPage - 1 & m_strFileExt & """>上一页</a> "
End If
End If
For i = 1 To Paginate
If i = CurrentPage Then
ArticleContent = ArticleContent & "<font color=""red"">[" & CStr(i) & "]</font> "
Else
If IsURLRewrite And i = 1 Then
ArticleContent = ArticleContent & "<a href="""& ArticleID & m_strFileExt & """>[" & i & "]</a> "
Else
ArticleContent = ArticleContent & "<a href="""& m_strFileUrl & i & m_strFileExt & """>[" & i & "]</a> "
End if
End If
Next
If CurrentPage < Paginate Then
ArticleContent = ArticleContent & " <a href="""& m_strFileUrl & CurrentPage + 1 & m_strFileExt & """>下一页</a>"
End If
ArticleContent = ArticleContent & "</b></p>"
End If
Response.Write(ArticleContent)
End Function



'图片咨讯
Function Supportlist()
dim rs,sql
set rs = server.createobject("adodb.recordset")
sql="select top 2 * from Angel_Support where ViewFlag and SmallPic<>'' and SortID=1 order by id desc"
rs.open sql,conn,1,3
do while not rs.eof
response.Write("<li>"&vbcrlf)
response.Write("<a href=""supportview.asp?ID="&rs("ID")&""" data-ignore=""true"">"&vbcrlf)
response.Write("<img src="""&rs("SmallPic")&""" />"&vbcrlf)
response.Write("<h2>"&unicode(rs("CaseName"))&"</h2>"&vbcrlf)
response.Write("<p class=""intro"">"&unicode(rs("Intro"))&"</p>"&vbcrlf)
response.Write("</a>"&vbcrlf)
response.Write("</li>"&vbcrlf)
rs.movenext 
loop
rs.close
End Function


'下载列表
Function Downloadlist()
dim rs,sql
set rs = server.createobject("adodb.recordset")
sql="select top 5 * from Angel_Support where ViewFlag and SmallPic<>'' and SortID=10 order by id desc"
rs.open sql,conn,1,3
do while not rs.eof
response.Write("<li>"&vbcrlf)
response.Write("<a href=""supportview.asp?ID="&rs("ID")&""" data-ignore=""true"">"&vbcrlf)
response.Write("<img src="""&rs("SmallPic")&""" />"&vbcrlf)
response.Write("<h2>"&unicode(rs("CaseName"))&"</h2>"&vbcrlf)
response.Write("<div class=""note"">"&vbcrlf)
response.Write("<p>"&unicode(rs("Intro"))&"</p>"&vbcrlf)
response.Write("<p><i class=""hot"">"&unicode(rs("ClickNumber"))&"次</i><i class=""date"">时间:"&unicode(FormatDate(rs("AddTime"), 14))&"</i></p>"&vbcrlf)
response.Write("</div>"&vbcrlf)
response.Write("</a>"&vbcrlf)
response.Write("</li>"&vbcrlf)
rs.movenext 
loop
rs.close
End Function 


'新闻咨讯
Function Newslist1()
dim rsm,sqlm
set rsm = server.createobject("adodb.recordset")
sqlm="select top 6 * from Angel_Article where ViewFlag order by id desc"
rsm.open sqlm,conn,1,1
dim m
m=0
do while not rsm.eof
response.Write("<li>"&vbcrlf)
response.Write("<a href=""NewsView.asp?ID="&rsm("ID")&""" data-ignore=""true"">"&unicode(rsm("ArticleName"))&"</a>"&vbcrlf)
response.Write("</li>"&vbcrlf)
m=m+1
rsm.movenext 
loop
rsm.close
End Function 


'企业产品
Function Productlist()
dim rs,sql
set rs = server.createobject("adodb.recordset")
sql="select top 5 * from Angel_Product where ViewFlag and Intro<>'' order by AddTime desc,id desc"
rs.open sql,conn,1,3
dim m
m=0
do while not rs.eof

response.Write("<li>"&vbcrlf)
response.Write("<a href=""ProductView.asp?ID="&rs("ID")&""" data-ignore=""true"">"&vbcrlf)
response.Write("<img src="""&rs("SmallPic")&""" />"&vbcrlf)
response.Write("<h2>"&unicode(rs("ProductName"&""))&"</h2>"&vbcrlf)
response.Write("<div class=""note"">"&vbcrlf)
response.Write("<p>"&unicode(rs("Intro"&""))&"</p>"&vbcrlf)
If rs("ClickNumber")<>"" Then 
response.Write("<p><i class=""hot"">"&unicode(rs("ClickNumber"&""))&"次</i>"&vbcrlf)
Else
response.Write("<p><i class=""hot"">"&unicode("0")&"次</i>"&vbcrlf)
End If 
If rs("Price")<>"" Then 
response.Write("<i class=""price"">￥"&unicode(rs("Price"&""))&"</i>元</p>"&vbcrlf)
Else
response.Write("<i class=""price"">暂无价格</i></p>"&vbcrlf)
End If 
response.Write("</div>"&vbcrlf)
response.Write("</a>"&vbcrlf)
response.Write("</li>"&vbcrlf)
rs.movenext 
loop
rs.close
End Function


'手机版导航
function MobileNavigations(Angel_languageid)
  dim rs,sql,rss,sqll,AngelString
  AngelString=""
  set rs = server.createobject("adodb.recordset")
  sql="select * from Angel_Navtions where ViewFlag and Angel_languageid="&Angel_languageid&" and Parentid=0 order by Sequence asc,id asc"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write "暂无导航"
  else
	Do
If ishtml = 1 Then
    AngelString=AngelString&"<li><a href="""&rs("HtmlNavUrl")&""" class=""icon home"" data-ignore=""true"">"&rs("NavName")&"</a></li>"&VbCrLf
Else
    AngelString=AngelString&"<li><a href="""&rs("NavUrl")&""" class=""icon home"" data-ignore=""true"">"&rs("NavName")&"</a></li>"&VbCrLf
End If 
	 rs.movenext
	loop until rs.eof
  end if
  rs.close
  set rs=Nothing
  MobileNavigations=AngelString
end Function

'相关新闻
Function RelatedNews(SortID,trs,tds)
  dim rs,sql,tr,td,ArticleName,AutoLink
  set rs = server.createobject("adodb.recordset")
  sql="select top "&trs*tds&" * from Angel_Article where ViewFlag and SortID="&SortID&" order by AddTime desc,ID desc"
  rs.open sql,conn,1,1
  if rs.eof then
    response.write "暂无相关信息"
  Else
Dim i
i=1
    for tr=1 to trs

        for td=1 to tds

          if StrLen(rs("ArticleName"))<=30 then
            ArticleName=rs("ArticleName")
          else
            ArticleName=StrLeft(rs("ArticleName"),30)
          end If
           AutoLink = "newsview.asp?ID="&rs("id")&""
	Response.Write "<li>"&vbcrlf
	Response.Write "<a href="""&AutoLink&""" data-ignore=""true"">"&vbcrlf
	Response.Write "<i class=""date"">"&FormatDate(rs("AddTime"), 9)&"</i>"&vbcrlf
	Response.Write "<span class=""text"">"&ArticleName&"</span>"&vbcrlf
	Response.Write "</a>"&vbcrlf
	Response.Write "</li>"&vbcrlf
		i=i+1
        rs.movenext
          if rs.eof then exit for
        next

        if rs.eof then exit for
    next
  end if
  rs.close
  set rs=nothing
End Function

'相关下载
Function RelatedDowns(SortPath,trs,tds)
  dim rs,sql,tr,td,CaseName,AutoLink
  set rs = server.createobject("adodb.recordset")
  sql="select top "&trs*tds&" * from Angel_Support where ViewFlag and Instr(SortPath,'"&SortPath&"') > 0 order by AddTime desc,ID desc"
  rs.open sql,conn,1,1
  if rs.eof then
    response.write "暂无相关信息"
  Else
Dim i
i=1
    for tr=1 to trs

        for td=1 to tds

          if StrLen(rs("CaseName"))<=30 then
            CaseName=rs("CaseName")
          else
            CaseName=StrLeft(rs("CaseName"),30)
          end If
           AutoLink = "downview.asp?ID="&rs("id")&""
	Response.Write "<li>"&vbcrlf
	Response.Write "<a href="""&AutoLink&""" data-ignore=""true"">"&vbcrlf
	Response.Write "<i class=""date"">"&FormatDate(rs("AddTime"), 9)&"</i>"&vbcrlf
	Response.Write "<span class=""text"">"&CaseName&"</span>"&vbcrlf
	Response.Write "</a>"&vbcrlf
	Response.Write "</li>"&vbcrlf
		i=i+1
        rs.movenext
          if rs.eof then exit for
        next

        if rs.eof then exit for
    next
  end if
  rs.close
  set rs=nothing
End Function



%>

