<!-- #include file="include/con_article.asp" -->
<%

dim id
id=trim(request.querystring("id"))
if not(isnumeric(id)) then
  call format_redirect("article.asp")
end if
%>
<!-- #include file="include/jk_page_view.asp" -->
<!-- #include file="include/jk_review.asp" -->
<!-- #include file="include/jk_emoney.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<%
dim username,topic,word,tim,counter,comto,author,cod,tt,power,emoney,tcolor,PaginationType,MaxCharPerPage,tmp
sql="select top 1 * from article where hidden=1 and id="&id
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
  rs.close
  call format_redirect("article.asp")
end if
cid=rs("c_id")
sid=rs("s_id")
username=rs("username")
topic=rs("topic")
word=rs("word")
tim=rs("tim")
counter=rs("counter")
power=rs("power")
emoney=rs("emoney")
comto=rs("comto")
author=rs("author")
cod=rs("cod")
tcolor=rs("tcolor")
PaginationType=rs("PaginationType")
MaxCharPerPage=rs("MaxCharPerPage")
rs.close

cname="文章浏览"
sname=""
if cint(cid)>0 then
  if cint(sid)>0 then
    sql="select top 1 jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
  else
    sql="select top 1 c_name from jk_class where c_id="&cid
  end if
  set rs=joekoe_cms.exec(sql,1)
  if not(rs.eof) then
    cname=rs("c_name")
    if sid>0 then sname=rs("s_name")
    tit=cname&"（"&sname&"）"
  end if
  rs.close
end if

tit=cname
if sname<>"" then tit=tit&"（"&sname&"）- "&topic&""

page_power=power
call web_head(0,0,2,0,0)
call emoney_notes(power,emoney,n_sort,id,1,"article_list.asp?c_id="&cid&"&s_id="&sid)
'----------------------------中间 开始----------------------------
if int(cod)=1 then word=code_jk(word)
tim=joekoe_cms.time_type(tim,1)
topic=joekoe_cms.code_html(topic,1,0)
comto=joekoe_cms.code_html(comto,1,0)

dim id1,topic1,id2,topic2
id1=0
topic1=""
id2=0
topic2=""
sql="select top 1 id,topic from article where hidden=1 and id<"&id&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
if not(rs.eof) then
  id1=rs(0)
  topic1=rs(1)
end if
rs.close
sql="select top 1 id,topic from article where hidden=1 and id>"&id&" order by id"
set rs=joekoe_cms.exec(sql,1)
if not(rs.eof) then
  id2=rs(0)
  topic2=rs(1)
end if
rs.close

dim about_up,about_down,about_print
if topic1<>"" and var_null(topic1)<>"" then
  about_up="<a href='article_view.asp?id="&id1&"' title='"&joekoe_cms.code_html(topic1,1,0)&"'>"&joekoe_cms.code_html(topic1,1,25)&"</a>"
else
  about_up="<font class=gray>没有找到相关文章</font>"
end if
if topic2<>"" and var_null(topic2)<>"" then
  about_down="<a href='article_view.asp?id="&id2&"' title='"&joekoe_cms.code_html(topic2,1,0)&"'>"&joekoe_cms.code_html(topic2,1,25)&"</a>"
else
  about_down="<font class=gray>没有找到相关文章</font>"
end if
about_print="<a href='article_print.asp?id="&id&"' target=_blank>〖文章打印〗</a>"

if var_null(tcolor)<>"" then topic="<font color=#"&tcolor&">"&topic&"</font>"
tmp=CMS_Skin_Mod.GetDB("view")
tmp=Replace(tmp,"{$topic}",topic)
tmp=Replace(tmp,"{$comto}",comto)
tmp=Replace(tmp,"{$author}",author)
tmp=Replace(tmp,"{$web_name}",joekoe_cms.web_name)
tmp=Replace(tmp,"{$tim}",joekoe_cms.time_type(tim,5))
tmp=Replace(tmp,"{$remark}",ArticleContent())
tmp=Replace(tmp,"{$counter}",counter)
tmp=Replace(tmp,"{$username}",format_user_name(username,0,""))
tmp=Replace(tmp,"{$commend_friend}",commend_friend(tit,topic,"article_view.asp?id="&id))
tmp=Replace(tmp,"{$commend_err}",commend_err(tit,topic,id,n_sort,"err.asp?id="&id))
tmp=Replace(tmp,"{$tit_fir}","文章")
tmp=Replace(tmp,"{$about_up}",about_up)
tmp=Replace(tmp,"{$about_down}",about_down)
tmp=Replace(tmp,"{$about_print}",about_print)
Response.Write vbcrlf&tmp
call article_bar_top("文章分类",sort_type("article_list.asp?",0,0))
call article_bar_top("文章评论",review_type(n_sort,id,"article_view.asp?id="&id,1,username))
call joekoe_cms.exec("update article set counter=counter+1 where id="&id,0)
'----------------------------中间 结束----------------------------
call article_end()
call web_end(0,0)

%>
