<%

dim forumf,forumn,forumw,forumstar,forumparent,forumname,forumpower,forumtype,forumpro,forumtopicnum,forumdatanum

'-------------------------------------初始化 1--------------------------------------
sub forum_first()
  sql="select top 1 forum_id,class_id,forum_f,forum_n,forum_w,forum_star,forum_parent,forum_name,forum_power,forum_type,forum_pro,forum_topic_num,forum_data_num from bbs_forum where forum_id="&forumid&" and forum_hidden=0"
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof then
    rs.close
    call format_redirect("forum.asp")
  end if
  'classid=rs(1)
  forumf=rs(2)
  forumn=rs(3)
  forumw=rs(4)
  forumstar=rs(5)
  forumparent=rs(6)
  forumname=rs(7)
  forumpower=rs(8)
  forumtype=rs(9)
  forumpro=rs(10)
  forumtopicnum=rs(11)
  forumdatanum=rs(12)
  rs.close
  tit=forumname&"（"&ftit&"）"
  page_power=format_forum_type(forumtype,0,forumpro)
  'head_js=head_js&vbcrlf&"var forumid="&forumid&",forumname='"&forumname&"',forumpower='"&forumpower&"';"
end sub

'-------------------------------------论坛分级--------------------------------------
sub forum_grade()
  dim temp1,mdim,mnum
  temp1=application(joekoe_cms.web_cookies&"_forum_grade_"&forumid)
  if var_null(temp1)="" then
    sql="select forum_id,forum_name from bbs_forum where forum_id in ("&forumparent&") order by forum_star desc,forum_order"
    call joekoe_cms.exec(sql,-1)
    rs.open sql,conn,1,1
    mdim=rs.getrows()
    rs.close
    mnum=ubound(mdim,2)
    for i=0 to mnum
      temp1="&nbsp;→&nbsp;<a href='forum_list.asp?forum_id="&mdim(0,i)&"'>"&mdim(1,i)&"</a>"&temp1
    next
    erase mdim
    application.lock
    application(joekoe_cms.web_cookies&"_forum_grade_"&forumid)=temp1
    application.unlock
  end if
  response.write vbcrlf&"<table cellspacing=1 cellpadding=1   width='768'>" & _
		 vbcrlf&"<tr><td class=bg_td height=25>" & _
		 		 
	 
		 vbcrlf&"<table border=0 width='768' class=tf>" & _
		 vbcrlf&"<tr><td width='768' class=bw>&nbsp;<img src='skin/"&joekoe_cms.web_skin&"/forum/forum_tit.gif' align=absMiddle border=0>&nbsp;" & _
		 vbcrlf&"<a href='forum.asp'>"&tit_fir&"</a>&nbsp;"&temp1&"&nbsp;→&nbsp;"&ftit&"" & _
		 vbcrlf&"</td></tr>" & _
		 vbcrlf&"</table>" & _
		 vbcrlf&"</td></tr>" & _
		 vbcrlf&"</table>" & _
		 vbcrlf&ukong
  call web_branch(0)
end sub

'-------------------------------------论坛标头--------------------------------------
sub forum_top(ft)
  dim temp1
  temp1=vbcrlf&"<table border=0 width='768' cellspacing=0 cellpadding=0>" & _
	vbcrlf&"<tr>" & _
	vbcrlf&"<td><a href='forum_write.asp?forum_id="&forumid&"'><img src='skin/"&joekoe_cms.web_skin&"/forum/new_topic.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表新主题'></a>&nbsp;" & _
	vbcrlf&"&nbsp;<a href='forum_write.asp?forum_id="&forumid&"&isvote=yes'><img src='skin/"&joekoe_cms.web_skin&"/forum/new_vote.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表新调查'></a>&nbsp;" & _
	vbcrlf&"&nbsp;"&ft&"</td>" & _
	vbcrlf&"<td align=right>"&forum_super_view(forumpower,web_forum_power_type)&"&nbsp;" & _
	vbcrlf&"<font class=gray>[<a href='forum_list.asp?forum_id="&forumid&"&action=isgood'>精华</a>]&nbsp;" & _
	vbcrlf&"[<a href='forum_event.asp?forum_id="&forumid&"'>事件</a>]&nbsp;" & _
	vbcrlf&"[<a href='forum_list.asp?forum_id="&forumid&"&action=manage'>管理</a>]</font></td>" & _
	vbcrlf&"</tr></table>" & _
	vbcrlf&ukong
  response.write temp1
  call web_branch(0)
end sub

'-------------------------------------论坛等级--------------------------------------
function format_forum_type(fvars,ft,fpros)
  if isnumeric(fpros) and int(ft)=1 then
    if int(fpros)=1 then
      format_forum_type="只读论坛"
      exit function
    end if
  end if
  dim fvar
  fvar=fvars-1
  format_forum_type=""
  for i=0 to ubound(dim_forum)
    if int(ft)=0 then
      if fvar=i then
        format_forum_type=left(dim_forum(i),instr(dim_forum(i),":")-1)
        exit for
      end if
    else
      if fvar=i then
        format_forum_type=right(dim_forum(i),len(dim_forum(i))-instr(dim_forum(i),":"))
        exit for
      end if
    end if
  next
end function

%>