<!-- #Include File="Include/Config.asp" -->
<!-- #include file="Include/Con_bbs_Fir.asp" -->
<!-- #Include File="../Include/Cls_PageCute.asp" -->
<%

'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

tit_fir=Cls.ChannelName
iFrame = True
dim bbs_list_mode,page_num_list,page_num_view,page_num_hot,specialid
specialid=Cls.code_id("sid")
select case action
case "isgood"
  ftit="精华"
case "manage"
  ftit="管理"
case "special"
  ftit="专题"
case else
  action=""
  ftit="主题列表"
end select
call bbs_first()
call DoWebHead(0,0)
call bbs_load_power()
'----------------------------中间 开始----------------------------
if bbs_config(3)>0 then
  page_num_list=bbs_config(3)
else
  page_num_list=Cls.ChannelListNum
end if
page_num_view=bbs_config(4)
page_num_hot=bbs_config(11)
if bbs_data(4)>0 then
  HtmlContent = Cls.ReadTemplate("list2") 
  HtmlContent = LoadWebHead(HtmlContent)
  HtmlContent = LoadWebEnd(HtmlContent)
  HtmlContent = LoadBbsListMain(HtmlContent)
  HtmlContent = Replace(HtmlContent,"{$BbsGrade}",bbs_grade(1))
  HtmlContent = Replace(HtmlContent,"{$BbsTopBar}",bbs_top(0,""))
  HtmlContent = Replace(HtmlContent,"{$BbsEnd}",bbs_list_end())
  HtmlContent = Replace(HtmlContent,"{$Bbsonlinea}",fid_online())
  Response.Write Cls.ReHtml(HtmlContent,0)
else
'if bbs_data(5)=true then
  if action="manage" then
    if is_super=false then action=""
  end if
  HtmlContent = Cls.ReadTemplate("list") 
  HtmlContent = LoadWebHead(HtmlContent)
  HtmlContent = LoadWebEnd(HtmlContent)
  HtmlContent = Replace(HtmlContent,"{$BbsGrade}",bbs_grade(1))
  HtmlContent = Replace(HtmlContent,"{$BbsTopBar}",bbs_top(0,""))
  HtmlContent = Replace(HtmlContent,"{$BbsEnd}",bbs_list_end())
  HtmlContent = Replace(HtmlContent,"{$Bbsonlinea}",fid_online())
  HtmlContent = bbs_list_body(HtmlContent)
  Response.Write Cls.ReHtml(HtmlContent,0)
'end if
if bbs_data(4)=0 then call bbs_list_end()
end if
'----------------------------中间 结束----------------------------
call bbs_end()
call DoWebEnd()
Function LoadBbsListMain(HtmlContentStr)
  dim tmpstr,HtmlStr,fTrHtml,bTrHtml
  HtmlStr = HtmlContentStr
  fTrHtml = Cls.CutFixContent(HtmlStr, "[Repeat]" , "[/Repeat]", 0)
  bTrHtml = Cls.CutFixContent(fTrHtml, "[Base]" , "[/Base]", 0)
  dim fcid,mdim,mnum
  mnum=-1
  if sqltype = 1 then
     sql = "execute AsaiMHBbs_main2 "&Bbsid
  else
     sql="select bbs_id,bbs_n,bbs_w,bbs_name,bbs_type,bbs_pro,bbs_new_info,bbs_new_num,bbs_topic_num,bbs_data_num,bbs_power,bbs_remark,bbs_pic,bbs_user,bbs_config,class_id from AsaiMHBbsClass where bbs_f="&Bbsid&" and bbs_hidden=0 order by bbs_order,bbs_id"
  end if
  call Cls.exe_conn(rs,sql,1)
  if not rs.eof then
    mdim=rs.getrows()
    mnum=ubound(mdim,2)
  end if
  rs.close
  fcid=0
  for i=0 to mnum
    tmpstr = tmpstr & bbs_main_body(mdim(0,i),mdim(1,i),mdim(2,i),mdim(3,i),mdim(4,i),mdim(5,i),mdim(6,i),mdim(7,i),mdim(8,i),mdim(9,i),mdim(10,i),mdim(11,i),mdim(12,i),mdim(13,i),mdim(14,i),fTrHtml,bTrHtml)
  next
  if mnum>-1 then erase mdim
  HtmlStr = Replace(HtmlStr,"[Repeat]"&fTrHtml&"[/Repeat]",tmpstr)
  HtmlStr = Replace(HtmlStr,"{$Bbsname}",bbs_data(2))
  LoadBbsListMain = HtmlStr
