<%
dim news_id,cat_id,news_title,news_images,news_imgyes
dim founderr,errmsg
news_id=trim(request.querystring("news_id"))
if news_id<>"" then
    if not isInteger(news_id) then
    FoundErr=True
    ErrMsg=ErrMsg & "<br><li>非法的兜客采风ID参数！</li>"
    end if
	news_id=CLng(news_id)
else
	news_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 news_id>0 then
   sql="select * from news where news_id="&news_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("news_title")&""
                        cat_id=CLng(rs("cat_id"))
                        news_title=rs("news_title")
                        news_images=rs("images")
                        news_imgyes=rs("imgyes")
                        rs("news_count")=rs("news_count")+1
			rs.update
		end if
	end if
end if

if FoundErr=True then
	Call HxErrMsg()
	response.end
end if
'=================================================
'过程名：top_news
'作  用：热门新闻排行
'参  数：n--------------调用条数
'        nn-------------显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub top_news(n,nn,NewWindows)
dim nnn,RsHxcms
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 news where passed=0 order by news_count desc,news_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='shownews.asp?news_id="&RsHxcms("news_id")&"' title='"&RsHxcms("news_title")&"' "& nnn &">"&gotTopic(RsHxcms("news_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>"
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：img_news
'作  用：图片新闻
'参  数：n-调用条数
'        classid---------一级分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub img_news(n,classid,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 news where isimg=1 and (cat_id="&classid&" or cat_id in(select cat_id from newcat where sid="&classid&")) order by news_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 border=0 cellpadding=3 cellspacing=1 bgcolor=#d7d7d7><tr><td bgcolor=#ffffff><a href='Shownews.asp?news_id="&rshx66("news_id")&"' title='最新图片采风："&rshx66("news_title")&"' "& nnn &"><img src='"&imagess&"' width='"& ImgWidth &"' height='"& ImgHeight &"' border=0 alt='最新图片采风："&rshx66("news_title")&"'></a></TD></tr></table>"
rshx66.movenext
loop
end if
rshx66.close
set rshx66=nothing
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：FlashNews
'作  用：首页新闻图片FLASH幻灯
'参  数：num--------------调用条数
'        fontnum----------显示文字长度
'        PicWidthStr--------图片宽度
'        PicHeightStr-------图片高度
'        BGcolor------------背景色
'        txtheight----------文字显示高度，0为不显示
'=================================================
Function FlashNews(num,fontnum,PicWidthStr,PicHeightStr,BGcolor,txtheight)
Dim RsFilterObj,FlashStr,ImagesStr,TxtStr,LinkStr
FilterSql = "SELECT top "&num&" * FROM news where isimg=1 and images<>'' ORDER BY news_id DESC"
Set RsFilterObj = Conn.Execute(FilterSql)
If not RsFilterObj.Eof then
  Dim Temp_Num
  Temp_Num = 0
  Do While Not RsFilterObj.Eof
  Temp_Num = Temp_Num + 1
  RsFilterObj.MoveNext
  Loop
  RsFilterObj.MoveFirst
  If Temp_Num <=1 then
  Set RsFilterObj = Nothing
  FlashNews = "至少需要两条幻灯新闻才能正确显示幻灯效果"
  Set RsFilterObj = Nothing
  Exit Function 
  End If
  do while Not RsFilterObj.Eof
   if ImagesStr = "" then
     ImagesStr = RsFilterObj("images")
     TxtStr = gotTopic(RsFilterObj("news_title"),fontnum)
     LinkStr = "shownews.asp?news_id="&RsFilterObj("news_id")
   else
     ImagesStr = ImagesStr &"|"& RsFilterObj("images")
     TxtStr = TxtStr & "|" & gotTopic(RsFilterObj("news_title"),fontnum)
     LinkStr = LinkStr & "|" & "shownews.asp?news_id="& RsFilterObj("news_id")
   end if
  RsFilterObj.MoveNext
  loop
