<!-- #include file="config.asp" -->
<!-- #include file="skin.asp" -->
<%
'论坛事件-------开始---------
dim forum_mode,forum_table1,forum_table2,forum_table3,forum_table4,ptnums,ffk
'论坛事件-------结束---------
dim classid,classname,forumf,forumn,forumw,forumid,viewid,forumname,forumpower,forumtype,forumtopicnum,forumdatanum,forumreadonly,forumpro,word_size,word_remark,color,bb      '后台论坛主题加色和加粗的变量定义(color,bb)
forum_table1=format_table(1,3)
forum_table2=format_table(5,2)
forum_table3=format_table(3,5)
forum_table4=format_table(3,1)
forumid=trim(request.querystring("forum_id"))
viewid=trim(request.querystring("view_id"))
ffk="fk4"
index_url="forum"
tit_fir=format_menu(index_url)
ptnums=web_var_num(web_setup,6,1)

'-------------------------------------初始化 1--------------------------------------
sub forum_first()
  sql="select bbs_class.class_name,bbs_forum.class_id,bbs_forum.forum_f,bbs_forum.forum_n,bbs_forum.forum_w,bbs_forum.forum_name,bbs_forum.forum_power,bbs_forum.forum_topic_num,bbs_forum.forum_data_num,bbs_forum.forum_type,bbs_forum.forum_pro " & _
      "from bbs_class inner join bbs_forum on bbs_forum.class_id=bbs_class.class_id where bbs_forum.forum_id="&forumid&" and bbs_forum.forum_hidden=0"
'--------------------------------------------------------------------------
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    rs.close:set rs=nothing
    call close_conn()
    call cookies_type("forum_id")
  end if
  classid=rs("class_id"):classname=rs("class_name")
  forumf=int(rs("forum_f")):forumn=int(rs("forum_n")):forumw=rs("forum_w")
  forumname=rs("forum_name"):forumpower=rs("forum_power")
  forumtopicnum=rs("forum_topic_num"):forumdatanum=rs("forum_data_num")
  forumtype=rs("forum_type"):forumpro=rs("forum_pro")
  rs.close
  if not(isnumeric(forumpro)) then forumpro=0
  page_power=format_forum_type(forumtype,0,forumpro)
  
end sub
'-------------------------------------论坛导航--------------------------------------
sub forum_grade()
  dim sql,rs,fo
  call forum_grade_board(forumf,fo)
response.write ukong&"<table border=1 width='98%' cellspacing=1 cellpadding=1 bordercolor="&web_var(web_color,3)&">" & _
		 vbcrlf&"<tr><td height=25><table border=0 width='100%' "&forum_table3& "><tr><td width='100%' class=bw>"&img_small(ffk)&"&nbsp;&nbsp;<a href='forum.asp'>"&tit_fir&"</a>&nbsp;→&nbsp;<font class=gray>"&code_html(classname,1,0)&"</font>"&fo&"&nbsp;→&nbsp;<a href='forum_list.asp?forum_id="&forumid&"'>"&code_html(forumname,1,0)&"</a></td></tr></table></td></tr>" & _
		 vbcrlf&"</table>"
end sub

sub forum_grade_board(fid,fo)
  if int(fid)<1 then exit sub
  dim sql,rs,f_f,fname:f_f=0
  sql="select forum_f,forum_name from bbs_forum where forum_id="&fid
  set rs=conn.execute(sql)
  if not(rs.eof and rs.bof) then f_f=int(rs(0)):fname=rs(1)
  rs.close:set rs=nothing
  fo="&nbsp;→&nbsp;<a href='forum_list.asp?forum_id="&fid&"'>"&code_html(fname,1,0)&"</a>"&fo
  if int(f_f)>0 then call forum_grade_board(f_f,fo)
end sub

'-------------------------------------论坛标头--------------------------------------
function forum_top(ft)
  forum_top=vbcrlf & "<table border=0 width=760>" & _
     vbcrlf & "<tr height=30>" & _
     vbcrlf & "<td>"
if forumreadonly=0 then
  forum_top=forum_top& vbcrlf & "<a href='forum_write.asp?forum_id="&forumid&"'><img src='images/"&web_var(web_config,5)&"/new_topic.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表新贴子'></a>" &_
	               vbcrlf & "<a href='forum_write.asp?forum_id="&forumid&"&poll=yes'><img src='images/"&web_var(web_config,5)&"/new_poll.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表我的投票'></a>" &_
                       vbcrlf & "<a href='xzb_write.asp?forum_id="&forumid&"&xzb=yes'><img src='images/"&web_var(web_config,5)&"/xzb_poll.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表小字报'></a>&nbsp;"&ft&"</td>"
else
 if format_power(login_mode,0)="admin" then
forum_top=forum_top& vbcrlf & "<a href='forum_write.asp?forum_id="&forumid&"'><img src='images/"&web_var(web_config,5)&"/new_topic.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表新贴子'></a>" &_ 
	               vbcrlf & "<a href='forum_write.asp?forum_id="&forumid&"&poll=yes'><img src='images/"&web_var(web_config,5)&"/new_poll.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表我的投票'></a>" &_
                       vbcrlf & "<a href='xzb_write.asp?forum_id="&forumid&"&xzb=yes'><img src='images/"&web_var(web_config,5)&"/xzb_poll.gif' align=absMiddle border=0 title='在 "&forumname&" 里发表小字报'></a>&nbsp;"&ft&"</td>"
 else
forum_top=forum_top& vbcrlf & "<b><font class=red>[ 本论坛为只读论坛 ]</font></b>&nbsp;&nbsp;"&ft&"</td>"
 end if
end if
  forum_top=forum_top& vbcrlf & "<td>&nbsp;" & _

	    vbcrlf & "<td align=right>"&forum_power(forumpower,ptnums)&"&nbsp;" & _
	    vbcrlf & "<font class=gray>[<a href='forum_list.asp?forum_id="&forumid&"&action=isgood'>精华</a>]&nbsp;" & _
	    vbcrlf & "[<a href='forum_even.asp?forum_id="&forumid&"'>事件</a>]&nbsp;" & _
	    vbcrlf & "[<a href='forum_list.asp?forum_id="&forumid&"&action=manage'>管理</a>]</font></td>" & _
	    vbcrlf & "</tr></table>"
		
end function

'-------------------------------------数据生成--------------------------------------
sub forum_word()
  word_size=web_var(web_num,6)
  word_remark=web_var(web_error,3)&"<br>长度<="&word_size&"KB"
end sub

