<!-- #include file="include/con_help.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<%

dim h1,max_num,nummer,nums,rssum,page,viewpage,thepages,username,sql_add,sql_order,pageurl
h1=0
max_num=200
iframe=true
nummer=dim_num(0)
nums=nummer
page=1
index_url="forum_action"
tit_fir="论坛主题"
if action="user" or action="user_join" then
  username=trim(request.querystring("username"))
  if symbol_name(username)=false then action=""
end if
select case action
case "my"
  tit="我发布的主题"
  h1=2
case "join"
  tit="我参与的主题"
  h1=2
case "user"
  max_num=0
  sql_add=" where username='"&username&"'"
  sql_order="id desc"
  tit="（"&username&"）发布的主题"
  h1=1
case "user_join"
  max_num=0
  sql_add=" where id in (select reply_id from bbs_data where username='"&username&"')"
  sql_order="id desc"
  tit="（"&username&"）参与的主题"
  h1=1
case "hot"
  sql_order="re_counter desc,id desc"
  tit="论坛热贴"
case "good"
  sql_add=" where isgood=1"
  sql_order="id desc"
  tit="论坛精华"
case "tim"
  tit="回复新贴"
  sql_order="re_tim desc,id desc"
case "top"
  sql_add=" where istop>0"
  sql_order="istop desc,id desc"
  tit="论坛置顶"
case else
  sql_order="id desc"
  tit="论坛新贴"
end select
call web_head(h1,0,0,0,0)
select case action
case "my"
  max_num=0
  'sql_add=" where username='"&login_username&"'"
  sql_add=" where userid="&login_id
  sql_order="id desc"
  tit="我发布的主题"
case "join"
  max_num=0
  'sql_add=" where id in (select reply_id from bbs_data where username='"&login_username&"')"
  sql_add=" where id in (select reply_id from bbs_data where userid="&login_id&")"
  sql_order="id desc"
  tit="我参与的主题"
end select
'----------------------------左边 开始----------------------------
call left_action()
call left_help()
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr align=center>
<td class=td width=30>状态</td>
<td class=td width=*><%response.write img_skin("fk_plus")&"论坛主题（"&tit&"）"%></td>
<td class=td width=90>作者</td>
<td class=td width=70>回复/人气</td>
</tr>
<%
sql="select count(id) from bbs_topic "&sql_add
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
if rssum>max_num and max_num>0 then rssum=max_num
call format_pagecute()
sql="select top "&nummer*viewpage&" * from bbs_topic "&sql_add&" order by "&sql_order
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,0,1
if rs.eof then
  nums=0
else
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
end if
for i=1 to nums
  response.write vbcrlf&forum_topic_type(rs("id"),rs("forum_id"),joekoe_cms.code_html(rs("topic"),1,0),joekoe_cms.time_type(rs("tim"),2),rs("username"),rs("re_username"),joekoe_cms.time_type(rs("re_tim"),2),rs("counter"),rs("re_counter"),rs("istop"),rs("islock"),rs("isgood"),rs("isvote"),rs("vote_num"))
  rs.movenext
next
rs.close
pageurl="?action="&action&"&username="&username&"&"
%>
<tr><td class=bg_tds colspan=9 height=<%response.write m_hei%>>
&nbsp;最近&nbsp;<font class=red><%response.write rssum%></font>&nbsp;贴<%response.write tit_fir%>
&nbsp;页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
&nbsp;分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr>
</table>
<table border=0><tr><td height=30><%response.write forum_img_topic%></td></tr></table>
<%
response.write ukong

function forum_topic_type(t_id,t_forum_id,t_topic,t_tim,t_username,t_re_username,t_re_tim,t_counter,t_re_counter,t_istop,t_islock,t_isgood,t_isvote,t_vote_num)
  dim temp1
  temp1=temp1&vbcrlf&"<tr class=bg_td align=center>" & _
              vbcrlf&"<td>"&base_forum_is(t_re_counter,t_istop,t_islock,t_isgood,t_isvote,t_vote_num)&"</td>" & _
              vbcrlf&"<td align=left><a href='forum_view.asp?forum_id="&t_forum_id&"&view_id="&t_id&"' target=_blank alt='<b>"&joekoe_cms.code_html(t_topic,1,0)&"</b><br>发表时间："&t_tim&"<br>最后回复："&t_re_username&"<br>回复时间："&t_re_tim&"'>"&joekoe_cms.code_html(t_topic,1,28)&"</td>" & _
              vbcrlf&"<td>"&format_user_name(t_username,5,"")&"</td>" & _
              vbcrlf&"<td class=tims>"&t_re_counter&"/"&t_counter&"</td>" & _
              vbcrlf&"</tr>"
  forum_topic_type=temp1
end function
'----------------------------中间 结束----------------------------
call web_end(0,0)

%>