FlashStr="<script type=""text/javascript"">"& Chr(13)
FlashStr=FlashStr&"<!--"& Chr(13)
FlashStr=FlashStr&"var focus_width="&PicWidthStr& Chr(13)   
FlashStr=FlashStr&"var focus_height="&PicHeightStr& Chr(13) 
FlashStr=FlashStr&"var text_height="&txtheight& Chr(13) 
FlashStr=FlashStr&"var swf_height = focus_height+text_height"& Chr(13)
FlashStr=FlashStr&"var pics='"&ImagesStr&"'"&Chr(13)
FlashStr=FlashStr&"var links='"&LinkStr &"'"&Chr(13)
FlashStr=FlashStr&"var texts='"&TxtStr&"'"&Chr(13)
FlashStr=FlashStr&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value=""img/pic.swf""><param name=""quality"" value=""high""><param name=""bgcolor"" value="&BGcolor&">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"&Chr(13)
FlashStr=FlashStr&" document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<embed src=""img/pic.swf"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor="&BGcolor&" quality=""high"" width=""'+ focus_width +'"" height=""'+ swf_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"&Chr(13)
FlashStr=FlashStr&"document.write('</object>');"&Chr(13)
FlashStr=FlashStr&"//-->"& Chr(13)
FlashStr=FlashStr&"</script>"
  else
    FlashStr="没有幻灯图片"
  end if
    RsFilterObj.Close
Set RsFilterObj = Nothing
    FlashNews= FlashStr
End Function

'=================================================
'过程名：class_news
'作  用：新闻分类
'参  数：无
'=================================================
sub class_news()
sql="select * from newcat 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><BR>"
else
response.write "&nbsp;<font color=""#FF0000"">·</font><a href='news.asp?cat_id="&rs1("cat_id")&"'>"&rs1("cat_name")&"</a><BR>"
end if
sql="select * from newcat 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='news.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

'=================================================
'过程名：class_news1
'作  用：新闻分类——横排
'参  数：无
'=================================================
sub class_news1()
sql="select * from newcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("cat_id")=cstr(rs1("cat_id")) then
response.write "<font color=""#FF0000""></font>"
else
response.write "<a href='news.asp?cat_id="&rs1("cat_id")&"'></a>"
end if
sql="select * from newcat 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;<font color=""#FF0000"">·"&rs2("cat_name")&"</a></font>"
else
response.write "&nbsp;·<a href='news.asp?cat_id="&rs2("cat_id")&"'>"&rs2("cat_name")&"</a>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：main_news
'作  用：显示新闻位置导航
'参  数：无
'=================================================
sub main_news()
if cat_id>0 then
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='new.asp'>兜客采风</a>" & vbCrLf
  sql="select cat_id,cat_name,sid from newcat 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 newcat where cat_id="&rs3("sid")
     set rs4=conn.execute(sql)
     Response.Write " >> <a href=""news.asp?cat_id="&rs4("cat_id")&""">"&rs4("cat_name")&"</a>" 
     rs4.close
     set rs4=nothing
  end if
  Response.Write " >> <a href=""news.asp?cat_id="&rs3("cat_id")&""">"&rs3("cat_name")&"</a>" 
  rs3.close
  set rs3=nothing 
else
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='new.asp'>兜客采风</a>" & vbCrLf
end if
end sub

'=================================================
'过程名：search_news
'作  用：显示新闻搜索表单
'参  数：无
'=================================================
sub search_news()
Response.Write "<form name='form2' method='post' action='news.asp'><div align=center><input type='radio' name='select' value='news_title' checked class='inuptCG'>标题&nbsp;<input type='radio' name='select' value='news_content' class='inuptCG'>内容&nbsp;<input type='radio' name='select' value='review' class='inuptCG'>评论<br><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

'=================================================
'过程名：fl_news
'作  用：站点新闻调用
'参  数：num--------------调用条数
'        fontnum----------显示文字长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub fl_news(num,fontnum,classid,classyes,NewWindows)
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='100%'>" 
if classid=0 then
   sql="select top "&num&" * from news where passed=0 ORDER by news_id DESC"