'-------------------------------------论坛版主--------------------------------------
function forum_power(forum_admin,ft)
  dim forumadmin,k
  forum_power="<img src='images/small/forum_power.gif' title='论坛版主' align=absmiddle border=0>&nbsp;"
  if ft=0 then forum_power=forum_power&"<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}""><option>本版版主</option><option>--------</option>"
  if forum_admin<>"" and not isnull(forum_admin) then
    forumadmin=split(forum_admin, "|")
    for k=0 to ubound(forumadmin)
      if ft=0 then
        forum_power=forum_power&"<option value='user_view.asp?username=" & server.urlencode(forumadmin(k)) & "'>"&forumadmin(k)&"</option>"
      else
        forum_power=forum_power & "<a href='user_view.asp?username=" & server.urlencode(forumadmin(k)) & "' title='查看（版主）" & forumadmin(k) & " 的详细资料' target=_blank>" & forumadmin(k) & "</a>&nbsp;"
      end if
    next
    erase forumadmin
  else
    if ft=0 then
      forum_power=forum_power&"<option>还没呢</option>"
    else
      forum_power=forum_power & "<font class=gray>还没呢&nbsp;</font>"
    end if
  end if
  if ft=0 then forum_power=forum_power&"</select>"
end function

'-------------------------------------论坛等级--------------------------------------
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
  dim fdim,fvar:fvar=fvars-1:format_forum_type=""
  fdim=split(forum_type,"|")
  for i=0 to ubound(fdim)
    if int(ft)=0 then
      if fvar=i then format_forum_type=left(fdim(i),instr(fdim(i),":")-1):exit for
    else
      if fvar=i then format_forum_type=right(fdim(i),len(fdim(i))-instr(fdim(i),":")):exit for
    end if
  next
  erase fdim
end function
'-----------------------------------主题转移操作------------------------------------
sub forum_moved(fid,vid)
  if not(isnumeric(fid)) or not(isnumeric(vid)) or (login_mode<>format_power2(1,1) and login_mode<>format_power2(2,1)) then response.write "<script language=javascript>alert(""转移主题失败：\n\n可能是您进行了不适合的操作！"");</script>":exit sub
'论坛事件-------开始---------
  dim frs,fsql,ip,fmt,fmu,topic,username
topic=trim(request.querystring("topic"))
username=trim(request.querystring("username"))
'论坛事件-------结束---------
  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:close_conn
    call cookies_type("view_id"):exit sub
  end if
  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)
'论坛事件-------开始---------
ip=Request.ServerVariables("REMOTE_ADDR")
fsql="insert into log (l_announceid,l_boardid,l_touser,l_username,l_content,l_ip) values ("&vid&","&fid&",'"&username&"','"&login_username&"','转移贴子《"&topic&"》，分值操作：没有','"&ip&"')"
  conn.execute(fsql)
'论坛事件-------结束---------
  response.write "<script language=javascript>alert(""转移主题成功！"");</script>"
end sub

'-------------------------------------主题转移--------------------------------------

function forum_move(fmfid,fmid,fmt,fmu)
  dim rsclass,strsqlclass,rsboard,strsqlboard,fid,fb,cid
  forum_move=vbcrlf & "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & _
	   vbcrlf & "<option selected>将此主题转移至...</option>"
  strsqlclass="select class_id,class_name from bbs_class order by class_order"
  set rsclass=conn.execute(strsqlclass)
  if not(rsclass.bof and rsclass.eof) then
    do while not rsclass.eof
      cid=rsclass("class_id")
      call forum_move_board(cid,0,fmfid,fmid,0,fb)
      forum_move=forum_move & vbcrlf & "<option class=bg_2>╋ "& rsclass("class_name") &"</option>"
      forum_move=forum_move & fb
      fb=""
      rsclass.movenext
    loop
  end if
  set rsclass=nothing:set rsboard=nothing
  forum_move=forum_move & vbcrlf & "</select>"
end function

sub forum_move_board(cid,fid,fmfid,fmid,ff,fo)
  dim rsboard,strsqlboard,forumid,forumname,fi,foo,fmt,fmu,topic,username
  topic=trim(request.querystring("topic"))
  username=trim(request.querystring("username"))
  strsqlboard="select forum_id,forum_name,forum_power,forum_hidden from bbs_forum where forum_hidden=0 and forum_f="&fid&" and class_id=" & cid & " order by forum_order"
  set rsboard=conn.execute(strsqlboard)
  if rsboard.eof and rsboard.bof then
    rsboard.close:set rsboard=nothing
    exit sub
  end if
  do while not rsboard.eof
    forumid=rsboard("forum_id"):forumname=rsboard("forum_name")
    foo=vbcrlf & "<option"
    if int(forumid)<>int(fmfid) then  foo=foo&" value='forum_list.asp?action=move&view_id="&fmid&"&forum_id=" &forumid& "&topic="&fmt&"&username="&fmu&"'"
    foo=foo&">"
    for fi=0 to ff
      if fi=ff then
        foo=foo&"├"
      else
        foo=foo&"│"
      end if
    next
    foo=foo&forumname & "</option>"");"
    fo=fo&foo
    call forum_move_board(cid,forumid,fmfid,fmid,ff+1,fo)
    rsboard.movenext
  loop
  rsboard.close:set rsboard=nothing
end sub

'-------------------------------------论坛跳转--------------------------------------
sub forum_go_board(cid,fid,ff,fo)
  dim rsboard,strsqlboard,forumid,forumname,fi,foo
  strsqlboard="select forum_id,forum_name,forum_power,forum_hidden from bbs_forum where forum_f="&fid&" and class_id=" & cid & " order by forum_order"
  set rsboard=conn.execute(strsqlboard)
  if rsboard.eof and rsboard.bof then
    rsboard.close:set rsboard=nothing
    exit sub
  end if
  do while not rsboard.eof
    forumid=rsboard("forum_id"):forumname=rsboard("forum_name")
    foo=vbcrlf&"document.write (""<option value='forum_list.asp?forum_id=" &forumid& "'>"
    for fi=0 to ff
      if fi=ff then
        foo=foo&"├"
      else
        foo=foo&"│"
      end if
    next
    foo=foo&forumname & "</option>"");"
    fo=fo&foo
    call forum_go_board(cid,forumid,ff+1,fo)
    rsboard.movenext
  loop
  rsboard.close:set rsboard=nothing
end sub

