<%
if guestart<>"yes" and UserLogined<>True then
call guesterror()
response.end
end if
dim art_id,cat_id,art_title,art_images,art_imgyes
dim founderr,errmsg,RsHxcms
art_id=trim(request.querystring("art_id"))
if art_id<>"" then
    if not isInteger(art_id) then
    FoundErr=True
    ErrMsg=ErrMsg & "<br><li>非法的文章ID参数！</li>"
    end if
	art_id=CLng(art_id)
else
	art_id=0
end if

if request.querystring("cat_id")<>"" then
  if not isInteger(request.querystring("cat_id")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
  end if
  cat_id=CLng(request("cat_id"))
else
  cat_id=0
end if

if art_id>0 then
   sql="select * from art where art_id="&art_id
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你要找的文章不存在，或者已经被管理员删除！</li>"
	else	
		if rs("Passed")=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>你要找的文章尚未被管理员审核！</li>"
		else
			start="文章中心 - "&rs("art_title")&""
                        cat_id=CLng(rs("cat_id"))
                        art_title=rs("art_title")
                        art_images=rs("images")
                        art_imgyes=rs("imgyes")
                        rs("art_count")=rs("art_count")+1
			rs.update
		end if
	end if
end if

if FoundErr=True then
	Call HxErrMsg()
	response.end
end if

'=================================================
'过程名：new_art
'作  用：最新文章
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub new_art(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("select top "&n&" * from art where passed=0 order by art_id desc")
do while not RsHxcms.eof
Response.Write "<tr><td height='22' align='left' class=table-xia>&nbsp;<font color=#FF0000>·</font><a href='showart.asp?art_id="&RsHxcms("art_id")&"' title='"&RsHxcms("art_title")&"' "& nnn &">"&gotTopic(RsHxcms("art_title"),nn)&"</a></td></tr>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有文章！</td></tr>" & vbCrLf
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：best_art
'作  用：推荐文章
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub best_art(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("select top "&n&" * from art where passed=0 and isbest=1 order by art_id desc")
do while not RsHxcms.eof
Response.Write "<tr><td height='22' align='left' class=table-xia>&nbsp;<font color=#FF0000>·</font><a href=showart.asp?art_id="&RsHxcms("art_id")&" title="&RsHxcms("art_title")&" "& nnn &">"&gotTopic(RsHxcms("art_title"),nn)&"</a></td></tr>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>没有推荐文章！</td></tr>" & vbCrLf
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：top_art
'作  用：热门文章
'参  数：n-调用条数,nn-显示长度,popartnum-热门点击数
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub top_art(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("select top "&n&" * from art where passed=0 and art_count>="&popartnum&" order by art_id desc")
do while not RsHxcms.eof
Response.Write "<tr><td height='22' align='left' class=table-xia>&nbsp;<font color=#FF0000>·</font><a href=showart.asp?art_id="&RsHxcms("art_id")&" title="&RsHxcms("art_title")&" "& nnn &">"&gotTopic(RsHxcms("art_title"),nn)&"</a></td></tr>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>没有热门文章！</td></tr>" & vbCrLf
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：img_art
'作  用：图片文章
'参  数：n-调用条数,nn-显示标题长度
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub img_art(n,nn,ImgWidth,ImgHeight,NewWindows)
dim nnn,imagess
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=5 cellPadding=0 border=0 align='center'>" & vbCrLf
Response.Write "<TR>" & vbCrLf
set rshx66=conn.execute("SELECT top "&n&" * FROM art where isimg=1 and passed=0 order by art_id desc") 
if rshx66.EOF then
	Response.Write ("<TD align=center>暂无图片文章</TD>")
else
	do while not rshx66.eof
if rshx66("images")<>"" then
imagess=rshx66("images")
else
imagess="img/nopic.gif"
end if
Response.Write "<TD align=center>"
Response.Write "<table width=50 border=0 cellpadding=3 cellspacing=1 bgcolor=#d7d7d7><tr><td bgcolor=#ffffff><a href='Showart.asp?art_id="&rshx66("art_id")&"' title='最新图片文章："&rshx66("art_title")&"' "& nnn &"><img src='"&imagess&"' width='"& ImgWidth &"' height='"& ImgHeight &"' border=0 alt='最新图片文章："&rshx66("art_title")&"'></a></td></tr></table>"
Response.Write "<center><font color='#009933'>"&gotTopic(rshx66("art_title"),nn)&"</font></center>"
Response.Write "</TD>"
rshx66.movenext
loop
end if
rshx66.close
set rshx66=nothing
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：count_art
'作  用：文章统计
'参  数：无
'=================================================
sub count_art()
dim zw,zc,jw,zzw,sw,yd,pl  
zw=conn.execute("select count(*) from art where passed=0")(0)
sw=conn.execute("select count(*) from art where passed=1")(0)
jw=conn.execute("select count(*) from art where passed=0 and art_date>=#"&date()&"#")(0)
zzw=conn.execute("select count(*) from art where passed=0 and art_date>=#"&date()-1&"#")(0)
yd=conn.execute("select sum(art_count) from art")(0)
pl=conn.execute("select sum(reviewcount) from art")(0)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>文章总数:</strong>"&zw&" 篇</td></tr>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>待审文章:</strong>"&sw&" 篇</td></tr>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>今日文章:</strong><font color='red'>"&jw&"</font> 篇</td></tr>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>昨日文章:</strong>"&zzw-jw&" 篇</td></tr>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>评论总数:</strong>"&pl&" 条</td></tr>" & vbCrLf
Response.Write "<tr><td height=20>&nbsp;<font color=#FF0000>·</font><strong>文章阅读:</strong>"&yd&" 人次</td></tr>" & vbCrLf
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：class_art
'作  用：文章分类
'参  数：无
'=================================================
sub class_art(nn)
%>
<SCRIPT language=javascript>
function showmenu.Hx(buyok,img)
{
if(buyok.style.display=="none"){
buyok.style.display="";
img.src="img/bclass2.gif";
} else {
buyok.style.display="none"; 
img.src="img/bclass1.gif";
}
}
</SCRIPT>
<%
response.write "<TABLE align=center cellSpacing=0 cellPadding=0 width='100%' border=0>" & vbCrLf
sql="select * from a_cat where sid=0"
set rs1=conn.execute(sql)
i=0
do while not rs1.eof
i=i+1
response.write "<TR><TD language=javascript onmouseup='showmenu.Hx(buyok"&i&",img"&i&");' valign=middle>&nbsp;<IMG id=img"&i&" height=20 src=img/bclass1.gif width=20 align=absMiddle>"
if request("cat_id")=cstr(rs1("cat_id")) then
response.write "&nbsp;<font color=""#FF0000"">["&rs1("cat_name")&"]</a></font></td></tr>" & vbCrLf
else
response.write "&nbsp;["&rs1("cat_name")&"]</td></tr>" & vbCrLf
end if
sql="select * from a_cat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
response.write "<TR><TD id=buyok"&i&" style='display: none'>" & vbCrLf
do while not rs2.eof
if request("cat_id")=cstr(rs2("cat_id")) then
response.write "<IMG height=20 src=img/bclass3.gif width=36 align=absMiddle border=0><font color=""#FF0000"">"&gotTopic(rs2("cat_name"),nn)&"</font><BR>" & vbCrLf
else
response.write "<IMG height=20 src=img/bclass3.gif width=36 align=absMiddle border=0><a href='art_list.asp?cat_id="&rs2("cat_id")&"'>"&gotTopic(rs2("cat_name"),nn)&"</a><BR>" & vbCrLf
end if
rs2.movenext
loop
response.write "</td></tr>" & vbCrLf
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
response.write "</table>" & vbCrLf
end sub

'=================================================
'过程名：class1_art
'作  用：文章分类
'参  数：无
'=================================================
sub class1_art()
sql="select * from a_cat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("cat_id")=cstr(rs1("cat_id")) then
response.write "&nbsp;·<font color=""#FF0000"">"&rs1("cat_name")&"</font>"
else
response.write "&nbsp;·<a href='art_list.asp?cat_id="&rs1("cat_id")&"'>"&rs1("cat_name")&"</a>"
end if
sql="select * from a_cat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：class2_art
'作  用：文章分类
'参  数：无
'=================================================
sub class2_art(classid)
sql="select * from a_cat where sid="&classid&""
set rs1=conn.execute(sql)
do while not rs1.eof
if request("cat_id")=cstr(rs1("cat_id")) then
response.write "&nbsp;·<font color=""#FF0000"">"&rs1("cat_name")&"</font><BR>"
else
response.write "&nbsp;·<font color=""#FF0000""></font><a href='art_list.asp?cat_id="&rs1("cat_id")&"'>"&rs1("cat_name")&"</a><BR>"
end if
sql="select * from a_cat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("cat_id")=cstr(rs2("cat_id")) then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=""#FF0000"">├ "&rs2("cat_name")&"</a></font><BR>"
else
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='art_list.asp?cat_id="&rs2("cat_id")&"'>├ "&rs2("cat_name")&"</a><BR>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub


'=================================================
'过程名：main_Art
'作  用：显示文章位置导航
'参  数：无
'=================================================
sub main_Art()
if cat_id>0 then
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='art.asp'>兜客学院</a>" & vbCrLf
  sql="select cat_id,cat_name,sid from a_cat where cat_id="&cat_id
  set rs3=conn.execute(sql)
  if rs3.eof then
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
  End IF
  if rs3("sid")<>"0" then
     sql="select cat_id,cat_name from a_cat where cat_id="&rs3("sid")
     set rs4=conn.execute(sql)
     Response.Write " >> <a href=""art.asp?cat_id="&rs4("cat_id")&""">"&rs4("cat_name")&"</a>" & vbCrLf 
     rs4.close
     set rs4=nothing
  end if
  Response.Write " >> <a href=""art_list.asp?cat_id="&rs3("cat_id")&""">"&rs3("cat_name")&"</a>" & vbCrLf 
  rs3.close
  set rs3=nothing 
else
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='art.asp'>兜客学院</a>" & vbCrLf
end if
end sub

'=================================================
'过程名：search_Art
'作  用：显示文章搜索表单
'参  数：无
'=================================================
sub search_Art()
Response.Write "<div align=center><form name='form2' method='post' action='art_list.asp'>文章搜索：<input type='radio' name='select' value='art_title' checked class='inuptCG'>标题&nbsp;<input type='radio' name='select' value='art_content' class='inuptCG'>内容&nbsp;<input type='radio' name='select' value='review' class='inuptCG'>评论&nbsp;&nbsp;<input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onfocus=""this.value=''"" class='input'>&nbsp;<input type='submit' name='search'  value='搜索' onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'""></div>" & vbCrLf
end sub

'=================================================
'过程名：list_Art
'作  用：简洁文章列表
'参  数：n-调用条数,nn-显示长度,popartnum-热门点击数
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub list_Art(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
dim id1,zc,folder,rsy,rsy1
Response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
set rsy=conn.execute("select cat_id,cat_name from a_cat where sid="&cat_id&" order by cat_id")
while not rsy.eof
id1=rsy("cat_id") 
zc=conn.execute("select count(*) from art where passed=0 and (cat_id="&id1&" or cat_id in(select cat_id from a_cat where sid="&id1&"))")(0)
Response.Write "<tr>"
for i=1 to 1
if rsy.eof then
Response.Write "<td width='100%'></td>" & vbCrLf
else
Response.Write "<td width='99%' valign='top' align='right'>" & vbCrLf
Response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='0'>" & vbCrLf
Response.Write "<tr><td height='26' class='a4'>&nbsp;&nbsp;<b>"&rsy("cat_name")&"</b>&nbsp;(文章："&zc&" 篇)</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>" & vbCrLf
set rsy1=conn.execute("select top "&n&" * from art where passed=0 and (cat_id="&id1&" or cat_id in(select cat_id from a_cat where sid="&id1&")) order by art_id desc")
if rsy1.eof then
Response.Write "<tr><td align='center'>此分类暂无文章</td></tr>" & vbCrLf
else
do while not rsy1.eof
if rsy1("istop")="1" then      
folder="<img src=""img/1.gif"" title=固顶文章>" & vbCrLf      
elseif rsy1("isbest")="1" then
folder="<img src=""img/2.gif"" title=推荐文章>" & vbCrLf
elseif rsy1("art_count")>=popartnum then
folder="<img src=""img/3.gif"" title=热门文章>" & vbCrLf      
else
folder="<img src=""img/4.gif"" title=普通文章>" & vbCrLf       
end if      
Response.Write "<tr>" & vbCrLf
Response.Write "<TD width='6%' align=Center height='26'>"&folder&"</TD>" & vbCrLf
Response.Write "<td>&nbsp;<a href=showart.asp?art_id="&rsy1("art_id")&" title="&rsy1("art_title")&" "& nnn &">"&gotTopic(rsy1("art_title"),nn)&"</a>"
if rsy1("isimg")=1 then
Response.Write "&nbsp;<img src='img/img.gif' alt='图片文章' align=absmiddle border=0>" & vbCrLf
end if
if DateDiff("h",rsy1("art_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内文章'>" & vbCrLf
end if
Response.Write "</td>" & vbCrLf
Response.Write "<TD align=middle width='10%'>"&rsy1("art_count")&"</td>" & vbCrLf
Response.Write "<TD align=Center width='15%'>"&year(rsy1("art_date"))&"-"&Right("0"&month(rsy1("art_date")),2)&"-"&Right("0"&day(rsy1("art_date")),2)&"</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
rsy1.movenext
loop
rsy1.close
set rsy1=nothing
end if
Response.Write "<tr><td align='right' colspan=4><a href='art_list.asp?cat_id="&id1&"'>more</a>&nbsp;&nbsp;&nbsp;</td></tr>" & vbCrLf
Response.Write "</table></td>" & vbCrLf
rsy.movenext
end if
next
Response.Write "</tr>" & vbCrLf
wend
Response.Write "</table>" & vbCrLf
rsy.close
set rsy=nothing 
end sub

'=================================================
'过程名：displayList_Art
'作  用：带分页功能的文章列表
'参  数：popartnum-------热门点击数
'        nn--------------标题长度
'        Hxperpage-------每页显示条数
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub displayList_Art(nn,Hxperpage,classyes,NewWindows)
Dim CurPage,Url_Add
Url_Add="?"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False Then Curpage=1
Else
   Curpage=1
End If
if request("keyword")<>"" then
  if instr(request("keyword"),"'")>0 then
    Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
dim mtyid,hx01,hx66010
mtyid=int(cat_id)
set hx01=conn.execute("select cat_id,cat_name,sid from a_cat order by cat_id")
do while not hx01.eof
if mtyid=hx01("sid") then
hx66010=hx66010+" or cat_id="&hx01("cat_id") '显示页所需变量art_list.asp
end if
hx01.movenext
loop
hx01.close
set hx01=nothing
if cat_id>0 then
   sql="select * from art where passed=0 and (cat_id="&cat_id&hx66010&") order by istop desc,art_id DESC"
   Url_Add=Url_Add&"cat_id="&cat_id&"&"
elseif request("keyword")<>"" and (request("select")="art_title" or request("select")="art_content" or request("select")="review" or request("select")="tjuser") then
   sql="select * from art where passed=0 and "&request("select")&" like '%"&Jencode(checkspace(request("keyword")))&"%' order by istop desc,art_date DESC"
   Url_Add=Url_Add&"select="&request("select")&"&keyword="&Server.URLEncode(request("keyword"))&"&"
else
sql="select * from art where passed=0 order by istop desc,art_id DESC"
end if
set RsHxcms=server.createobject("adodb.recordset")
RsHxcms.open sql,conn,1,1
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height=30 colSpan=4><FONT color=#b70000>&nbsp;<B>·</B></FONT>"
if request("cat_id")<> "" then
Response.Write "本分类共有"
elseif request("select")<>"" then
Response.Write "共搜索到"
else
Response.Write "当前共有"
end if
Response.Write "<span>"&RsHxcms.recordcount&"</span>篇文章</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<TD width='6%' height='26'>状态</TD><td width='*'>主 题</td><TD width='10%'>人气</TD><td width='15%'>发表日期</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if not RsHxcms.eof then
   Dim Hx_Nums,MultiPages,i
   RsHxcms.PageSize=Hxperpage
   RsHxcms.AbsolutePage=CurPage
   Hx_Nums=RsHxcms.RecordCount
   MultiPages="<tr><td colspan=""4"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until RsHxcms.EOF OR i=Hxperpage
sql="select cat_id,cat_name from a_cat where cat_id="&RsHxcms("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
if RsHxcms("istop")="1" then      
folder="<img src=""img/1.gif"" title=固顶文章>"       
else
folder="<img src=""img/4.gif"" title=普通文章>"       
end if      
if RsHxcms("istop")="0" then      
if RsHxcms("isbest")="1" then
folder="<img src=""img/2.gif"" title=推荐文章>"
elseif RsHxcms("art_count")>popartnum then
folder="<img src=""img/3.gif"" title=热门文章>"       
else
folder="<img src=""img/4.gif"" title=普通文章>"       
end if      
end if 
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if     
Response.Write "<tr>" & vbCrLf
Response.Write "<TD align=Center height='26'>"&folder&"</TD><td>"
if classyes=True then Response.Write "<a href='art_list.asp?cat_id="&RsHxcms("cat_id")&"'>『"&left(rscat("cat_name"),15)&"』</a>"
Response.Write "<a href='showart.asp?cat_id="&RsHxcms("cat_id")&"&art_id="&RsHxcms("art_id")&"' Title='文章标题："&RsHxcms("art_title")&"&#13&#10发表时间："&RsHxcms("art_date")&"&#13&#10阅读次数："&RsHxcms("art_count")&"次' "& nnn &">"&gotTopic(RsHxcms("art_title"),nn)&"</a>"
if RsHxcms("isimg")=1 then
Response.Write "&nbsp;<img src='img/img.gif' alt='图片文章' align=absmiddle border=0>" & vbCrLf
end if
if DateDiff("h",RsHxcms("art_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内文章'>" & vbCrLf
end if
Response.Write "</td>"
Response.Write "<TD align=Center>"&RsHxcms("art_count")&"</TD>" & vbCrLf
Response.Write "<TD align=Center>"&year(RsHxcms("art_date"))&"-"&Right("0"&month(RsHxcms("art_date")),2)&"-"&Right("0"&day(RsHxcms("art_date")),2)&"</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
i=i+1
RsHxcms.movenext
loop
else
if RsHxcms.eof and RsHxcms.bof then
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td align=middle height='60' colSpan=4>"
if request("cat_id")<> "" then
Response.Write "稍后推出"
elseif request("keyword")<>"" then
Response.Write "没有找到包含[<b><font color=red>"&request("keyword")&"</font></b>]的文章！"
else
Response.Write "没有任何文章，请管理员到后台添加！"
end if
Response.Write "</td></tr>" & vbCrLf
end if
end if
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rscat.close
set rscat=nothing
RsHxcms.close
set RsHxcms=nothing
end sub

'=================================================
'过程名：content_art
'作  用：显示文章标题、内容
'参  数：无
'=================================================
sub content_art()
if request.querystring("art_id")="" then
  Response.Write "<script language=javascript>alert('请指定操作的对象！');javascript:history.back();</script>"
  Response.End
end if
if request("page")<>"" then
  if not isInteger(request("page")) then
    Response.Write "<script language=javascript>alert('分页参数非法！');javascript:history.back();</script>"
    Response.End
  end if
end if
if rs("Grade")="0" then
hxGrade="游客身份"
elseif rs("Grade")="1" then
hxGrade="会员身份"       
elseif rs("Grade")="2" then
hxGrade="VIP身份"       
end if %>     
<script language = "JavaScript">
function fontColor(objname)
{
	var arr = showModalDialog("inc/selcolor.htm", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
	if (arr != null) setColor(objname,arr);
}
</script>
<%
Response.Write "<table width='100%' align='center' cellspacing='0' cellpadding='0'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td valign='top'><br><div align='center'><font style=""font-size:16px""><b>"&rs("art_title")&"</b></font></div><br></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td>" & vbCrLf
Response.Write "<table width='95%' align='center' class=""table-top"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width='10%'>&nbsp;</td>" & vbCrLf
Response.Write "<td width='25%'>文章作者："&rs("art_author")&"</td>"
Response.Write "<td width='18%'>来源："&rs("art_ahome")&"</td>" 
Response.Write "<td width='27%'>浏览次数："&rs("art_count")&"</td>"
Response.Write "<td width='20%'>字体："
Response.Write "<input type=button style='height:17' value='小' title='把正文字体缩小' onclick=fontSize('m','ArtBody')>" 
Response.Write "<input type=button style='height:17' value='大' title='把正文字体扩大' onclick=fontSize('b','ArtBody')>" 
Response.Write "<input type=button style='height:17' value='简' title='转为简体中文模式' onclick=bodytojt('ArtBody')>" 
Response.Write "<input type=button style='height:17' value='繁' title='转为繁体中文模式' onclick=bodytoft('ArtBody')>" 
Response.Write "<a href=""javascript:fontColor('ArtBody')""><img src='img/fgcolor.gif' alt='字体颜色' border=0 align='absmiddle'></a>"
Response.Write "</td></tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td>&nbsp;</td>"
Response.Write "<td>阅读权限：<font color=red>"&hxGrade&"</font></td>"
Response.Write "<td>花费兜币：<font color=red>"&rs("points")&"</font></td>"
Response.Write "<td>添加时间："&rs("art_date")&"</td>"
Response.Write "<td>提交会员："&rs("tjuser")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='100%' align='center' style=""word-break:break-all;table-layout:fixed;text-align:left"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td><div id=""ArtBody"" style=""display:block;padding:5px 20px;LINE-HEIGHT: 180%"">"
if art_images<>"" and art_imgyes=1 then response.write "<a href="&art_images&" target=_blank><img src="&art_images&" align=right onload=""javascript:if(this.width>screen.width-666)this.width=screen.width-666"" border=0 alt=按此在新窗口浏览图片></a>" & vbCrLf
call ShowArt()
Response.Write "</div></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
end sub

'=================================================
'过程名：contextual_Art
'作  用：显示文章上下篇
'参  数：无
'=================================================
sub contextual_Art()
set RelationArt = conn.execute("select top 1 art_id,art_title from art where art_id<"&request.querystring("art_id")&" and passed=0 order by art_id desc")
IF RelationArt.eof and relationArt.bof Then
Response.Write "<font color=red>·上篇文章：</font>已经没有了<BR> " & vbCrLf    
else
Response.Write "<font color=red>·上篇文章：</font><a href=""showart.asp?art_id=" & RelationArt(0) & """>" & relationArt(1) & "</a><BR>" & vbCrLf   
end if   
Set RelationArt=Nothing
set RelationArt = conn.execute("select top 1 art_id,art_title from art where art_id>"&request.querystring("art_id")&" and passed=0 order by art_id")
IF RelationArt.eof and relationArt.bof Then
Response.Write "<font color=red>·下篇文章：</font>已经没有了" & vbCrLf   
else
Response.Write "<font color=red>·下篇文章：</font><a href=""showart.asp?art_id=" & RelationArt(0) & """>" & relationArt(1) & "</a></td>" & vbCrLf  
end if  
Set RelationArt=Nothing 
end sub

'=================================================
'过程名：pertinent_Art
'作  用：显示相关文章
'参  数：无
'=================================================
sub pertinent_Art(n)
Response.Write "<table width=""98%"" align=""center"" bgcolor=""#FCFCFC"">" & vbCrLf
Response.Write "<tr><td background=""img/bg.gif"" style=""display:block;padding:0px 10px;LINE-HEIGHT: 210%"">"
dim strKey,arrKey,i
strKey=rs("art_keyword")
	if instr(strkey,"|")>1 then
		arrKey=split(strKey,"|")
		strKey="((art_keyword like '%" & arrKey(0) & "%')"
		for i=1 to ubound(arrKey)
			strKey=strKey & " or (art_keyword like '%" & arrKey(i) & "%')"
		next
		strKey=strKey & ")"
	else
		strKey="(art_keyword like '%" & strKey & "%')"
	end if
sql="select top " & n & " * from art where " & strKey & " and art_id <> "&rs("art_id")&" and passed = 0 order by art_id DESC"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
Response.Write "·<a href='showart.asp?art_id="&rs2("art_id")&"'>"&rs2("art_title")&"</a> "&rs2("art_date")&"<br>" & vbCrLf  
rs2.movenext
loop
if rs2.eof and rs2.bof then
response.write "没有相关文章<br>"
end if
rs2.close
set rs2=nothing
Response.Write "</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
end sub

'=================================================
'过程名：review_Art
'作  用：显示相关评论
'参  数：n-显示条数；point_article-评论开关,1-开启，0-关闭
'=================================================
sub review_Art(n)
dim temp,i,j
if point_article="1" then
Response.Write "<table align=""center"" width=""98%"" cellspacing=""0"" cellpadding=""0"" style=""word-break:break-all;table-layout:fixed;text-align:left"">"
if rs("review")<>"" then
temp=split(Trim(rs("review")),"|")
if n>=ubound(temp) then
j=ubound(temp)
else
j=n
end if
for i=1 to j
Response.Write "<tr><td style=""display:block;padding:0px 10px;LINE-HEIGHT: 180%"">"& temp(i) &"</td></tr>" & vbCrLf
next
else
Response.Write "<tr><td style=""display:block;padding:0px 10px;LINE-HEIGHT: 180%"">当前没有评论</td></tr>" & vbCrLf
end if
Response.Write "<tr><td align=""right"">相关评论<font color=#CC0000> "&rs("reviewcount")&" </font>篇，当前显示最新的<font color=#CC0000> "&n&" </font>篇。&nbsp;&nbsp;<a href=""view.asp?action=art&art_id="&rs("art_id")&"""> [查看更多评论] [发表我的评论]</a>&nbsp;&nbsp;</td></tr>"
Response.Write "</table>" & vbCrLf
elseif point_article="0" then
Response.Write "<table width=""100%"" cellpadding=""5"" cellspacing=""0"" border=""0"">" & vbCrLf
Response.Write "<tr><td  align=""center"">【文章评论已关闭】" & vbCrLf
Response.Write "</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
End If
rs.close
set rs=nothing
end sub

'=================================================
'过程名：ShowArt
'作  用：显示文章内容，可以分页显示
'参  数：无
'=================================================
sub ShowArt()
dim ArticleID
Pay=request("Pay")
ArticleID=md5(trim(request("art_id"))+123)
'ArticleID=trim(request("art_id"))
	if rs("Grade")<>0 then
		if UserLogined<>True then 
			FoundErr=True
			ErrMsg=ErrMsg & "<font color=red>·</font>你还没注册？或者没有登录？这篇文章要求至少是本站的注册用户才能阅读！<br>"
			ErrMsg=ErrMsg & "<font color=red>·</font>如果你还没注册，请赶紧<a href='UserReg.asp'> <font color=red>点此注册</font></a> ！<br>"
			ErrMsg=ErrMsg & "<font color=red>·</font>如果你已经注册但还没登录，请赶紧 <a href='index.asp'><font color=red>点此登录</font></a> ！<br><br>"
		else
			if Hx66_Grade+1<RS("Grade") then
				FoundErr=True
				ErrMsg=ErrMsg & "<p align='center'><br><font color=red><b>对不起，你的权限不够，不能阅读此文章!</b></font></p><br>"
			else
				if rs("points")>0 then
					if Request.Cookies("hx66")("Pay_Art" & ArticleID)<>"yes" then
						if Hx66_points<rs("points") then
							FoundErr=True
							ErrMsg=ErrMsg &"<p align='center'><br>对不起，阅读本文需要消耗 <b><font color=red>" & rs("points") & "</font></b> "& moneyname &"！"
							ErrMsg=ErrMsg &"而你目前只有 <b><font color=blue>" & Hx66_points & "</font></b> "& moneyname &"可用。"& moneyname &"不足，无法阅读本文。请与我们联系进行充值。</p>"
						else
							if lcase(trim(request("Pay")))="yes" then
                                                             sql="UPDATE [user] SET points = points - "&rs("points")&" where userid="&Hx66_uid
                                                             conn.execute (sql)
                                                             response.Cookies("hx66")("Pay_Art" & ArticleID)="yes"
                                                             Response.Cookies("hx66").Expires=date+365
							else
							     FoundErr=True
							     ErrMsg=ErrMsg &"<p align='center'><br>阅读本文需要消耗 <b><font color=red>" & rs("points") & "</font></b> "& moneyname &"！"
							     ErrMsg=ErrMsg &"你目前尚有 <b><font color=blue>" & Hx66_points & "</font></b> "& moneyname &"可用。阅读本文后，你将剩下 <b><font color=green>" & Hx66_points-rs("points") & "</font></b> "& moneyname &""
							     ErrMsg=ErrMsg &"<br>你确实愿意花费 <b><font color=red>" & rs("points") & "</font></b> "& moneyname &"来阅读本文吗？"
							     ErrMsg=ErrMsg &"<br><br><a href='?Pay=yes&art_id=" & rs("art_id") & "'>我愿意</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='index.asp'>我不愿意</a></p><br>"
							end if
						end if
					end if
				end if
			end if
		end if
	end if

	if FoundErr=True then
	        ErrMsg="<p align=left><b>内容预览：</b></p><p align=left><table style='width:95%' cellpadding=5 cellspacing=1 class=tablegubb><TR><TD width='100%' bgcolor='#FFFFFF'>" & left(rs("art_content"),100) & "……</td></tr></table></p>" & ErrMsg
		response.write ErrMsg
		exit sub
	end if

dim PaginationType
PaginationType=rs("PaginationType")
select case PaginationType
	case 0    '不分页显示
		response.write rs("art_content")
	case 1    '自动分页显示
		call AutoPagination()
	case 2    '手动分页显示
		call ManualPagination()
end select
end sub
'=================================================
'过程名：ManualPagination
'作  用：采用手动分页方式显示文章内容
'参  数：无
'=================================================
sub ManualPagination()
dim ArtID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i
dim arrContent
ArtID=rs("art_id")
strContent=rs("art_content")
ContentLen=len(strContent)
CurrentPage=trim(request("Page"))
if Instr(strContent,"[NextPage]")<=0 then
	response.write strContent
	response.write "</p><p align='center'><font color='red'><b>[1]</b></font></p>"
else
	arrContent=split(strContent,"[NextPage]")
	pages=Ubound(arrContent)+1
	if CurrentPage="" then
		CurrentPage=1
	else
	CurrentPage=Cint(CurrentPage)
	end if
	if CurrentPage<1 then CurrentPage=1
	if CurrentPage>pages then CurrentPage=pages
	response.write arrContent(CurrentPage-1)
	response.write "</p><p align='center'><b>"
	if CurrentPage>1 then
		response.write "<a href='showart.asp?art_id="&ArtID&"&page="&CurrentPage-1&"'>上一页</a>&nbsp;"
	end if
	for i=1 to pages
		if i=CurrentPage then
			response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
		else
			response.write "<a href='showart.asp?art_id="&ArtID&"&page="&i&"'>["& i &"]</a>&nbsp;"
		end if
	next
	if CurrentPage<pages then
		response.write "<a href='showart.asp?art_id="&ArtID&"&page="&CurrentPage+1&"'>下一页</a>"
	end if
	response.write "</b></p>"
end if
end sub
'=================================================
'过程名：AutoPagination
'作  用：采用自动分页方式显示文章内容
'参  数：无
'=================================================
sub AutoPagination()
dim ArtID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i,lngBound
dim BeginPoint,EndPoint
ArtID=rs("art_id")
strContent=rs("art_content")
ContentLen=len(strContent)
CurrentPage=trim(request("Page"))
if ContentLen<=rs("MaxCharPerPage") then
	response.write strContent
	response.write "</p><p align='center'><font color='red'><b>[1]</b></font></p>"
else
	if CurrentPage="" then
		CurrentPage=1
	else
		CurrentPage=Cint(CurrentPage)
	end if
	pages=ContentLen\rs("MaxCharPerPage")
	if rs("MaxCharPerPage")*pages<ContentLen then
		pages=pages+1
	end if
	lngBound=ContentLen  '最大误差范围
	if CurrentPage<1 then CurrentPage=1
	if CurrentPage>pages then CurrentPage=pages

	dim lngTemp
	dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3
	dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2
	dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2
	dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2
	dim lngTemp5,lngTemp5_1,lngTemp5_2
	dim lngTemp6,lngTemp6_1,lngTemp6_2
		
	if CurrentPage=1 then
		BeginPoint=1
	else
		BeginPoint=rs("MaxCharPerPage")*(CurrentPage-1)+1
			
		lngTemp1_1_1=instr(BeginPoint,strContent,"</table>",1)
		lngTemp1_1_2=instr(BeginPoint,strContent,"</TABLE>",1)
		lngTemp1_1_3=instr(BeginPoint,strContent,"</Table>",1)
		if lngTemp1_1_1>0 then
			lngTemp1_1=lngTemp1_1_1
		elseif lngTemp1_1_2>0 then
			lngTemp1_1=lngTemp1_1_2
		elseif lngTemp1_1_3>0 then
			lngTemp1_1=lngTemp1_1_3
		else
			lngTemp1_1=0
		end if
							
		lngTemp1_2_1=instr(BeginPoint,strContent,"<table",1)
		lngTemp1_2_2=instr(BeginPoint,strContent,"<TABLE",1)
		lngTemp1_2_3=instr(BeginPoint,strContent,"<Table",1)
		if lngTemp1_2_1>0 then
			lngTemp1_2=lngTemp1_2_1
		elseif lngTemp1_2_2>0 then
			lngTemp1_2=lngTemp1_2_2
		elseif lngTemp1_2_3>0 then
			lngTemp1_2=lngTemp1_2_3
		else
			lngTemp1_2=0
		end if
			
		if lngTemp1_1=0 and lngTemp1_2=0 then
			lngTemp1=BeginPoint
		else
			if lngTemp1_1>lngTemp1_2 then
				lngtemp1=lngTemp1_2
			else
				lngTemp1=lngTemp1_1+8
			end if
		end if

		lngTemp2_1_1=instr(BeginPoint,strContent,"</p>",1)
		lngTemp2_1_2=instr(BeginPoint,strContent,"</P>",1)
		if lngTemp2_1_1>0 then
			lngTemp2_1=lngTemp2_1_1
		elseif lngTemp2_1_2>0 then
			lngTemp2_1=lngTemp2_1_2
		else
			lngTemp2_1=0
		end if
						
		lngTemp2_2_1=instr(BeginPoint,strContent,"<p",1)
		lngTemp2_2_2=instr(BeginPoint,strContent,"<P",1)
		if lngTemp2_2_1>0 then
			lngTemp2_2=lngTemp2_2_1
		elseif lngTemp2_2_2>0 then
			lngTemp2_2=lngTemp2_2_2
		else
			lngTemp2_2=0
		end if
			
		if lngTemp2_1=0 and lngTemp2_2=0 then
			lngTemp2=BeginPoint
		else
			if lngTemp2_1>lngTemp2_2 then
				lngtemp2=lngTemp2_2
			else
				lngTemp2=lngTemp2_1+4
			end if
		end if

		lngTemp3_1_1=instr(BeginPoint,strContent,"</ur>",1)
		lngTemp3_1_2=instr(BeginPoint,strContent,"</UR>",1)
		if lngTemp3_1_1>0 then
			lngTemp3_1=lngTemp3_1_1
		elseif lngTemp3_1_2>0 then
			lngTemp3_1=lngTemp3_1_2
		else
			lngTemp3_1=0
		end if
			
		lngTemp3_2_1=instr(BeginPoint,strContent,"<ur",1)
		lngTemp3_2_2=instr(BeginPoint,strContent,"<UR",1)
		if lngTemp3_2_1>0 then
			lngTemp3_2=lngTemp3_2_1
		elseif lngTemp3_2_2>0 then
			lngTemp3_2=lngTemp3_2_2
		else
			lngTemp3_2=0
		end if
					
		if lngTemp3_1=0 and lngTemp3_2=0 then
			lngTemp3=BeginPoint
		else
			if lngTemp3_1>lngTemp3_2 then
				lngtemp3=lngTemp3_2
			else
				lngTemp3=lngTemp3_1+5
			end if
		end if
			
		if lngTemp1<lngTemp2 then
			lngTemp=lngTemp2
		else
		lngTemp=lngTemp1
		end if
		if lngTemp<lngTemp3 then
			lngTemp=lngTemp3
		end if

		if lngTemp>BeginPoint and lngTemp<=BeginPoint+lngBound then
			BeginPoint=lngTemp
		else
			lngTemp4_1_1=instr(BeginPoint,strContent,"</li>",1)
			lngTemp4_1_2=instr(BeginPoint,strContent,"</LI>",1)
			if lngTemp4_1_1>0 then
				lngTemp4_1=lngTemp4_1_1
			elseif lngTemp4_1_2>0 then
				lngTemp4_1=lngTemp4_1_2
			else
				lngTemp4_1=0
			end if
				
			lngTemp4_2_1=instr(BeginPoint,strContent,"<li",1)
			lngTemp4_2_1=instr(BeginPoint,strContent,"<LI",1)
			if lngTemp4_2_1>0 then
				lngTemp4_2=lngTemp4_2_1
			elseif lngTemp4_2_2>0 then
				lngTemp4_2=lngTemp4_2_2
			else
				lngTemp4_2=0
			end if
				
			if lngTemp4_1=0 and lngTemp4_2=0 then
				lngTemp4=BeginPoint
			else
				if lngTemp4_1>lngTemp4_2 then
					lngtemp4=lngTemp4_2
				else
					lngTemp4=lngTemp4_1+5
				end if
			end if
				
			if lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound then
				BeginPoint=lngTemp4
			else					
				lngTemp5_1=instr(BeginPoint,strContent,"<img",1)
				lngTemp5_2=instr(BeginPoint,strContent,"<IMG",1)
				if lngTemp5_1>0 then
					lngTemp5=lngTemp5_1
				elseif lngTemp5_2>0 then
					lngTemp5=lngTemp5_2
				else
					lngTemp5=BeginPoint
				end if
					
				if lngTemp5>BeginPoint and lngTemp5<BeginPoint+lngBound then
					BeginPoint=lngTemp5
				else
					lngTemp6_1=instr(BeginPoint,strContent,"<br>",1)
					lngTemp6_2=instr(BeginPoint,strContent,"<BR>",1)
					if lngTemp6_1>0 then
						lngTemp6=lngTemp6_1
					elseif lngTemp6_2>0 then
						lngTemp6=lngTemp6_2
					else
						lngTemp6=0
					end if
					
					if lngTemp6>BeginPoint and lngTemp6<BeginPoint+lngBound then
						BeginPoint=lngTemp6+4
					end if
				end if
			end if
		end if
	end if

	if CurrentPage=pages then
		EndPoint=ContentLen
	else
	EndPoint=rs("MaxCharPerPage")*CurrentPage
	if EndPoint>=ContentLen then
		EndPoint=ContentLen
	else
		lngTemp1_1_1=instr(EndPoint,strContent,"</table>",1)
		lngTemp1_1_2=instr(EndPoint,strContent,"</TABLE>",1)
		lngTemp1_1_3=instr(EndPoint,strContent,"</Table>",1)
		if lngTemp1_1_1>0 then
			lngTemp1_1=lngTemp1_1_1
		elseif lngTemp1_1_2>0 then
			lngTemp1_1=lngTemp1_1_2
		elseif lngTemp1_1_3>0 then
			lngTemp1_1=lngTemp1_1_3
		else
			lngTemp1_1=0
		end if
							
		lngTemp1_2_1=instr(EndPoint,strContent,"<table",1)
		lngTemp1_2_2=instr(EndPoint,strContent,"<TABLE",1)
		lngTemp1_2_3=instr(EndPoint,strContent,"<Table",1)
		if lngTemp1_2_1>0 then
			lngTemp1_2=lngTemp1_2_1
		elseif lngTemp1_2_2>0 then
			lngTemp1_2=lngTemp1_2_2
		elseif lngTemp1_2_3>0 then
			lngTemp1_2=lngTemp1_2_3
		else
			lngTemp1_2=0
		end if
			
		if lngTemp1_1=0 and lngTemp1_2=0 then
			lngTemp1=EndPoint
		else
			if lngTemp1_1>lngTemp1_2 then
				lngtemp1=lngTemp1_2-1
			else
				lngTemp1=lngTemp1_1+7
			end if
		end if

		lngTemp2_1_1=instr(EndPoint,strContent,"</p>",1)
		lngTemp2_1_2=instr(EndPoint,strContent,"</P>",1)
		if lngTemp2_1_1>0 then
			lngTemp2_1=lngTemp2_1_1
		elseif lngTemp2_1_2>0 then
			lngTemp2_1=lngTemp2_1_2
		else
			lngTemp2_1=0
		end if
						
		lngTemp2_2_1=instr(EndPoint,strContent,"<p",1)
		lngTemp2_2_2=instr(EndPoint,strContent,"<P",1)
		if lngTemp2_2_1>0 then
			lngTemp2_2=lngTemp2_2_1
		elseif lngTemp2_2_2>0 then
			lngTemp2_2=lngTemp2_2_2
		else
			lngTemp2_2=0
		end if
			
		if lngTemp2_1=0 and lngTemp2_2=0 then
			lngTemp2=EndPoint
		else
			if lngTemp2_1>lngTemp2_2 then
				lngTemp2=lngTemp2_2-1
			else
				lngTemp2=lngTemp2_1+3
			end if
		end if

		lngTemp3_1_1=instr(EndPoint,strContent,"</ur>",1)
		lngTemp3_1_2=instr(EndPoint,strContent,"</UR>",1)
		if lngTemp3_1_1>0 then
			lngTemp3_1=lngTemp3_1_1
		elseif lngTemp3_1_2>0 then
			lngTemp3_1=lngTemp3_1_2
		else
			lngTemp3_1=0
		end if
			
		lngTemp3_2_1=instr(EndPoint,strContent,"<ur",1)
		lngTemp3_2_2=instr(EndPoint,strContent,"<UR",1)
		if lngTemp3_2_1>0 then
			lngTemp3_2=lngTemp3_2_1
		elseif lngTemp3_2_2>0 then
			lngTemp3_2=lngTemp3_2_2
		else
			lngTemp3_2=0
		end if
					
		if lngTemp3_1=0 and lngTemp3_2=0 then
			lngTemp3=EndPoint
		else
			if lngTemp3_1>lngTemp3_2 then
				lngtemp3=lngTemp3_2-1
			else
				lngTemp3=lngTemp3_1+4
			end if
		end if
			
		if lngTemp1<lngTemp2 then
			lngTemp=lngTemp2
		else
			lngTemp=lngTemp1
		end if
		if lngTemp<lngTemp3 then
			lngTemp=lngTemp3
		end if

		if lngTemp>EndPoint and lngTemp<=EndPoint+lngBound then
			EndPoint=lngTemp
		else
			lngTemp4_1_1=instr(EndPoint,strContent,"</li>",1)
			lngTemp4_1_2=instr(EndPoint,strContent,"</LI>",1)
			if lngTemp4_1_1>0 then
				lngTemp4_1=lngTemp4_1_1
			elseif lngTemp4_1_2>0 then
				lngTemp4_1=lngTemp4_1_2
			else
				lngTemp4_1=0
			end if
				
			lngTemp4_2_1=instr(EndPoint,strContent,"<li",1)
			lngTemp4_2_1=instr(EndPoint,strContent,"<LI",1)
			if lngTemp4_2_1>0 then
				lngTemp4_2=lngTemp4_2_1
			elseif lngTemp4_2_2>0 then
				lngTemp4_2=lngTemp4_2_2
			else
				lngTemp4_2=0
			end if
				
			if lngTemp4_1=0 and lngTemp4_2=0 then
				lngTemp4=EndPoint
			else
				if lngTemp4_1>lngTemp4_2 then
					lngtemp4=lngTemp4_2-1
				else
					lngTemp4=lngTemp4_1+4
				end if
			end if
				
			if lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound then
				EndPoint=lngTemp4
			else					
				lngTemp5_1=instr(EndPoint,strContent,"<img",1)
				lngTemp5_2=instr(EndPoint,strContent,"<IMG",1)
				if lngTemp5_1>0 then
					lngTemp5=lngTemp5_1-1
				elseif lngTemp5_2>0 then
					lngTemp5=lngTemp5_2-1
				else
					lngTemp5=EndPoint
				end if
					
				if lngTemp5>EndPoint and lngTemp5<EndPoint+lngBound then
					EndPoint=lngTemp5
				else
					lngTemp6_1=instr(EndPoint,strContent,"<br>",1)
					lngTemp6_2=instr(EndPoint,strContent,"<BR>",1)
					if lngTemp6_1>0 then
						lngTemp6=lngTemp6_1+3
					elseif lngTemp6_2>0 then
						lngTemp6=lngTemp6_2+3
					else
						lngTemp6=EndPoint
					end if
					
					if lngTemp6>EndPoint and lngTemp6<EndPoint+lngBound then
						EndPoint=lngTemp6
					end if
				end if
			end if
		end if
	end if
	end if
	response.write mid(strContent,BeginPoint,EndPoint-BeginPoint)
	response.write "</p><p align='center'><b>"
	if CurrentPage>1 then
		response.write "<a href='showart.asp?art_id="&ArtID&"&page="&CurrentPage-1&"'>上一页</a>&nbsp;"
	end if
	for i=1 to pages
		if i=CurrentPage then
			response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
		else
			response.write "<a href='showart.asp?art_id="&ArtID&"&page="&i&"'>["& i &"]</a>&nbsp;"
		end if
	next
	if CurrentPage<pages then
		response.write "<a href='showart.asp?art_id="&ArtID&"&page="&CurrentPage+1&"'>下一页</a>"
	end if
	response.write "</b></p>"
end if
end sub
%>