end Function
'//* 频道专题列表 *//
Function Channel_Special()
	If Not Cls.SpecialTrue or int(bbs_config(23))=0 or bbs_data(14)="" Then Exit Function
	Dim Tmpstr, Sii, j, Fid_Special
  '  Fid_Special=split(bbs_data(14),",")
    Fid_Special=split(bbs_data(14)&"",",") 
    For j = 0 To Ubound(Fid_Special)'
	  For Sii = 0 To Ubound(Cls.ChannelSpecial,2)
	    If Fid_Special(j)=Cls.ChannelSpecial(1,Sii) Then
		  Tmpstr = Tmpstr & "<img src='../images/number/n"&j+1&".gif' border=0 align=absMiddle>&nbsp;[<a href='list.asp?fid="&Bbsid&"&sid="&Cls.ChannelSpecial(0,Sii)&"&action=special'"
		  If SpecialID = Cls.ChannelSpecial(0,Sii) Then Tmpstr = Tmpstr & " class=red"
		  Tmpstr = Tmpstr & ">"&Cls.ChannelSpecial(1,Sii)&"</a>]&nbsp;"
		End if
	  Next
	Next
	
	
   if bbs_config(28)=0 then
      Channel_Special = vbcrlf&"<b>本版专题：</b>"& Tmpstr &""
   else

    Channel_Special = vbcrlf&"" & _
    
vbcrlf&"<div class=""mainbox"" style=""overflow:hidden"">" & _
vbcrlf&"<div style=""float:left;height:20px;"">" & _
vbcrlf&"本版专题："& Tmpstr &"</div></div>"
       End if