function forum_go()
  dim rsclass,strsqlclass,rsboard,strsqlboard,fb:fb=""
  forum_go=vbcrlf & "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & _
	   vbcrlf & "<option selected>快速跳转论坛至...</option>"
  strsqlclass="select class_id,class_name from bbs_class order by class_order"
  set rsclass=conn.execute(strsqlclass)
  if not(rsclass.bof and rsclass.eof) then
    do while not rsclass.eof
      call forum_go_board(rsclass("class_id"),0,0,fb)
      forum_go=forum_go & vbcrlf & "<option class=bg_2>╋ "& rsclass("class_name") &"</option>"
      forum_go=forum_go & fb
      fb=""
      rsclass.movenext
    loop
  end if
  set rsclass=nothing:set rsboard=nothing
  forum_go=forum_go & vbcrlf & "<option class=bg_2>————————</option>" & _
	   vbcrlf & "<option value='forum.asp' class=bg_1>"&tit_fir&"首页</option>" & _
	   vbcrlf & "<option class=bg_2>————————</option>" & _
	   vbcrlf & "<option value='forum_action.asp?action=new'>　♀ 论坛新贴</option>" & _
	   vbcrlf & "<option value='forum_action.asp?action=tim'>　♀ 回复新贴</option>" & _
	   vbcrlf & "<option value='user_action.asp?action=list'>　♀ 用户列表</option>" & _
	   vbcrlf & "<option value='help.asp?action=forum'>　♀ 论坛帮助</option>" & _
	   vbcrlf & "</select>"
end function

'-------------------------------------主题分页--------------------------------------
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

'---------------------------------------main----------------------------------------
sub forum_down(dt)
  dim udim,ui,j,dts,sql,rs,l_username,forum_table4,online
  online=trim(request.querystring("online"))
  j=5:dts=0:forum_table4=format_table(3,1)
  if forum_mode="full" then j=8
  if online="close" or dt=1 then dts=0
  if online="open" then dts=1
  response.write forum_table1
%>
<tr<%response.write forum_table2%>><td>&nbsp;<%response.write img_small("fk4") %>&nbsp;<font class=end><b>论坛图例</b></font></td></tr>
<tr<%response.write forum_table4%>><td align=center height=30><% response.write ip_sys(0,0) %></td></tr>
<tr<%response.write forum_table4%>><td align=center height=30><%response.write user_power_type(0)%></td></tr>
<tr<%response.write forum_table4%>><td align=center>
  <table border=0 width='98%'>
  <tr><td colspan=5>网站当前总共有 <font class=red><%response.write online_num%></font> 人在线，其中注册用户 <font class=red>
  <%sql="select count(l_id) from user_login where l_type=0"
  set rs=conn.execute(sql)
  response.write rs(0)
  rs.close%></font> 人。<img src='images/small/new.gif'> [ <a href='?mode=<%response.write forum_mode%>&online=<%
if dts=0 then
  response.write "open'>关闭"
else
  response.write "close'>打开"
end if
%>在线列表</a> ] </td></tr>
<%if dts<>1 then%>
  <tr><td width='20%'></td><td width='20%'></td><td width='20%'></td><td width='20%'></td><td width='20%'></td></tr>
<%
  sql="select user_login.*,user_data.power from user_data inner join user_login on user_login.l_username=user_data.username where user_login.l_type=0 order by user_login.l_id"
  set rs=conn.execute(sql)
  do while not rs.eof
    response.write "<tr>"
    for ui=1 to 5
      if rs.eof then exit for
      l_username=rs("l_username")
      response.write "<td>"&img_small("icon_"&rs("power"))&"<a href='user_view.asp?username="&server.urlencode(l_username)&"' title='目前位置："&rs("l_where")&"<br>来访时间："&rs("l_tim_login")&"<br>活动时间："&rs("l_tim_end")&"<br>"&ip_types(rs("l_ip"),l_username,0)&"<br>"&view_sys(rs("l_sys"))&"' target=_blank>"&l_username&"</a></td>"
      rs.movenext
    next
    response.write "</tr>"
  loop
  rs.close
set rs=nothing

dim abc
  sql="select * from user_login where l_type=1 order by l_id"
  set rs=conn.execute(sql)
  do while not rs.eof
    response.write "<tr>"
    for ui=1 to 5
      if rs.eof then exit for
        l_username=rs("l_username")
		if l_username=request.cookies("joekoe_online")("guest_name") then
		abc="class=blue"
		else
		abc=""
		end if
        response.write "<td>"&img_small("icon_other")&"<font "&abc&" title='目前位置："&rs("l_where")&"<br>来访时间："&rs("l_tim_login")&"<br>活动时间："&rs("l_tim_end")&"<br>"&ip_types(rs("l_ip"),l_username,0)&"<br>"&view_sys(rs("l_sys"))&"' target=_blank>游客</font></td>"
        rs.movenext
      next
    response.write "</tr>"
  loop
  rs.close
end if
set rs=nothing
%>
  </table>
</td></tr>
</table>
<table border=0 width='100%'>
<tr<%response.write forum_table4%>><td align=center height=50>
<%
udim=split(forum_type,"|")
for ui=0 to ubound(udim)
  response.write vbcrlf&"&nbsp;<img src='images/"&web_var(web_config,5)&"/label_"&ui+1&".gif' title='无新贴' border=0 align=absmiddle><img src='images/"&web_var(web_config,5)&"/label_"&ui+1&"n.gif' title='有新贴' border=0 align=absmiddle>&nbsp;"&right(udim(ui),len(udim(ui))-instr(udim(ui),":"))&"&nbsp;"
next
erase udim
%>
</td></tr>
<tr<%response.write forum_table4%>><td align=center height=20>
网站时间格式：<font class=gray>年-月-日 时:分:秒</font>　当前时间：<%response.write now_time%>　&nbsp;论坛显示模式：<a href='?online=<%response.write online%>&mode=<%
if forum_mode="full" then
  response.write "half'>半屏"
else
  response.write "full'>全屏"
end if
%>模式</a>
</td></tr>
</table>
<%
  response.write kong
end sub
sub forum_cast(nh,nj,n_num,c_num)
  dim temp1,njj,topic,tbb:njj=""
  if nj<>"" then njj=img_small(nj)
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
  sql="select top "&n_num&" id,topic,username,tim from bbs_cast where sort='forum' order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    temp1=temp1&"<tr><td class=bw height="&space_mod&">"&njj&"<a href='update.asp?action=forum&id="&rs("id")&"' target=_blank title='公告标题："&code_html(topic,1,0)&"<br>管 理 员："&rs("username")&"<br>发布时间："&time_type(rs("tim"),88)&"'>"&code_html(topic,1,c_num)&"</a></td></tr>"
    rs.movenext
  loop
  temp1=temp1&"</table>"
  response.write "<table  border='0' cellspacing='0' cellpadding='0'><tr><td width='100%' height=4></td></tr></table>"&forum_table1&"<tr"&forum_table2&"><td> "&img_small("fk4") &" <font class=end><b>论坛公告</b></font></td></tr><tr"&forum_table4&"><td align=center height=30>"&temp1&"</td></tr></table>"
end sub

