<!-- #include file="skin.asp" -->
<!-- #include file="../style/data_forum.asp" -->
<!-- #include file="jk_preview.asp" -->

<%

joekoe_cms.ishealth=true
dim dim_forum,dim_forum_num,h_var3,ftit,forumid,viewid
dim_forum=split(web_dim(21),"|")
dim_forum_num=ubound(dim_forum)
h_var3=2
ftit=""
index_url="forum"
tit_fir=format_menu(index_url)
forumid=trim(request.querystring("forum_id"))
viewid=trim(request.querystring("view_id"))
m_channel=index_url
web_img_m="m_"&m_channel
web_img_h="h_"&m_channel

sub forum_load(lt1,lt2,lt3,lt4)
  response.write joekoe_cms.js_put("style/joekoe_select.js",0)
end sub

sub forum_istops()
  if var_null(application(joekoe_cms.web_cookies&"_forum_istops_state"))<>"" then
    exit sub
  end if
  sql="select id,forum_id,username,topic,tcolor,tbb,icon,tim,istop,isvote from bbs_topic where istop=2 order by re_tim desc"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if not rs.eof then
    application.lock
    application(joekoe_cms.web_cookies&"_forum_istops_state")="yes"
    application(joekoe_cms.web_cookies&"_forum_istops")=forum_get_istop(rs.getrows())
    application.unlock
  else
    application.lock
    application(joekoe_cms.web_cookies&"_forum_istops_state")="kong"
    application(joekoe_cms.web_cookies&"_forum_istops")=""
    application.unlock
  end if
  rs.close
end sub

function forum_get_istop(ttdim)
  if not isarray(ttdim) then
    forum_get_istop=""
    exit function
  end if
  dim ttnum,tbb,topic,temp1
  ttnum=ubound(ttdim,2)
  for i=0 to ttnum
    tbb=1
    if ttdim(5,i)=false then
      tbb=0
    end if
    topic=joekoe_cms.code_html(ttdim(3,i),1,0)
    isvote=0
    if ttdim(9,i) then
      isvote=1
    end if
    temp1=temp1&vbcrlf&forum_list_body_istop(ttdim(0,i),ttdim(1,i),ttdim(2,i),topic,ttdim(4,i),tbb,ttdim(6,i),ttdim(7,i),ttdim(8,i),isvote)
  next
  erase ttdim
  forum_get_istop=temp1
end function

sub forum_end()
  call forum_end_clear()
end sub

'-------------------------------------版主权限--------------------------------------
function forum_power_true(pvar)
  forum_power_true=false
  if int(login_modep)=1 then
    forum_power_true=true
    exit function
  end if
  if int(login_modep)>2 or pvar="" or login_username="" then
    exit function
  end if
  if instr("|"&lcase(pvar)&"|","|"&lcase(login_username)&"|")>0 then
    forum_power_true=true
  end if
end function

function forum_new_view_true(ftype)
  if int(ftype)>(dim_forum_num+1) then
    forum_new_view_true=true
    exit function
  end if
  forum_new_view_true=false
  dim f_type_var
  f_type_var=dim_forum(ftype-1)
  f_type_var=left(f_type_var,instr(f_type_var,":")-1)
  if instr("."&f_type_var&".","."&login_modep&".")>0 then
    forum_new_view_true=true
  end if
end function

sub forum_end_clear()
  erase dim_forum
  if isarray(forum_list_sorts) then erase forum_list_sorts
end sub