else
   sql="select top "&num&" * from news where passed=0 and (cat_id="&classid&" or cat_id in(select cat_id from newcat where sid="&classid&")) order by news_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
   Response.Write "<font color=""#666666"">目前尚无任何兜客采风！</font>"
end if
do while not rs.eof
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if 
dim uclass
if classyes=True then 
   uclass="&nbsp;·<a href='news.asp?cat_id="&rs("cat_id")&"'>［"&rscat("cat_name")&"］</a>"
else
   uclass="&nbsp;<font color=#FF0000>·</font>" 
end if
Response.Write "<tr><td>"&indexdot&uclass&"<a href='shownews.asp?news_id="&rs("news_id")&"' "& nnn &" Title='采风名称："&rs("news_title")&"&#13&#10上传时间："&rs("news_date")&"&#13&#10浏览指数："&rs("news_count")&"'><font color="&rs("news_color")&">"&gotTopic(rs("news_title"),fontnum)&"</font></a>" & vbCrLf
Response.Write "</td><td align=right>" & vbCrLf 
Response.Write ""&Right("0"&month(rs("news_date")),2)&"/"&right("0"&day(rs("news_date")),2)&"" & vbCrLf
Response.Write "</td></tr>" & vbCrLf
rscat.close
set rscat=nothing  
rs.movenext      
loop
rs.close
set rs=nothing
Response.Write "</table>" 
end sub