sub forum_cast_2(nh,nj,n_num,c_num)
  dim temp1,njj,topic,tbb:njj=""
  if nj<>"" then njj=img_small(nj)
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
  sql="select top "&n_num&" id,topic,username,tim from bbs_cast where sort='forum' order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    temp1=temp1&"<tr><td class=bw height="&space_mod&"><img src='IMAGES/SMALL/forum_01.gif'>&nbsp;<a href='update.asp?action=forum&id="&rs("id")&"' target=_blank title='公告标题："&code_html(topic,1,0)&"<br>管 理 员："&rs("username")&"<br>发布时间："&time_type(rs("tim"),88)&"'>"&code_html(topic,1,c_num)&"</a></td></tr>"
    rs.movenext
  loop
  temp1=temp1&"</table>"
  response.write temp1&kong
end sub

sub forum_new(nh,nj,fid,n_num,c_num,tb)
  dim temp1,njj,topic,tbb:njj="":tbb=""
  if nj<>"" then njj=img_small(nj)
  if tb=1 then tbb=" target=_blank"
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
  sql="select top "&n_num&" id,forum_id,topic,tim,username,re_username from bbs_topic where forum_id not in (select forum_id from bbs_forum where forum_info_disp<>0)"
  if fid>0 then sql=sql&" and forum_id="&fid
  sql=sql&" order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    temp1=temp1&"<tr><td class=bw height="&space_mod&" >"&njj&"<a href='forum_view.asp?forum_id="&rs("forum_id")&"&view_id="&rs("id")&"'"&tbb&" title='贴子主题："&code_html(topic,1,c_num)&"<br>发 贴 人："&rs("username")&"<br>发贴时间："&time_type(rs("tim"),88)&"<br>最后回复："&rs("re_username")&"'>"&code_html(topic,1,c_num)&"</a></td></tr>"
    rs.movenext
  loop
  temp1=temp1&"</table>"
  response.write"<table  border='0' cellspacing='0' cellpadding='0'><tr><td width='100%' height=4></td></tr></table>"&forum_table1&"<tr"&forum_table2&"><td> "&img_small("fk4") &" <font class=end><b>论坛新贴</b></font></td></tr><tr"&forum_table4&"><td align=center height=30>"&temp1&"</td></tr></table>"
end sub

sub forum_new_2(nh,nj,fid,n_num,c_num,tb)
  dim temp1,njj,topic,tbb:njj="":tbb=""
  if nj<>"" then njj=img_small(nj)
  if tb=1 then tbb=" target=_blank"
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2 class=tf>"
  sql="select top "&n_num&" id,forum_id,topic,tim,username,re_username from bbs_topic where forum_id not in (select forum_id from bbs_forum where forum_info_disp<>0)"
  if fid>0 then sql=sql&" and forum_id="&fid
  sql=sql&" order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    temp1=temp1&"<tr><td class=bw height="&space_mod&"><img src='IMAGES/SMALL/forum_02.gif'>&nbsp;<a href='forum_view.asp?forum_id="&rs("forum_id")&"&view_id="&rs("id")&"'"&tbb&" title='贴子主题："&code_html(topic,1,c_num)&"<br>发 贴 人："&rs("username")&"<br>发贴时间："&time_type(rs("tim"),88)&"<br>最后回复："&rs("re_username")&"'>"&code_html(topic,1,c_num)&"</a></td></tr>"
    rs.movenext
  loop
  temp1=temp1&"</table>"
    response.write temp1&kong
end sub

function forum_main(mh)
  dim rsclass,strsqlclass,rsforum,strsqlforum,rstopic,sqltopic,topics,classid,forumid,forumname,forum_type,forum_new_info,forum_pic,new_info_dim,forumpic,forumn,forumw,ftn
  strsqlclass="select class_id,class_name from bbs_class order by class_order"
  set rsclass=conn.execute(strsqlclass)
  do while not rsclass.eof
    classid=rsclass("class_id")
    call forum_board(0,classid,0,rsclass("class_name"))
    rsclass.movenext
  loop
  rsclass.close:set rsclass=nothing
end function

sub forum_tools()
  dim temp1,nh
  temp1="<table border=0 width=98% cellspacing=0 cellpadding=2 class=tf>"
  temp1=temp1&"<tr><td class=bw><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><div align=center><a href=user_action.asp?action=list target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/user.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=user_action.asp?action=emoney target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/money.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=forum_action.asp?action=new target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/new.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=forum_action.asp?action=good target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/good.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=help.asp?action=forum target=_self>"
  temp1=temp1&"<img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/help.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=forum_action.asp?action=hot target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/hot.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=forum_action.asp?action=top target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/top.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=search.asp?action=help target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/search.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=user_edit.asp target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/info.gif width=70 height=70 border=0></a></div></td><td><div align=center><a href=z_zvm_index.asp target=_self><img onmouseover=alpha_aba(this) style='FILTER: alpha(opacity=100)' src=images/forum/banzhu.gif width=70 height=70 border=0></a></div></td></tr></table></td></tr>"
  temp1=temp1&"</table>"
  response.write"<table border=0 width=100% cellspacing=1 cellpadding=1 bgcolor="&web_var(web_color,3)&"><tr bordercolor='#5EACD7'><td background=images/"&web_var(web_config,5)&"/bg_td.gif height=25><img border=0 src='images/"&web_var(web_config,5)&"/fk4.gif' align=absmiddle>  <font class=end><b>≡≡论坛工具≡≡</b></font></td></tr><tr bgcolor='#FFFFFF' bordercolor='#FFFFFF'><td align=center height=30>"&temp1&"</td></tr></table>"
end sub

sub user_birthday()   '用户生日
  dim temp1
  dim age
  dim birthuser,birthnum
  dim birthday
  birthnum=0
  'on error resume next

  set rs=conn.execute("select username,birthday from [user_data]")
    do while not rs.eof
      if rs(1)="" then
        rs.movenext
      elseif month(rs(1))<>month(now()) or day(rs(1))<>day(now()) then 
        rs.movenext
      else
        if isdate(rs(1)) then 
          age=datediff("yyyy",rs(1),Now())
          birthday=birthday & "<a href=user_view.asp?username="&rs(0)&" title=祝"&age&"岁生日快乐！ target=_blank> 〖祝 <font class=blue><b>"&rs(0)&"</b></font> 生日快乐  <img src=images/small/birthday.gif align=absmiddle border=0>〗</a>"
          birthnum=birthnum+1
        end if 
        rs.movenext
      end if 
    loop
  rs.close
  if birthnum=0 then
    birthday="<font color=#FF0000>※今天没有会员过生日※</font>"
  end if 
  set rs=nothing
  temp1=forum_table1&"<tr"& forum_table2&"><td>&nbsp;"&img_small("fk4")&" <font class=end><b>今天过生日的会员（共 "&birthnum&" 人）</b></font></td></tr>" & _
  vbcrlf&"<tr"& format_table(3,1)&"><td align=center height=30>"&birthday&"</td></tr>" & _
  vbcrlf&"</table>"
  response.write temp1&kong