End Function
function bbs_list_body(LHtmlStr)
  dim tmp1,tmplist,sql_add,dim_list,ti,tmp_record,tmp_cn,tmp_bb,tmp_topic_folder,tmp_topic_head,tmp_topic_end,tmp_topics,tmp_topic,tmp_topic_style,tmp_topic_page,tmp_counter,tmp_username,tmp_re_username,tmp_page_num,tmp_bg_color
  Dim ListHtmlStr,TrHtml
  ListHtmlStr=LHtmlStr
  ListHtmlStr = Replace(ListHtmlStr,"{$nummer}",page_num_list)
  TrHtml = Cls.CutFixContent(ListHtmlStr, "[Repeat]" , "[/Repeat]", 0)
  tmplist =bbs_list_istop(TrHtml)
  tmp_record=var_topic_field
  sql_add="(bbs_id="&Bbsid&" and istop=0)"
  dim obj_page
  set obj_page=new Cls_PageCute
  select case action
  case "isgood"
    obj_page.pageurl="?fid="&Bbsid&"&action="&action&"&"
    sql_add=sql_add&" and "&action&"=1"
  case "special"
    obj_page.pageurl="?fid="&Bbsid&"&sid="&specialid&"&action="&action&"&"
    sql_add=sql_add&" and specialid="&specialid
  case "manage"
    obj_page.pageurl="?fid="&Bbsid&"&action="&action&"&"
    ListHtmlStr =  Cls.js_put(Cls.web_dir&"Style/Select.js",0) & _
               vbcrlf & "<form name=del_frm action='Dispose.asp' method=get onsubmit=""javascript:frm_submitonce(this);"">"&_
			   vbcrlf & ListHtmlStr
  case else
    obj_page.pageurl="?fid="&Bbsid&"&"
  end select
  obj_page.nummer=page_num_list
  obj_page.page_t=1
  obj_page.page_p=10
  obj_page.page_unit="贴"
  obj_page.page_tit="主题"
  obj_page.v_id="id"
  call obj_page.p_init(tmp_record,"AsaiMHBbsTopic",sql_add,"order_id desc")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
  call obj_page.p_main(tmp_record,"AsaiMHBbsTopic",sql_add,"order_id desc")
    if obj_page.page_num>0 then dim_list=rs.getrows()
    rs.close
  tmplist = tmplist & bbs_concision_type(dim_list,TrHtml)
  tmp1=vbcrlf&"<div>"&obj_page.page_var&"分页："&obj_page.page_cute&""&obj_page.page_shortcut&"</div>"
  if action="manage" then
    tmp1=tmp1&vbcrlf&"<input type=hidden name=fid value='"&Bbsid&"'>选中所有<input class=bbs_trp type=checkbox name=sel_all onClick=""javascript:select_all(this.form);"">管理操作：<select name=action size=1 class=sel><option value='revert' checked>还原</option><option value='restore'>修复</option><option value='rap'>奖惩</option><option value='istop'>固顶</option>"
  if int(login_modep)=1 or int(login_modep)=2 then         '管理员 超级斑竹
	tmp1=tmp1&vbcrlf&"<option value='move'>转移</option><option value='istopz'>区固顶</option><option value='istops'>总固顶</option>"
  end if
	tmp1=tmp1&vbcrlf&"<option value='isgood'>精华</option><option value='islock'>锁定</option><option value='delete'>删除</option></select><input class=btn type=submit value='执行操作' onclick=""javascript:return sel_click(this.form);""></form>"
  end if
  tmp1=tmp1&vbcrlf&"" &vbcrlf&"</div>"
  ListHtmlStr = Replace(ListHtmlStr,"[Repeat]"&TrHtml&"[/Repeat]",tmplist)
  ListHtmlStr = Replace(ListHtmlStr,"{$listend}",tmp1)
  tmp1=empty
  set obj_page=nothing
  bbs_list_body = ListHtmlStr
end function
function bbs_list_istop(ttrhtml)
  if int(Cls.code_id("page"))>1 or action="isgood" or action="manage" then exit function 'or action="special"
  dim tmpdim,tmptrue,tmpstr
  tmpstr=""
  tmptrue=false
  tmpdim=Cls.cache_get("bbs_istops")
  if tmpdim="" then
	  sql="select "&var_topic_field&" from AsaiMHBbsTopic where istop=3 order by re_tim desc"
      call Cls.exe_conn(rs,sql,1)
      if not rs.eof then
	    tmpdim=bbs_concision_type(rs.getrows(),ttrhtml)
        call Cls.cache_set("bbs_istops",tmpdim)
        tmptrue=true
      end if
      rs.close
  else
  tmptrue=true
  end if
  if tmptrue=true then tmpstr = tmpstr & tmpdim
  'if isarray(tmpdim) then response.write tmpdim
  tmpdim=Cls.cache_get("bbs_istopz_"&zid)
  if  tmpdim="" then
      sql="select "&var_topic_field&" from AsaiMHBbsTopic where istop=2 and bbs_id in ("&bbs_get_classz()&") order by order_id desc"
      call Cls.exe_conn(rs,sql,1)
      if not rs.eof then
        tmpdim=bbs_concision_type(rs.getrows(),ttrhtml)
        call Cls.cache_set("bbs_istopz_"&zid,tmpdim)
        tmptrue=true
      end if
      rs.close
  else
  tmptrue=true
  end if
  if tmptrue=true then tmpstr = tmpstr & tmpdim
  'if isarray(tmpdim) then response.write tmpdim
  tmpdim=Cls.cache_get("bbs_istop_"&Bbsid)
  if  tmpdim="" then
      sql="select "&var_topic_field&" from AsaiMHBbsTopic where istop=1 and bbs_id="&Bbsid&" order by order_id desc"
      call Cls.exe_conn(rs,sql,1)
      if not rs.eof then
         tmpdim=bbs_concision_type(rs.getrows(),ttrhtml)
        call Cls.cache_set("bbs_istop_"&Bbsid,tmpdim)
        tmptrue=true
      end if
      rs.close
  else
  tmptrue=true
  end if
 if tmptrue=true then tmpstr = tmpstr & tmpdim
 ' if isarray(tmpdim) then tmpstr = tmpstr & tmpdim
 if tmptrue=true then tmpstr = tmpstr & vbcrlf&""
 bbs_list_istop = tmpstr