function forum_super_view(vars,vt)
  dim temp1,ddim,j
  temp1="版主:"
  if web_forum_power_type=1 then
    if var_null(vars)="" or vars="" then
     temp1=temp1&"&nbsp;<font class=gray>还没呢&nbsp;</font>"
    else
      ddim=split(vars,"|")
      for j=0 to ubound(ddim)
        temp1=temp1&"&nbsp;<a href='user_view.asp?username="&server.urlencode(ddim(j))&"' alt='查看（版主）"&ddim(j)&" 的详细资料' target=_blank>"&ddim(j)&"</a>"
      next
    end if
  else
    temp1=temp1&"&nbsp;<select name=forum_power_sel onchange=""if(this.options[this.selectedIndex].value!=''){window.open('user_view.asp?username='+this.options[this.selectedIndex].value);}""><option value='' class=gray>本版版主</option>"
    if var_null(vars)="" or vars="" then
      temp1=temp1&"<option value='' class=gray>还没呢</option>"
    else
      ddim=split(vars,"|")
      for j=0 to ubound(ddim)
        temp1=temp1&"<option value='"&ddim(j)&"'>"&ddim(j)&"</option>"
      next
    end if
    temp1=temp1&"</select>"
  end if
  if isarray(ddim) then erase ddim
  forum_super_view=temp1
end function

function forum_img_tim()
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%'>" & _
              vbcrlf&"<tr><td align=center>"&img_forum&"</td></tr>" & _
              vbcrlf&"<tr><td height=5></td></tr>" & _
              vbcrlf&"<tr><td align=center>时间格式：<font class=gray>年-月-日 时:分:秒</font>　当前时间："&joekoe_cms.now_time&"</a></td></tr>" & _
              vbcrlf&"</table>" & _
              vbcrlf&ukong
  forum_img_tim=temp1
end function

function forum_img_topic()
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%'>" & _
              vbcrlf&"<tr><td align=center>论坛主题图例： "&img_topic&"</td></tr>" & _
              vbcrlf&"</table>" & _
              vbcrlf&ukong
  forum_img_topic=temp1
end function

function forum_sea_go(st)
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%' cellspacing=0 cellpadding=0>" & _
              vbcrlf&"<tr><td>"
  if st="s" then
    temp1=temp1&vbcrlf&"  <table border=0>" & _
                vbcrlf&"  <form action='forum_search.asp?' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
                vbcrlf&"  <input type=hidden name=sea_fid value='"&forumid&"'>" & _
                vbcrlf&"  <input type=hidden name=action value='chk'>" & _
                vbcrlf&"  <input type=hidden name=page value='1'>" & _
                vbcrlf&"  <tr>" & _
                vbcrlf&"  <td>论坛搜索：</td>" & _
                vbcrlf&"  <td><select name=sea_type size=1>" & _
                vbcrlf&"<option value='topic'>按主题</option>" & _
                vbcrlf&"<option value='username'>按作者</option>" & _
                vbcrlf&"</select></td>" & _
                vbcrlf&"  <td><input type=text name=keyword size=20 maxlength=20></td>" & _
                vbcrlf&"  <td>&nbsp;<input type=submit value='搜 索'></td>" & _
                vbcrlf&"  </tr>" & _
                vbcrlf&"  </form>" & _
                vbcrlf&"  </table>"
  end if
  temp1=temp1&vbcrlf&"</td>" & _
              vbcrlf&"<td align=right>"&forum_go&"</td>" & _
              vbcrlf&"</tr>" & _
              vbcrlf&"<table>" & _
              vbcrlf&ukong
  forum_sea_go=temp1
end function

function forum_go()
  dim gi,gj,gnum,ocid,gdim,temp1
  ocid=0
  temp1=temp1&vbcrlf&"<select name=forum_sort_sel size=1 onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & _
              vbcrlf&"<option value=''>快速跳转论坛至...</option>"
  gnum=ubound(forum_list_sorts)
  for gi=0 to gnum
    gdim=split(forum_list_sorts(gi),"|")
    temp1=temp1&vbcrlf&"<option value='forum_list.asp?forum_id="&gdim(0)&"'>"
    if int(ocid)=int(gdim(1)) then
      for gj=1 to int(gdim(2))
        temp1=temp1&"│"
      next
      temp1=temp1&"├"
    else
      temp1=temp1&"╋"
      ocid=gdim(1)
    end if
    temp1=temp1&gdim(3)&"</option>"
  next
  temp1=temp1&vbcrlf&"</select>"
  if isarray(gdim) then erase gdim
  forum_go=temp1
end function


%>