end sub

'联盟论坛开始
sub links_main(lt,nummer)
  dim temp1,nname
  temp1=forum_table1&"<tr"& forum_table2&"><td>&nbsp;"&img_small("fk4")&" <font class=end><b>联盟论坛</b></font></td></tr>" & _
  vbcrlf&"<tr"& format_table(3,1)&"><td align=center><table border=0 width='100%' cellspacing=0 cellpadding=0>"
  sql="select * from links where sort='"&lt&"' and hidden=1 order by orders"
  set rs=conn.execute(sql)
  do while not rs.eof
    temp1=temp1&vbcrlf&"<tr align=center height=40>"
    for i=1 to nummer
      if rs.eof then exit for
      temp1=temp1&vbcrlf&"<td width='16%'><a href='"&rs("url")&"' target=_blank>"
      if lt="txt" then
        temp1=temp1&code_html(rs("nname"),1,0)
      else
        temp1=temp1&"<img src='"&rs("pic")&"' border=0 width=88 height=31 title='"&code_html(rs("nname"),1,0)&"'>"
      end if
      temp1=temp1&"</a></td>"
      rs.movenext
    next
    temp1=temp1&vbcrlf&"</tr>"
  loop
  rs.close
  temp1=temp1&"</table></td></tr></table>"
  response.write temp1&kong
end sub
'友情论坛结束

'------------------------------------forum_list-------------------------------------
sub forum_view()
dim pelpic:pelpic=ispel
dim goodpic:goodpic=isgood
dim hotpic:hotpic=re_counter
dim newpic:newpic=now()-tim
if pelpic=1 then
pelpic="&nbsp;&nbsp;<img src=images/small/tuijian.gif border=0 title=推荐帖不想看看么？>"
else
pelpic=""
end if
if goodpic=1 then
goodpic="&nbsp;&nbsp;<img src=images/small/jinghua.gif border=0 title=精华帖不想看看么？>"
else
goodpic=""
end if
if hotpic>2 then
hotpic="&nbsp;&nbsp;<img src=images/small/hot.gif width=26 height=10 border=0 title=热帖不想看看么？>"
else
hotpic=""
end if
if newpic<1 then
newpic="&nbsp;&nbsp;<img src=images/small/new_xin.gif width=28 height=14 border=0 title=新帖不想瞧瞧么？> "
else
newpic=""
end if
  select case int(istop)
  case 1
    folder_type="istop"
  case 2
    folder_type="istops"
  case else
  if int(ispel)=1 then
      folder_type="ispel"
     else
    if int(isgood)=1 then
      folder_type="isgood"
    else
      if int(islock)=1 then
        folder_type="islock"
      else
        if int(re_counter)>=10 then
          folder_type="ishot"
        elseif int(isvote)=1 then
          folder_type="isvote"
        end if
      end if
    end if
   end if
  end select

  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"&format_table(3,1)&mtr&">" & _
     vbcrlf&"<td bgcolor="&web_var(web_color,5)&"><img src='images/"&web_var(web_config,5)&"/"&folder_type&".gif' border=0></td>" & _
     vbcrlf&"<td bgcolor="&web_var(web_color,5)&">"
  if action="manage" then
    response.write "<input type=checkbox name=del_id value='"&id&"' class=bg_3>"
  else
    response.write "<img src='images/icon/"&icon&".gif' border=0>"
  end if


'论坛主题加色和加粗开始  
  if color<>"" then
  color="<a href='"&view_url&"'><font title='贴子主题："&code_html(topic,1,0)&"<br>发贴时间："&tim&"<br>最后回复："&re_username&"<br>回复时间："&re_tim&"' color="&color&">"
  else
  color="<a href='"&view_url&"' title='贴子主题："&code_html(topic,1,0)&"<br>发贴时间："&tim&"<br>最后回复："&re_username&"<br>回复时间："&re_tim&"'>"
  end if
  if bb=true then
    bb="<b>"
  else
    bb=""
  end if
'论坛主题加色和加粗结束

  response.write "</td>" & _
  		 vbcrlf&"<td align=left>"&topic_head&bb&color&code_html(topic,0,22)&"</font></a></b>&nbsp;"&index_pagecute(view_url,re_counter+1,web_var(web_num,3),"#cc3300")&newpic&goodpic&hotpic&pelpic&"</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 width=13 height=11></a></td>"
'论坛主题加色和加粗变量替换相关代码(注意上面的bb&color)，至此本文件修改完毕。
         if int(isvote)=1 then
            response.write "<td>共<font class=red>"&poll_counter&"</font>票</td>"
         else 
            response.write "<td>"&re_counter&"<font class=gray>/</font>"&counter&"</td>"
         end if
  response.write "<td align=left><font class=timtd>"&time_type(re_tim,6)&"</font><font class=red>│</font>"&format_user_view(re_username,1,"")&"</td>" & _
  		 vbcrlf&"</tr>" & _
  		 vbcrlf&"<tr"&format_table(3,1)&" 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:"&web_var(web_color,5)&";color:"&web_var(web_color,7)&";padding:2px"" onclick=""load_tree("&forumnid&","&id&")"">正在读取关于本主题的跟贴，请稍侯……</div></td></tr>"
  del_temp=del_temp+1
end sub