'=================================================
'过程名：displayList_news
'作  用：带分页功能的新闻列表
'参  数：nn--------------标题长度
'        Hxperpage-----每页显示条数
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub displayList_news(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 newcat order by cat_id")
do while not hx01.eof
if mtyid=hx01("sid") then
hx66010=hx66010+" or cat_id="&hx01("cat_id") '显示页所需变量news.asp
end if
hx01.movenext
loop
hx01.close
set hx01=nothing
if request("cat_id")<>"" then
   sql="select * from news where (cat_id="&cat_id&hx66010&") and passed=0 order by istop desc,news_id DESC"
   Url_Add=Url_Add&"cat_id="&cat_id&"&"
elseif request("keyword")<>"" and (request("select")="news_title" or request("select")="news_content" or request("select")="review") then
   sql="select * from news where "&request("select")&" like '%"&Jencode(checkspace(request("keyword")))&"%' order by istop desc,news_id DESC"
   Url_Add=Url_Add&"select="&request("select")&"&keyword="&Server.URLEncode(request("keyword"))&"&"
else
sql="select * from news where passed=0 order by istop desc,news_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.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>"&rs.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='22%'>发表时间</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if not rs.eof then
   Dim Hx_Nums,MultiPages,i
   Rs.PageSize=Hxperpage
   Rs.AbsolutePage=CurPage
   Hx_Nums=Rs.RecordCount
   MultiPages="<tr><td colspan=""4"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until Rs.EOF OR i=Hxperpage
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1    
if rs("istop")="1" then      
folder="<img src=""img/1.gif"" title=固顶采风>"       
else
folder="<img src=""img/4.gif"">"       
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>" & vbCrLf
if classyes=True then Response.Write "<a href='news.asp?cat_id="&rs("cat_id")&"'>『"&left(rscat("cat_name"),10)&"』</a>"
Response.Write "<a href='shownews.asp?news_id="&rs("news_id")&"' Title='采风标题："&rs("news_title")&"&#13&#10发表时间："&rs("news_date")&"&#13&#10阅读次数："&rs("news_count")&"次' "& nnn &">"&gotTopic(rs("news_title"),nn)&"</a>"
if rs("isimg")=1 then
Response.Write "&nbsp;<img src='img/img.gif' alt='采风新闻' align=absmiddle border=0>" & vbCrLf
end if
if DateDiff("h",rs("news_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内新闻'>" & vbCrLf
end if
Response.Write "</td>"
Response.Write "<TD align=Center>"&rs("news_count")&"</TD>" & vbCrLf
Response.Write "<TD align=left>&nbsp;"&rs("news_date")&"</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
i=i+1
rs.movenext
loop
else
if rs.eof and rs.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
rs.close
set rs=nothing
end sub

'=================================================
'过程名：content_news
'作  用：显示文章标题、内容
'参  数：无
'=================================================
sub content_news()
%>     
<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("news_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 align='center'>［作者："&rs("news_author")&"&nbsp;&nbsp;来源："&rs("news_ahome")&"&nbsp;&nbsp;时间："&rs("news_date")&"&nbsp;&nbsp;阅读："&rs("news_count")&"次］</td>"
Response.Write "<td width='150' align='right'>[字体:"
Response.Write "<input type=button style='height:17' value='小' title='把正文字体缩小' onclick=fontSize('m','NewsBody')>" 
Response.Write "<input type=button style='height:17' value='大' title='把正文字体扩大' onclick=fontSize('b','NewsBody')>" 
Response.Write "<input type=button style='height:17' value='简' title='转为简体中文模式' onclick=bodytojt('NewsBody')>" 
Response.Write "<input type=button style='height:17' value='繁' title='转为繁体中文模式' onclick=bodytoft('NewsBody')>" 
Response.Write "<a href=""javascript:fontColor('NewsBody')""><img src='img/fgcolor.gif' alt='字体颜色' border=0 align='absmiddle'></a>]"
Response.Write "</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='95%' align='center' border='0' style=""word-break:break-all;table-layout:fixed;text-align:left"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td><div id=""NewsBody"" style=""display:block;padding:5px 20px;LINE-HEIGHT: 180%"">" & vbCrLf
if news_images<>"" and news_imgyes=1 then response.write "<BR><a href="&news_images&" target=_blank><img src="&news_images&" align=right onload=""javascript:if(this.width>screen.width-666)this.width=screen.width-666"" border=0 alt=按此在新窗口浏览图片></a>" & vbCrLf
Response.Write ""&rs("news_content")&"" & vbCrLf
Response.Write "</div></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
end sub

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

'=================================================
'过程名：pertinent_news
'作  用：显示相关新闻
'参  数：无
'=================================================
sub pertinent_news(n)
Response.Write "<table width=""97%"" align=""center"" bgcolor=""#FCFCFC"">" & vbCrLf
Response.Write "<tr><td background=""img/bg.gif"" style=""display:block;padding:0px 4px;LINE-HEIGHT: 210%"">"
dim strKey,arrKey,i
strKey=rs("news_keyword")
	if instr(strkey,"|")>1 then
		arrKey=split(strKey,"|")
		strKey="((news_keyword like '%" & arrKey(0) & "%')"
		for i=1 to ubound(arrKey)
			strKey=strKey & " or (news_keyword like '%" & arrKey(i) & "%')"
		next
		strKey=strKey & ")"
	else
		strKey="(news_keyword like '%" & strKey & "%')"
	end if
sql="select top " & n & " * from news where " & strKey & " and news_id <> "&rs("news_id")&" and passed=0 order by news_id DESC"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
Response.Write "·<a href='shownews.asp?news_id="&rs2("news_id")&"'>"&rs2("news_title")&"</a> "&rs2("news_date")&"<br>"  
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_news
'作  用：显示相关评论
'参  数：n-显示条数；point_news-评论开关,1-开启，0-关闭
'=================================================
sub review_news(n)
dim temp,i,j
if point_news="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>"
next
else
Response.Write "<tr><td style=""display:block;padding:0px 10px;LINE-HEIGHT: 180%"">当前没有评论</td></tr>"
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=news&news_id="&rs("news_id")&""">[查看更多评论] [发表我的评论]</a>&nbsp;&nbsp;</td></tr>"
Response.Write "</table>"
elseif point_news="0" then
Response.Write "<table width=""100%"" cellpadding=""5"" cellspacing=""0"" border=""0"">"
Response.Write "<tr><td  align=""center"">【采风评论已关闭】"
Response.Write "</td></tr>"
Response.Write "</table>"
End If
rs.close
set rs=nothing
end sub
%>