end function
function bbs_concision_type(dim_list,dTrHtml)
  if not isarray(dim_list) then exit function
  dim ti,si,tmp_cn,tmp_bb,tmp_topic_folder,tmp_topic_head,tmp_topic_end,tmp_topics,tmp_topic,tmp_topic_style,tmp_topic_page,tmp_counter,tmp_username,tmp_re_username,tmp_page_num,tmp_bg_color
  Dim HtmlStr
  for ti=0 to ubound(dim_list,2)
        tmp_cn=Cls.ChannelCuteNum
        If dim_list(11,ti)<>0 Then
		      tmp_bg_color="bbs_trt"
        Else
		      tmp_bg_color="bbs_tr"
        End If
       '---------------帖子标题基本属性修饰-----------------------------------
        if dim_list(12,ti)=true then
          tmp_topic_folder="isvote"
        else
          tmp_topic_folder="isok"
          if dim_list(9,ti)>=page_num_hot then tmp_topic_folder="ishot"
        end if
       '---------------帖子标题头修饰-----------------------------------
        tmp_topic_head=""
        If dim_list(15,ti)=1 Then tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/islock.gif' title='锁定' align=right> "
        If dim_list(16,ti)=1 Then tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/isgood.gif' title='精华' align=right> "
        If dim_list(19,ti)>0 Then tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/isspecial.gif' title='特殊贴("&SpecialType(dim_list(19,ti))&")' align=right> "
        if action="manage" then tmp_topic_head=tmp_topic_head&"<input "&tmp_bg_color&" type=checkbox name=sel_id value='"&dim_list(0,ti)&"'> "
        select case int(dim_list(11,ti))
        case 1
          tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/istop.gif' align=absmiddle> "
        case 2
          tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/istopz.gif' align=absmiddle> "
        case 3
          tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.web_skindir&"Bbs/istops.gif' align=absmiddle> "
        end select
        if int(dim_list(9,ti))>0 then
          tmp_topic_head=tmp_topic_head&" <img loaded=no id=followImg"&dim_list(0,ti)&" src='"&Cls.web_skindir&"sys/fk_plus.gif' border=0 align=absMiddle onclick=""javascript:load_tree("&dim_list(1,ti)&","&dim_list(0,ti)&");"" title='展开贴子列表'> "
        else
          tmp_topic_head=tmp_topic_head&" <img id=followImg"&dim_list(0,ti)&" src='"&Cls.web_skindir&"sys/fk_minus.gif' border=0 align=absmiddle> "
        end if
        if dim_list(18,ti)<>"" then tmp_topic_head=tmp_topic_head&" <img border=0 src='"&Cls.Web_Dir&"images/filetype/"&dim_list(18,ti)&".gif' align=absmiddle> "
        If Cls.SpecialTrue Then
		      For Si = 0 To Ubound(Cls.ChannelSpecial,2)
	          If dim_list(20,ti)=Cls.ChannelSpecial(0,Si) Then
		          tmp_topic_head=tmp_topic_head&" <b>[<a href='list.asp?fid="&Bbsid&"&sid="&Cls.ChannelSpecial(0,Si)&"&action=special'><font class=red>"&Cls.ChannelSpecial(1,Si)&"</font></a>]</b> "
		        End if
	        Next
        End if
       '---------------帖子标题尾修饰------------------------------------------
        tmp_topic_end=""
        tmp_topic_end=tmp_topic_end&pagecute_topic(page_num_view,dim_list(9,ti),"view.asp?fid="&dim_list(1,ti)&"&id="&dim_list(0,ti))
        if DateDiff("d",dim_list(7,ti),Cls.now_time)<1 then tmp_topic_end=tmp_topic_end&"  <img border=0 src='"&Cls.web_skindir&"sys/new.gif' align=absmiddle> "
        if dim_list(9,ti)>=page_num_hot then tmp_topic_end=tmp_topic_end&"  <img border=0 src='"&Cls.web_skindir&"sys/hot.gif' align=absmiddle> "
        if tmp_topic_end<>"" then tmp_cn=tmp_cn-6
       '---------------帖子标题修饰------------------------------------------
        tmp_topic_style=""
        if Cls.Is_null(dim_list(4,ti))<>"" then tmp_topic_style="color:#"&dim_list(4,ti)&";"
        if dim_list(5,ti)=true then tmp_topic_style=tmp_topic_style&"font-weight:bold;"
        if tmp_topic_style<>"" then tmp_topic_style="style="""&tmp_topic_style&""""
        tmp_topics=Cls.code_html(dim_list(3,ti),1,0)
        tmp_topic=Cls.code_html(dim_list(3,ti),1,tmp_cn)
       '-----------------------------------------------------------------------
        tmp_username=format_user_view(dim_list(2,ti),1,1)
        tmp_re_username=format_user_view(dim_list(8,ti),1,1)
        tmp_counter=dim_list(13,ti)
        if dim_list(12,ti)=true then tmp_counter="<font class=red>"&dim_list(14,ti)&"</font>"
        tmp_page_num=pagecute_num(page_num_view,dim_list(9,ti))
		HtmlStr=dTrHtml
        HtmlStr = Replace(HtmlStr,"{$bg_class}",tmp_bg_color)
        HtmlStr = Replace(HtmlStr,"{$topic_folder}",tmp_topic_folder)
        HtmlStr = Replace(HtmlStr,"{$icon}",dim_list(6,ti))
        HtmlStr = Replace(HtmlStr,"{$bbs_id}",dim_list(1,ti))
        HtmlStr = Replace(HtmlStr,"{$view_id}",dim_list(0,ti))
        HtmlStr = Replace(HtmlStr,"{$topic_head}",tmp_topic_head)
        HtmlStr = Replace(HtmlStr,"{$topics}",tmp_topics)
        HtmlStr = Replace(HtmlStr,"{$topic}",tmp_topic)
        HtmlStr = Replace(HtmlStr,"{$topic_style}",tmp_topic_style)
        HtmlStr = Replace(HtmlStr,"{$topic_end}",tmp_topic_end)
        HtmlStr = Replace(HtmlStr,"{$tim}",Cls.time_type(dim_list(7,ti),3))
        HtmlStr = Replace(HtmlStr,"{$username}",tmp_username)
        HtmlStr = Replace(HtmlStr,"{$counter}",tmp_counter)
        HtmlStr = Replace(HtmlStr,"{$re_counter}",dim_list(9,ti))
        HtmlStr = Replace(HtmlStr,"{$re_tim}",Cls.time_type(dim_list(10,ti),3))
        HtmlStr = Replace(HtmlStr,"{$re_username}",tmp_re_username)
        HtmlStr = Replace(HtmlStr,"{$view_url}","view.asp?id="&dim_list(0,ti))
        HtmlStr = Replace(HtmlStr,"{$view_url_page}","view.asp?id="&dim_list(0,ti)&"&page="&tmp_page_num&"#"&Cls.time_type(dim_list(10,ti),11))
		bbs_concision_type=bbs_concision_type&HtmlStr
      next
  if isarray(dim_list) then erase dim_list
end function


function bbs_list_end()
  bbs_list_end= vbcrlf&"" & _
vbcrlf&"<div class=""mainbox"" style=""overflow:hidden"">" & _
vbcrlf&"<div style=""float:left;height:25px;"">" & _
vbcrlf&"<form action='search.asp?action=search' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
vbcrlf&"<input type=hidden name=sea_fid value='"&Bbsid&"'>" & _
vbcrlf&"<input type=hidden name=action value='search'>" & _
vbcrlf&"<input type=hidden name=page value='1'>论坛搜索：<select name=sea_type size=1>" & _
vbcrlf&"<option value='topic'>按主题</option>" & _
vbcrlf&"<option value='username'>按作者</option>" & _
vbcrlf&"</select>&nbsp;<input type=text class=bg_search name=keyword size=15 maxlength=20>" & _
vbcrlf&"<input type=submit class=btn value='搜 索'>" & _
vbcrlf&"</form>" & _
vbcrlf&"</div>" & _
vbcrlf&"<div style=""float:right;height:25px;"">论坛跳转："&bbs_select()&"</div></div>" & _


vbcrlf&""&bbs_img_topic()&""

end function



Function fid_online()
  fid_online=vbcrlf&"<script language=javascript>" & _
   		vbcrlf&"function bbs_load_online(fname)" & _
   		vbcrlf&"{" & _
   		vbcrlf&"  var targetDivtr =eval(""document.all.bbs_online_tr"");" & _
   		vbcrlf&"  var targetDiv =eval(""document.all.bbs_online"");" & _
   		vbcrlf&"  if (targetDivtr.style.display!=""block"")" & _
   		vbcrlf&"  {" & _
   		vbcrlf&"    document.all.bbs_online_var.innerHTML=""[关闭在线列表]"";" & _
   		vbcrlf&"    targetDivtr.style.display=""block"";" & _
   		vbcrlf&"    document.frames[""hiddenframe""].location.replace(""load.asp?action=f_online&fid="&Bbsid&""");" & _
   		vbcrlf&"  }" & _
   		vbcrlf&"  else" & _
   		vbcrlf&"  {" & _
   		vbcrlf&"    document.all.bbs_online_var.innerHTML=""[显示在线列表]"";" & _
   		vbcrlf&"    targetDivtr.style.display=""none"";" & _
   		vbcrlf&"  }" & _
   		vbcrlf&"}" & _
   		vbcrlf&"</script>" & _
   		
   		
   		
   		vbcrlf&"<div class=""mbonline"" style=""overflow:hidden""><div style=""float:left;height:25px;"">网站当前总在线 <font class=red>"&Cls.lk_Online&"</font> 人，其中 〖"&bbs_data(2)&"〗 上共有&nbsp;<span  id=online_num class=red>"&BbsOnline&"</span>&nbsp;人在线，注册用户 <span id=online_user class=red>"&Cls.bbs_UserOnline&"</span> 人，游客 <span id=online_guest class=red>"&Cls.bbs_GuestOnline&"</span> 人 ，今日帖子 <font class=red>"&bbs_data(13)&"</font> &nbsp;&nbsp;<span onclick='javascript:bbs_load_online();' id=bbs_online_var style=""font-weight:100"">[打开在线列表]</a></span></div>" & _
   		vbcrlf&"<div style='display:none' id=bbs_online_tr><div id=bbs_online onclick='javascript:bbs_load_online();'>正在读取在线用户数据，请稍侯……</div></div></div>"
end Function
Function SpecialType(snum)
    select case snum
	case 1
	SpecialType="购买贴"
	case 2
	SpecialType="可见贴"
	case 3
	SpecialType="回复贴"
	case 4
	SpecialType="指定贴"
	case else
	SpecialType="未知贴"
    end select
end Function
%>