'------------------------------------forum_view-------------------------------------
function view_type()
  dim uf,kd
  dim up:up=int(popedom_format(u_popedom,42))
  table_bg=format_table(3,1)
  if ii mod 2=0 then table_bg=forum_table3
  if var_null(u_whe)<>"" then
    u_whe="来自："&u_whe&"<br>"
  end if
  if var_null(u_nname)<>"" then
    u_nname="头衔："&u_nname&"<br>"
  end if
   if len(u_face)<4 then 
     kd=""
     uf="images/face/"&u_face&".gif'"
  else 
     uf=""&u_face&""
     kd="width=120 height=120"
  end if

  view_type=vbcrlf & "<tr align=center valign=top"&table_bg&"><td width='20%'>" & _
	    vbcrlf & "<table border=0 width='98%'><tr><td align=center height=30><table border=0><tr><td width=100 align=center><font class=blue><b>"&u_username&"</b></font></td><td>&nbsp;"&user_view_sex(u_sex)&"</td></tr></table></td></tr>" & _
	    vbcrlf & "<tr><td align=center height=96>"
   if rs("u_faceurl")="" or isnull(rs("u_faceurl")) then 	    
      view_type=view_type&vbcrlf &"<img src='images/face/"&rs("u_face")&".gif' border=0></td></tr>"
    else 
     view_type=view_type&vbcrlf &"<img border=0 src='"&rs("u_faceurl")&"' width='"&rs("u_facewidth")&"' height='"&rs("u_faceheight")&"'></td></tr>"
   end if
      view_type=view_type&vbcrlf & "<tr><td height=15><img src='images/star/star_"&user_star(u_integral,u_power,1)&".gif' border=0></td></tr>" & _
	    vbcrlf & "<tr><td>等级："&user_view_power(u_power,0)&user_star(u_bbs_counter,u_power,2)&"<br>威望：<font color=red>+"&u_userpower&"&nbsp;&nbsp;[荣誉]</font><br>人气："&u_renqi&"<br> "&u_nname& "贴子："&u_bbs_counter&"<br>积分："&u_integral&"<br>"&money_name&"："&u_emoney&"<br>魅力："&u_usercp&"<br>"&u_whe&"注册："&formatdatetime(rs("u_tim"),2)&"</td></tr>" & _
	    vbcrlf & "</table></td><td width='80%' height='100%'>" & _
	    vbcrlf & "<table border=0 width='99%' cellspacing=2 cellpadding=0 height='100%'><tr height=25><td width='85%'>" & _
	    vbcrlf & "<a target=_blank href='user_view.asp?username="&server.urlencode(u_username)&"'><img src='images/"&web_var(web_config,5)&"/forum_profile.gif' title='查看 "&u_username&" 的详细信息' border=0></a>&nbsp;" & _
	    vbcrlf & "<a target=_blank href='user_friend.asp?action=add&add_username="&server.urlencode(u_username)&"'><img src='images/"&web_var(web_config,5)&"/forum_friend.gif' title='将 "&u_username&" 加为我的好友' border=0></a>&nbsp;" & _
	    vbcrlf & "<a target=_blank href='user_message.asp?action=write&accept_uaername="&server.urlencode(u_username)&"'><img src='images/"&web_var(web_config,5)&"/forum_message.gif' title='给 "&u_username&" 发短信' border=0></a>&nbsp;"
	    if forumreadonly=0 then
 view_type=view_type&vbcrlf&"<a href='forum_edit.asp?forum_id="&forumid&"&edit_id="&qid&"'><img src='images/"&web_var(web_config,5)&"/forum_edit.gif' title='编辑这个贴子' border=0></a>&nbsp;"
    if int(fir_islock)<>1 then
      view_type=view_type&vbcrlf&"<a href='forum_reply.asp?forum_id="&forumid&"&quote=yes&view_id="&qid&"'><img src='images/"&web_var(web_config,5)&"/forum_quote.gif' title='引用并回复这个贴子' border=0></a>&nbsp;" & _
         vbcrlf&"<a href='forum_reply.asp?forum_id="&forumid&"&view_id="&qid&"'><img src='images/"&web_var(web_config,5)&"/forum_reply.gif' title='回复这个贴子' border=0></a>"
    else
      view_type=view_type&vbcrlf&"<img src='images/small/forum_reply.gif' title='该贴已被锁定' border=0>"
    end if
	if login_mode="admin" or login_mode="super" then
view_type=view_type&vbcrlf & "  <a href='forum_view.asp?forum_id="&forumid&"&view_id="&id&"' onclick=window.open('super_point.asp?userna="&server.urlencode(u_username)&"','add','toolbar=no,location=no,status=no,width=400,height=380')><img src='images/small/forum_point.gif' title='管理员、版主奖惩用户专用' border=0></a>"
end if
  else
    if format_user_power(login_username,login_mode,forumpower)="yes" then
 view_type=view_type&vbcrlf&"<a href='forum_edit.asp?forum_id="&forumid&"&edit_id="&qid&"'><img src='images/"&web_var(web_config,5)&"/forum_edit.gif' title='编辑这个贴子' border=0></a>"
 end if
  end if
    view_type=view_type&"</td><td width='15%' align=right>第 <font class=red_3><b>"&ii+(viewpage-1)*nummer&"</b></font> 楼</td></tr>" & _
     vbcrlf & "<tr><td colspan=2 height=1 bgcolor="&web_var(web_color,3)&"></td></tr>"
	    
  if up=0 then
    view_type=view_type&vbcrlf & "<tr><td colspan=2 valign=top align=center>" & _
	      vbcrlf & "<table border=0 width='98%' class=tf><tr><td height=30>" & _
	      vbcrlf & "<img src='images/icon/"&rs("icon")&".gif' align=absMiddle border=0>&nbsp;<marquee align='middle' width='96%' height='6%' behavior='alternate'><font class=red_3><b>"&code_html(rs("topic"),1,0)&"</b></font></marquee></td></tr>" & _
	      vbcrlf & "<tr><td class=bw><font class=htd>"
          if rs("isvote")=1 then 
	         view_type=view_type & code_jk(rs("word")) & FormatPoll(iid)  & "</font></td></tr>"
	      else
	         view_type=view_type & code_jk(rs("word")) & "</font></td></tr>"
	      end if
	      view_type=view_type & "</table></td></tr>"
    if rs("edited")<>"" then
    view_type=view_type& "<tr><td colspan=2 height=20 align=right><br><font  color='#000066'>["&rs("edited")&"]</font> </td></tr>"
    end if
    	      view_type=view_type&"<tr><td colspan=2 height=20 align=right><font color=#808080>…━╋┫　本图片及文字资料版权归<B> <font color=blue>"&u_username&"</font>&nbsp;和&nbsp;<font color=blue>点绛唇社区</font></B>&nbsp;共同所有，未经同意请勿转载 ┣╋━…</font></br><font color=#808080>…━╋┫ <a href='http://cn.cnna.cn/hifi'>『点绛唇社区』</a>非常感谢<B>&nbsp;<font color=red>"&u_username&"</font>&nbsp;</B>的支持与参与 ┣╋━…</font><br>"&img_small("signature")&"</td></tr>" & _
              vbcrlf & "<tr><td colspan=2 height=30 align=center valign=top><table border=0 width='96%' class=tf><tr><td class=bw><font class=htd>"&u_remark&"</font></a></td></tr></table></td></tr>"
  else
    view_type=view_type&vbcrlf & "<tr><td colspan=2 valign=top><br><table border=0><tr><td class=htd><font class=red_2>========================<br>&nbsp;&nbsp;该用户的论坛发言已暂时被管理屏蔽！<br>========================</font></td></tr></table></td></tr>"
  end if
  view_type=view_type&vbcrlf & "</table><tr align=center valign=top"&table_bg&"><td height=18><table border=0 cellspacing=2 cellpadding=0 height=18 class=tf><tr><td height=18>"&img_small("forum_tim")&"<font class=gray>"&time_type(rs("tim"),8)&"</font></td></tr>" &_
     vbcrlf & "</table></td><td><table width='98%' border=0 cellspacing=2 cellpadding=0 height=18 class=tf><tr><td width='45%' height=18><SCRIPT language=javascript src=ads/text.js></SCRIPT></td>" &_
     vbcrlf & "<td width='35%' align=right>"&ip_types(rs("ip"),u_username,1)&"　<img src='images/small/sys.gif' align=absMiddle title='"&view_sys(rs("sys"))&"' border=0>　<a href=""javascript:"&del_type&"('"&forumid&"','"&iid&"');""><img src='images/small/forum_del.gif' align=absMiddle border=0></a></td></tr>" &_
     vbcrlf & "</table></td></tr>"
