<!-- #include file="config_forum_board.asp" -->
<%
'-------------------------------------主题分页--------------------------------------
function index_pagecute(viewurl,replynum,pagecutenum,pagecutecolor)
  dim pagecutepage,pagecutei
  index_pagecute=""
  if replynum mod pagecutenum > 0 then
    pagecutepage=replynum\pagecutenum+1
  else
    pagecutepage=replynum\pagecutenum
  end if
  if pagecutepage>1 then
    for pagecutei=2 to 3
      if pagecutei>pagecutepage then exit for
      index_pagecute=index_pagecute & vbcrlf & "<a href='" & viewurl & "&page=" & pagecutei & "'><font color='" & pagecutecolor & "' title='第 " & pagecutei & " 页'>[" & pagecutei & "]</font></a>"
    next
    if pagecutepage>3 then
      if pagecutepage=4 then
        index_pagecute=index_pagecute & vbcrlf & "<a href='" & viewurl & "&page=4'><font color='" & pagecutecolor & "' title='第 4 页'>[4]</font></a>"
      else
        index_pagecute=index_pagecute & vbcrlf & "<font color='" & pagecutecolor & "'>… </font>" & "<a href='" & viewurl & "&page=" & pagecutepage & "'><font color='" & pagecutecolor & "' title='第 " & pagecutepage & " 页'>[" & pagecutepage & "]</font></a>"
      end if
    end if
  end if
  if len(index_pagecute)>1 then index_pagecute="<img src='images/small/page_head.gif' align=absMiddle alt='快速分页' border=0>"&index_pagecute
end function

'------------------------------------forum_list-------------------------------------
sub forum_view()
  dim new_win:new_win="new_win"
  dim ftt:ftt="":view_url=""
  if len(tcolor)>0 then ftt=ftt&"><font color='"&tcolor&"'"
  if tbb=true then ftt=ftt&"><b"
  select case int(istop)
  case 1
    folder_type="istop"
  case 2
    folder_type="istops"
  case else
    if int(isgood)=1 then
      folder_type="isgood"
    else
      if int(islock)=1 then
        folder_type="islock"
      elseif int(re_counter)>=10 then
        folder_type="ishot"
      end if
    end if
  end select
  
  if objv7.time_type(tim,3)=objv7.time_type(now_time,3) then new_win="new"
  
  view_url="forum_view.asp?forum_id="&forumnid&"&view_id="&id
  if int(re_counter)>0 then
    topic_head="<img loaded=no src='images/small/fk_plus.gif' border=0 id=followImg"&id&" style=""cursor:hand;"" onclick=""load_tree("&forumnid&","&id&")"" title='展开贴子列表'>"
  else
    topic_head="<img src='images/small/fk_minus.gif' border=0 id=followImg"&id&">"
  end if
  
  response.write vbcrlf&"<tr align=center class=tdbg-dark>" & _
  		 vbcrlf&"<td><img src='images/small/"&folder_type&".gif' border=0></td>" & _
  		 vbcrlf&"<td>"
  if action="manage" then
    response.write "<input type=checkbox name=del_id value='"&id&"'>"
  else
    response.write "<img src='images/icon/"&icon&".gif' border=0>"
  end if
  response.write "</td>" & _
  		 vbcrlf&"<td align=left>"&topic_head&"<a href='"&view_url&"'"&ftt&" title='主题："&objv7.code_html(topic,1,0)&"<br>发贴时间："&tim&"'>"&objv7.code_html(topic,0,22)&"</b></font></a>&nbsp;"&index_pagecute(view_url,re_counter+1,objv7.web_var(web_num,3),"#cc3300")&"</td>" & _
  		 vbcrlf&"<td>"&format_user_view(username,1,"")&"</td>" & _
  		 vbcrlf&"<td><a href='"&view_url&"' target=_blank><img src='images/small/"&new_win&".gif' alt='打开新窗口浏览此贴' border=0></a></td>" & _
  		 vbcrlf&"<td>"&re_counter&"<font class=gray>/</font>"&counter&"</td>" & _
  		 vbcrlf&"<td align=left><font class=time>"&objv7.time_type(re_tim,6)&"</font><font class=time>│</font>"&format_user_view(re_username,1,"")&"</td>" & _
  		 vbcrlf&"</tr>" & _
  		 vbcrlf&"<tr class=tdbg-dark style=""display:none"" id=follow"&id&" height=30><td colspan=2>&nbsp;</td><td colspan=6 id=followTd"&id&" style=""padding:0px""><div style=""width:240px;margin-left:18px;border:1px solid black;background-color:"&objv7.web_var(web_color,5)&";color:"&objv7.web_var(web_color,7)&";padding:2px"" onclick=""load_tree("&forumnid&","&id&")"">正在读取关于本主题的跟贴，请稍侯……</div></td></tr>"
  del_temp=del_temp+1
end sub

'-----------------------------------主题转移操作------------------------------------
sub forum_moved(fid,fw,vid)
  if not(isnumeric(fid)) or not(isnumeric(vid)) or login_mode<>objv7.format_power2(user_power,1,1) then response.write "<script language=javascript>alert(""转移主题失败：\n\n可能是您进行了不适合的操作！"");</script>":exit sub
  if fw=false then response.write "<script language=javascript>alert(""转移主题失败：\n\n可能是要转入的论坛为不可发贴模式！"");</script>":exit sub
  dim frs,fsql,ofid,dnum
  fsql="select forum_id from bbs_topic where id="&vid
  set frs=conn.execute(fsql)
  if frs.eof and frs.bof then
    frs.close:set frs=nothing:call close_conn()
    call cookies_type("view_id"):exit sub
  end if
  ofid=frs(0):frs.close
  fsql="select count(*) from bbs_data where reply_id="&vid
  set frs=conn.execute(fsql)
  dnum=frs(0):frs.close
  set frs=nothing
  fsql="update bbs_topic set forum_id="&fid&" where id="&vid
  conn.execute(fsql)
  fsql="update bbs_data set forum_id="&fid&" where reply_id="&vid
  conn.execute(fsql)
  fsql="update bbs_forum set forum_topic_num=forum_topic_num-1,forum_data_num=forum_data_num-"&dnum&" where forum_id="&ofid
  conn.execute(fsql)
  fsql="update bbs_forum set forum_topic_num=forum_topic_num+1,forum_data_num=forum_data_num+"&dnum&" where forum_id="&fid
  conn.execute(fsql)
  response.write "<script language=javascript>alert(""转移主题成功！"");</script>"
end sub
%>