end function

function user_view_sex(us)
dim sql8,rs8
    sql8="select * from user_login where l_username='"&u_username&"'"
  set rs8=conn.execute(sql8)
    if rs8.eof then
  if us=false then
    user_view_sex="<img src='images/small/offgirl.gif' align=absmiddle title='青春女孩，离线' border=0>"
  else
    user_view_sex="<img src='images/small/offboy.gif' align=absmiddle title='阳光男孩，离线' border=0>"
  end if
   rs8.close
   set rs8=nothing
    else
  if us=false then
    user_view_sex="<img src='images/small/ongirl.gif' align=absmiddle title='青春女孩，在线' border=0>"
  else
    user_view_sex="<img src='images/small/onboy.gif' align=absmiddle title='阳光男孩，在线' border=0>":
  end if
   rs8.close
   set rs8=nothing
    end if
end function

function user_view_power(uvp,ut)
  user_view_power=img_small("icon_"&uvp)
  if ut=1 then user_view_power=user_view_power&"<font class=red_3>"&format_power(uvp,1)&"</font>"
end function
'-----------------------论坛小字报---------------------------------
dim lx:lx=web_var(web_num,21)
sub xzb_scroll(sh,nsql,s_num,c_num,sbg)
  dim cnum,temp1,topic,rs,xzb
  if sbg=1 then
    temp1=vbcrlf&""
  else
    temp1=vbcrlf&""
  end if
  temp1=temp1&"<marquee width='98%' scrollamount=2 scrolldelay=2 onMouseOut=""if (document.all!=null){this.start()}"" onMouseOver=""if (document.all!=null){this.stop()}"">"
  set rs=conn.execute("SELECT TOP 5 id,username,topic,tim FROM gongao where forum_id="&forumid&" and sort=1 and datediff('d',tim,Now())<"&lx&" ORDER BY tim desc")
  do while not rs.eof
  temp1=temp1&"<img src=images/small/nologin.gif width=10 height=10 border=0> <font class=blue>"&(rs(1))&"</font> 说：&nbsp;<a href='viewxzb.asp?action=1&id="&rs("id")&"'>"&code_html(rs(2),0,20)&"</a> <font size=1>("&time_type(rs(3),66)&")</font>&nbsp;&nbsp;&nbsp;&nbsp;"
  rs.movenext
  loop
  rs.close
  temp1=temp1&"</marquee>"
  if sbg=1 then
    temp1=temp1&""
  else
    temp1=temp1&""
  end if
  response.write temp1
end sub
'-----------------------以下良友在线添加---------------------------------
function getPollPosts(fTopicID)
  dim strsql,rsPollTopic,strPollNum,strPollNumArr
	getPollPosts = 0
	If fTopicID = 0 or ""&fTopicID&"" = "" Then
		Exit function
	End If

	strSql = "SELECT V_NUM FROM BBS_VOTE"
	strSql = strSql & " WHERE TOPIC_ID = " & fTopicID
	strSql = strSql & " ORDER BY V_ID DESC"

	set rsPollTopic = Conn.Execute (strSql)

	if rsPollTopic.BOF or rsPollTopic.EOF then
		'### Nothing
	else
		strPollNum = rsPollTopic("V_NUM")
		strPollNumArr = Split(strPollNum, ",")
		For i = 0 To UBound(strPollNumArr)
			getPollPosts = getPollPosts + cInt(strPollNumArr(i))
		Next
	end if

	rsPollTopic.close
	set rsPollTopic = nothing
end function

'------------------------------以下爱的泪了添加----------------------------------------
sub preview_form(pfrm,pword)
%>
<form name=pre_frm action='preview.asp' method=post target='preview'>
<input type=hidden name=p_topic value=''>
<input type=hidden name=p_word value=''>
</form>
<script language=javascript>
<!--
function preview_type()
{
  document.pre_frm.p_word.value=document.<%response.write pfrm%>.<%response.write pword%>.value;
  open_win('about:blank','preview',774,350,'yes');
  document.pre_frm.submit();
}
-->
</script>
<%
end sub

function preview_b(pfrm,pword,pv)
  preview_b="<input type=button onclick=""javascript:preview_type('"&pfrm&"','"&pword&"');"" value='"&pv&"'>"
end function


sub user_me()
  dim username,userpower,usercp,integral,emoney,renqi,bbs_counter
  dim tim_login,kd,uf
  sql="select l_tim_login from user_login where l_username='"&login_username&"'"
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    tim_login=0
  else
    tim_login=rs(0)
  end if
  rs.close
  
  sql="select * from user_data where username='"&login_username&"'"
  set rs=conn.execute(sql)
%>
<TR>
<td width="50%"><font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;威望：</font><font color="#FF0000"><%response.write rs("userpower")%></font></td>
<td width="50%">&nbsp;<font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;魅力：</font><font color="#FF0000"><%response.write rs("usercp")%></font></td>
</tr>
<tr> 
<td><font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;人气：</font><font color="#FF0000"><%response.write rs("renqi")%></font></td>
<td>&nbsp;<font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;贴子：</font><font color="#FF0000"><%response.write rs("bbs_counter")%></font></td>
</tr>
<tr> 
<td height="18"><font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;积分：</font><font color="#FF0000"><%response.write rs("integral")%>&nbsp;</font></td>
<td height="18">&nbsp;<font color="#006600"><img src="IMAGES/small/forum_03.gif">&nbsp;财富：</font><font color="#FF0000"><%response.write rs("emoney")%></font></td>
</tr>
<%
end sub

sub forum_cast1(nh,nj,n_num,c_num)
  dim temp1,njj,topic,word,tbb:njj=""
  if nj<>"" then njj=img_small(nj)
  sql="select top "&n_num&" id,topic,word,username,tim from bbs_cast where sort='forum' order by id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    topic=rs("topic")
    word=rs("word")
    temp1=temp1&"<a class=red href='update.asp?action=forum&id="&rs("id")&"'>"&code_html(topic,1,c_num)&"</a>"
    rs.movenext
  loop
    response.write temp1
end sub

sub db_error()
session("errormsg")=errmsg
response.redirect "error.asp"
response.end
end sub

function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
end function
'------------------------------------------------多级论坛------------------------------------------------------
sub forum_board(ft,c_id,f_id,f_name)
  dim rsforum,strsqlforum,rstopic,sqltopic,topics,classid,forumid,forumname,forum_type,forum_new_info,forum_pic,new_info_dim,forumpic,newinfo_disp,forumn,forumw,ftn,forum_pro,forum_disp
  response.write vbcrlf & forum_table1 & "<tr"&forum_table2&"><td height=25 colspan=4 background='images/" & web_var(web_config,5) & "/bg_td.gif'> " & img_small(ffk) & vbcrlf &"<font class=end><b>" & f_name &"</b></font></td></tr>"
  strsqlforum="select forum_id,forum_n,forum_w,forum_name,forum_info_disp,forum_type,forum_new_info,forum_topic_num,forum_data_num,forum_power,forum_remark,forum_pic,forum_pro " & _
	      "from bbs_forum where forum_f="&f_id&" and class_id="&c_id&" and forum_hidden=0 order by forum_order,forum_id desc"
  set rsforum=conn.execute(strsqlforum)
  do while not rsforum.eof
    forumn=rsforum("forum_n"):forumw=rsforum("forum_w")
    forumid=rsforum("forum_id"):forumname=rsforum("forum_name")
    forum_type=rsforum("forum_type"):forum_pro=rsforum("forum_pro")
    forum_new_info=rsforum("forum_new_info")
    forum_pic=rsforum("forum_pic")
	forum_disp=rsforum("forum_info_disp")
    ftn=""
    if len(forum_new_info)>3 then
      new_info_dim=split(forum_new_info,"|")
      new_info_dim(0)=format_user_view(new_info_dim(0),1,"")
      if isdate(new_info_dim(1)) then new_info_dim(1)=time_type(new_info_dim(1),8)
      new_info_dim(3)="<a href='forum_view.asp?forum_id="&forumid&"&view_id="&new_info_dim(2)&"' title='"&code_html(new_info_dim(3),0,0)&"'>"&code_html(new_info_dim(3),0,8)&"</a>"
      if time_type(new_info_dim(1),3)=time_type(now_time,3) then ftn="n"
    else
      redim new_info_dim(3)
    end if
    if len(forum_pic)>1 then
      if left(forum_pic,1)="$" then forum_pic="images/forum/"&right(forum_pic,len(forum_pic)-1)
      forum_pic="<td align=right><img src='"&forum_pic&"' border=0></td>"
    end if
	if forum_disp=0 then
	newinfo_disp="<img src=images/small/zhuti.gif width=9 height=10>&nbsp;新贴："&new_info_dim(3)&"<br><img src=images/small/zuozhe.gif width=9 height=10>&nbsp;作者："&new_info_dim(0)&"<br><img src=images/small/lasttime.gif width=9 height=10>&nbsp;时间："&new_info_dim(1)
	else
	newinfo_disp="(帖子信息保密)"
	end if
	   response.write vbcrlf&"<tr"&format_table(3,1)&"><td width='12%' rowspan=2 align=center><img src='images/"&web_var(web_config,5)&"/label_"&forum_type&ftn&".gif' border=0><br><br>【"&format_forum_type(forum_type,1,forum_pro)&"】 </td>" & _
		     vbcrlf&"<td width='24%' height=20 align='center' "&forum_table3&"><font color=red>&nbsp;『&nbsp;</font><a href='forum_list.asp?forum_id="&forumid&"'>" & forumname & "</a><font color=red>&nbsp;』&nbsp;</font></td>"
    if forumw=true then
      response.write vbcrlf&"<td width='38%'"&forum_table3&">" & _
		     vbcrlf&"  <table border=0 width='100%'><tr>"& _
			 vbcrlf&"  <td width='30%'><img src='images/small/forum_num_topic.gif' title='<font color=red>" & forumname & "</font>共有主题<font class=red_3>"&rsforum("forum_topic_num")&"</font>帖' border=0>&nbsp;&nbsp;<font class=red_3>"&rsforum("forum_topic_num")&"</font></td>" & _
		     vbcrlf&"  <td width='30%'><img src='images/small/forum_num_data.gif' title='<font color=red>" & forumname & "</font>共有帖子<font class=red_3>"&rsforum("forum_data_num")&"</font>帖' border=0>&nbsp;&nbsp;<font class=red_3>"&rsforum("forum_data_num")&"</font></td>" & _
 		     vbcrlf&"  <td width='20%'><a href='forum_write.asp?forum_id="&forumid&"&poll=yes'><img src='images/small/toupiao.gif' align=absmiddle title='在<font color=red>" & forumname & "</font>中发表新投票' border=0></a>&nbsp;<font color=black>投票</font></td>" & _
             vbcrlf&"  <td width='20%'><a href='forum_write.asp?forum_id="&forumid&"'><img src='images/small/mini_write.gif' align=absmiddle title='在<font color=red>" & forumname & "</font>中发表新主题' border=0></a>&nbsp;<font color=black>发表</font></td></tr></table>"
    else
      response.write vbcrlf&"<td width='38%' "&forum_table3&" align=center class=gray>本论坛下面有 <font class=red>"&forumn&"</font> 分论坛</td>"
    end if
      response.write vbcrlf&"</td>" & _
		     vbcrlf&"<td width='26%'"&forum_table3&">"&forum_power(rsforum("forum_power"),ptnums)&"</td></tr>" & _
		     vbcrlf&"<tr"&format_table(3,1)&"><td colspan=2 align=center><table border=0 width='99%'><tr><td class=htd><a href='forum_list.asp?forum_id="&forumid&"'><img src=images/small/Forum_readme.gif title='哈哈，发现没有点击此图标也可进入分论坛！' border=0></a>&nbsp;&nbsp;"&code_html(rsforum("forum_remark"),2,0)&"</td>"&forum_pic&"</table></td>" & _
		     vbcrlf&"<td align=left valign=top class=htd>"
    if forumw=true then
      response.write newinfo_disp
    else
      response.write vbcrlf&"<br><a href='forum_list.asp?forum_id="&forumid&"'><p class=gray align=center>点击浏览分论坛信息</p></a>"
    end if
      response.write "</td></tr>"
    erase new_info_dim
  rsforum.movenext
loop
  rsforum.close:set rsforum=nothing
  response.write "</table>"&kong
end sub

%>