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

tit_fir=""
iFrame = True
Call DoWebHead(0,0)
'----------------------------中间 开始----------------------------
  HtmlContent = Cls.ReadTemplate("index") 
  HtmlContent = LoadWebHead(HtmlContent)
  HtmlContent = LoadWebEnd(HtmlContent)
  HtmlContent = LoadBbsMain(HtmlContent)
  HtmlContent = Replace(HtmlContent,"{$ReadBbsData}",bbs_state())
  if Format_Mid_Num(42)=1 Or trim(request.querystring("Links"))="Show" then 
      HtmlContent = Replace(HtmlContent,"{$ReadBbsLink}",bbs_links()) 
  else 
      HtmlContent = Replace(HtmlContent,"{$ReadBbsLink}","") 
  end if
  HtmlContent = Replace(HtmlContent,"{$ReadBbsDown}",bbs_Down())
  if Format_Mid_Num(41)=1 Or trim(request.querystring("Birthday"))="Show" then 
      HtmlContent = Replace(HtmlContent,"{$ReadBbsBirthday}",bbs_Birthday()) 
  else 
      HtmlContent = Replace(HtmlContent,"{$ReadBbsBirthday}","") 
  end if
  Response.Write Cls.ReHtml(HtmlContent,0)
'----------------------------中间 结束----------------------------
call DoWebEnd()

function bbs_state()
  dim tmp1,tmp2,tmp3,tmp_bbs_cast,tmp_User_Info,Yesterday_Num
  sql="select count(tim) from AsaiMHBbsData where bbs_id<>999999999 and year(tim)='"&year(DATEADD("D",-1,date))&"' and month(tim)='"&month(DATEADD("D",-1,date))&"' and day(tim)='"&day(DATEADD("D",-1,date))&"'"
  rs.open sql,conn,1,3
  set rs=cls.exec(sql,1)
  Yesterday_Num=rs(0)
  rs.close 
  tmp_bbs_cast=Cls.cache_get("bbs_cast")
  if Cls.Is_null(tmp_bbs_cast)="" then
    tmp_bbs_cast="<font class=Gys>我们从八十年过来，一路上风雨兼程，我们知道，" & _
     vbcrlf&"我们不是神，我们也只是普通的人，踏实的人；" & _
     vbcrlf&"我们坚信，我们将把手上的中国创建成为令世界震撼的过度，中国强！(阿赛)</font>"
    sql="select top 1 id,topic,tim from AsaiMHCast where ChannelIDs="&ChannelIDs&" order by id desc"
    set rs=Cls.exec(sql,1)
    if not rs.eof then
      tmp_bbs_cast="<a href='"&Cls.Web_Dir&"Common/Update.asp?Action="&ChannelIDs&"#"&rs("id")&"' target=_blank>"&Cls.code_html(rs("topic"),1,0)&"</a> <font class=tims>"&Cls.time_type(rs("tim"),4)&"</font>"
    end if
    rs.close
    call Cls.cache_set("bbs_cast",tmp_bbs_cast)
  end if
  if Is_LoginTrue=true then
    dim msg_var
    if login_msg<1 then
      msg_var="<font class=Gys>"&login_msg&"</font>"
    else
      msg_var="<font class=red>"&login_msg&"</font>"
    end if
    tmp_User_Info="您好&nbsp;<font class=blue><b>"&login_username&"</b></font>&nbsp;你现在已登陆&nbsp;<font class=red2>"&format_power(login_mode,1)&"</font>&nbsp;模式，&nbsp;您目前有<font class=red>"&login_integral&"</font>分、<font class=red2>"&login_emoney&"</font>"&Cls.web_unit&"、<font class=red>"&login_strength&"</font>体力、<font class=red>"&login_expression&"</font>经验。&nbsp;<a href='"&Cls.Web_Dir&"User/Index.asp'>用户中心</a>&nbsp;&nbsp;<a href='"&Cls.Web_Dir&"User/Mail.asp'>我的短信箱（"&msg_var&"新）</a>&nbsp;&nbsp;<a href='"&Cls.Web_Dir&"User/Login.asp?action=logout' onclick=""javascript:return click_return('退出本次登陆',1);"">退出登陆</a>"
  else
    tmp_User_Info=vbcrlf&"<form name=""login_frm"" action='"&Cls.Web_Dir&"User/login.asp?old_url=back&action=login_chk' method=post onsubmit=""javascript:frm_submitonce(this);"">" & _
vbcrlf&"<div class=blogin>" & _
vbcrlf&"<input type=""hidden"" name=""chk"" value='yes'><input type=""hidden"" name=""re_log"" value='yes'>" & _
vbcrlf&"<select name=""login_type""><option value=""userloginname"">用户名</option><option value=""userloginid"">用户ID</option></select>：" & _
vbcrlf&"<input type=""text"" name=""logininfo"" value='' size=""10"" maxlegth=""20"" />" & _
vbcrlf&"密  码：<input type=""password"" name=""password"" value='' size=""10"" maxlegth=""20"" />" & _
vbcrlf&"验证码："&Cls.GetCode()&"" & _
vbcrlf&"Cookie：<select name=""memery_info"">" & _
vbcrlf&"<option value=""no"">不保存</option>" & _
vbcrlf&"<option value=""1"">一 天</option>" & _
vbcrlf&"<option value=""31"">一 月</option>" & _
vbcrlf&"<option value=""yes"">一 年</option></select>" & _
vbcrlf&"<input type=""submit"" value=""登 陆"" onclick=""jacascript:return login_true();"" class=sbut />" & _
vbcrlf&"<a href='"&Cls.Web_Dir&"User/Register.asp' class=tehr>注册账号</a>" & _
vbcrlf&"</div>" & _
vbcrlf&"</form>"
  end if
  tmp2=vbcrlf&"<a href=""index.asp""><b>网站社区</b> " & _
vbcrlf&"</a><br />"&tmp_User_Info&"<br />" & _
vbcrlf&"<div class=bdtit><a href='Search.asp?action=new' class=batit>论坛新贴</a>" & _
vbcrlf&"<a href='Search.asp?action=hot' class=batit>热门话题</a>" & _
vbcrlf&"<a href='Search.asp?action=my' class=batit>我的主题</a>" & _
vbcrlf&"<a href='Search.asp?action=join' class=batit>我的回复</a>" & _
vbcrlf&"<a href='Search.asp?action=good' class=batit>论坛精华</a>" & _
vbcrlf&"<a href='Search.asp?action=top' class=batit>论坛置顶</a>" & _
vbcrlf&"<a href='Search.asp?action=search' class=batit>论坛搜索</a>" & _
vbcrlf&"<a href='Super.asp' class=batit>版主评定</a>" & _
vbcrlf&"<a href='"&Cls.Web_Dir&"User/Action.asp?Action=list' class=batit>用户列表</a></div>"
  
    '//* 论坛数据统计 *//
  Dim iCount,Tii,Nnm_Topic,Num_Data
  iCount = Cls.Channel_Menu
  For Tii = 0 To UBound(iCount,2)
      If Int(iCount(11,Tii)) = 4 Then
		Nnm_Topic=iCount(29,Tii)
		Num_Data=iCount(30,Tii)
	  End If
  Next
  Erase iCount
  tmp1=vbcrlf&"<p align=right>今日:<font class=red>"&Cls.Web_InfoNo(7,0)&"</font> | " & _
vbcrlf&"昨日:<font class=red>"&Yesterday_Num&"</font> | " & _
vbcrlf&"主题:<font class=red>"&Nnm_Topic&"</font> | " & _
vbcrlf&"总共:<font class=red>"&Num_Data&"</font> | " & _
vbcrlf&"会员:<font class=red>"&Cls.Web_InfoNo(0,0)&"</font> | " & _
vbcrlf&"新会员:<b>"&format_user_name(Cls.Web_InfoNo(1,0),0,"")&"</b></p>"

  tmp3 = vbcrlf&"<div class=""notice"">"&tmp2&"<br />" & _
vbcrlf&tmp1&"</div>" & _

vbcrlf&"<div class=""mainbox"">" & _
	vbcrlf&"<div class=""rollboder"">" & _
	vbcrlf&"<ul>" & _
		vbcrlf&"<li class=""rollleft"">" & _
			vbcrlf&"<div class=""rollTextMenus"" id=""rollTextMenus"" style=""padding-left:10px"">" & _
				vbcrlf&"<a href='"&Cls.Web_Dir&"Common/update.asp?action=Bbs'><font color=red><b>    论坛公告:</b></font></a> "&tmp_bbs_cast&"" & _
			vbcrlf&"</div>" & _
		vbcrlf&"</li>" & _
		vbcrlf&"<li class=""rollright"" width=""40""><a title=""上一条"" href=""javascript:rollText(-1);""><img src=""images/last.gif"" alt=""上一条"" width=""11"" height=""11"" border=""0"" /></a> <a title=""下一条"" href=""javascript:rollText(1);""><img src=""images/next.gif"" alt=""下一条"" width=""11"" height=""11"" border=""0"" /></a></li>" & _
		vbcrlf&"<li class=""rollcenter"" id=""pageShow"" width=""30""></li>" & _
	vbcrlf&"</ul>" & _
	vbcrlf&"</div>"
    bbs_state =tmp3
end function

Function LoadBbsMain(HtmlContentStr)
  Dim HtmlStr,TrHtml,fTrHtml,bTrHtml,Bbsid,Bbsname
  HtmlStr=HtmlContentStr
  TrHtml = Cls.CutFixContent(HtmlStr, "[RepeatBbs]" , "[/RepeatBbs]", 0)
  fTrHtml = Cls.CutFixContent(TrHtml, "[Repeat]" , "[/Repeat]", 0)
  bTrHtml = Cls.CutFixContent(fTrHtml, "[Base]" , "[/Base]", 0)
  dim tmpstr,tmp1,classid,fcid,mdim,mnum
  tmpstr = ""
  if sqltype = 1 then
     sql = "execute AsaiMHBbs_Main"
  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_hidden=0 and bbs_star<2 order by class_id,bbs_order,bbs_star"
  end if
  call Cls.exe_conn(rs,sql,1)
  if not rs.eof then mdim=rs.getrows()
  rs.close
  mnum=-1
  if isarray(mdim) then mnum=ubound(mdim,2)
  fcid=0
  for i=0 to mnum
    classid=mdim(15,i)
    if int(fcid)<>int(classid) then
	if int(classid)>int(fcid) and int(fcid)>0 then 
	  tmpstr=tmpstr&replace(TrHtml,"[Repeat]"&fTrHtml&"[/Repeat]",tmp1)
	  tmpstr=replace(tmpstr,"{$Bbsname}",Bbsname)
	  tmpstr=replace(tmpstr,"{$list_url}","List.asp?fid="&Bbsid&"")
	end if
	fcid=classid
	tmp1 = ""
	Bbsid = mdim(0,i)
	Bbsname = mdim(3,i)
    else
	tmp1 = tmp1 & 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)
	'Response.Buffer=True
    end if
  next
  if int(fcid)>0 then
	  tmpstr=tmpstr&replace(TrHtml,"[Repeat]"&fTrHtml&"[/Repeat]",tmp1)
	  tmpstr=replace(tmpstr,"{$Bbsname}",Bbsname)
	  tmpstr=replace(tmpstr,"{$list_url}","List.asp?fid="&Bbsid&"")
  end if
  if isarray(mdim) then erase mdim
  LoadBbsMain = Replace(HtmlStr,"[RepeatBbs]"&TrHtml&"[/RepeatBbs]",tmpstr)
end Function

function bbs_links()
  bbs_links = vbcrlf&"<div class=""bbs_column0"">" & _
         vbcrlf&"<h2> 论坛联盟 </h2>" & _
         vbcrlf&"<script language=javascript src='"&Cls.Web_Dir&"Style/Data_link_bbs_main.js'></script><script language=javascript src='"&Cls.Web_Dir&"Style/Data_link_ftxt_main.js'></script>" & _
         vbcrlf&"</div>"
end function

function bbs_Birthday() 
  dim temp,temp1,nnum,username,power,ta,tim,last_tim 
  temp1="" 
  nnum=0 
  ta="'" 
  sql="select username,power,tim,last_tim from AsaiMHUserData where hidden=1 and month(birthday)="&month(Cls.now_time)&" and day(birthday)="&day(Cls.now_time)&" order by id" 
  call Cls.exec(sql,-1) 
  rs.open sql,conn,1,1 
  do while not rs.eof 
    temp1=temp1&"<li>" 
    for i=1 to 6 
    if rs.eof then exit for 
    username=rs(0) 
    power=rs(1)
    tim=rs(2)
    last_tim=rs(3)
    temp1=temp1&vbcrlf&" "&Cls.img("icon_"&rs("power"))&" <a href='"&Cls.web_dir&"User/View.asp?username="&server.urlencode(username)&"' title='用户类型："&format_power(rs("power"),1)&"" & _
                vbcrlf&"注册时间："&Cls.time_type(rs("tim"),5)&"" & _
                vbcrlf&"活动时间："&Cls.time_type(rs("last_tim"),5)&"' target=_blank  class=blue>"&username&"</a>"
    rs.movenext 
    nnum=nnum+1 
  next 
    temp1=temp1&"</li>" 
  loop 
  rs.close 
  temp = temp&vbcrlf&"<div class=""bbs_column0"">" & _ 
         vbcrlf&"<h2> 生日提醒（今日共 <font class=red>"&nnum&" </font>人）</h2>" & _ 
         vbcrlf&" " 
  if temp1="" then 
    temp = temp&vbcrlf&"今天没有过生日的用户" 
  else 
    temp = temp&vbcrlf&temp1 
  end if 
  temp = temp&vbcrlf&"</div>" 
   bbs_birthday = temp 
end function

function bbs_Down()
  dim tmp1,tmp2,tmp3
if Format_Mid_Num(41)<>1 then tmp2=" <img src='"&Cls.web_skindir&"sys/other_Bbs.gif' border=0><a href=Index.asp?Birthday=Show>打开今日生日栏</a>"
if trim(request.querystring("Birthday"))="Show" then tmp2=" <img src='"&Cls.web_skindir&"sys/other_Bbs.gif' border=0><a href=Index.asp>关闭今日生日栏</a>"
if Format_Mid_Num(42)<>1 then tmp3=" <img src='"&Cls.web_skindir&"sys/other_Bbs.gif' border=0><a href=Index.asp?Links=Show>打开论坛友情链接</a>"
if trim(request.querystring("Links"))="Show" then tmp3=" <img src='"&Cls.web_skindir&"sys/other_Bbs.gif' border=0><a href=Index.asp>关闭论坛友情链接</a>"
	tmp1=vbcrlf&"<div class=""mainbox"">" & _
		vbcrlf&"<div class=""Menubox"">" & _
		vbcrlf&"<ul>" & _
		vbcrlf&"<li id=""too1"" onclick=""setTab('too',1,2)"" class=""hover"">论坛图例</li>" & _
		vbcrlf&"<li id=""too2"" onclick=""setTab('too',2,2)"" >与我同在</li>" & _
		vbcrlf&"</ul>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"<div class=""Contentbox"">" & _
		vbcrlf&"<div id=""con_too_1"" >" & _
		vbcrlf&"<div class=""count"">" & _
		vbcrlf&"<ul>" & _
		vbcrlf&"<li>网站用户图例："&img_user()&"</li>" & _
		vbcrlf&"<li>用户系统信息：当前ＩＰ: "&user_ip&","&user_sys_type(user_sys)&""
	tmp1=tmp1&""&tmp2&tmp3&"</li>" & _
		vbcrlf&"<li>论坛贴子图例：<img border=0 src='{$skin_dir}Bbs/istops.gif' align=absmiddle> 总置顶 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/istopz.gif' align=absmiddle> 区置顶 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/istop.gif' align=absmiddle> 版置顶 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/isspecial.gif' align=absmiddle> 特殊贴 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/isok.gif' align=absmiddle> 普通贴 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/ishot.gif' align=absmiddle> 热门贴 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/isvote.gif' align=absmiddle> 投票帖 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/isgood.gif' align=absmiddle> 精华帖 " & _
		vbcrlf&"<img border=0 src='{$skin_dir}Bbs/islock.gif' align=absmiddle> 锁定贴 " & _
		vbcrlf&"</li>" & _
		vbcrlf&"</ul>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"<div id=""con_too_2"" style=""display:none"">" & _
		vbcrlf&"<div class=""count"">" & _
		vbcrlf&"<ul>" & _
		vbcrlf&"<li>网站当前在线 <span id=online_num class=red>"&Cls.LK_Online&"</span> 人，其中注册用户 <span id=online_user class=red>"&Cls.LK_UserOnline&"</span> 人，游客 <span id=online_guest class=red>"&Cls.LK_GuestOnline&"</span> " & _
		vbcrlf&" [ <img loaded=no id='bbs_online_img' src='"&Cls.web_skindir&"sys/other_Bbs.gif' border=0> <a onclick=""javascript:bbs_load_online();""><span id=bbs_online_var>打开在线列表</span></a> ] </li>" & _
		vbcrlf&"<li style=""display:none"" id=bbs_online_tr>" & _
		vbcrlf&"<div id=bbs_online onclick=""javascript:bbs_load_online();"">正在读取在线用户数据，请稍侯……</div>" & _
		vbcrlf&"</li>" & _
		vbcrlf&"</ul>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"</div>" & _
		vbcrlf&"<br /><div class=""footimg""><img src='"&Cls.web_skindir&"Bbs/state_new.gif' title=""有新帖的论坛""><img src='"&Cls.web_skindir&"Bbs/state_old.gif' title=""无新帖的论坛""><img src='"&Cls.web_skindir&"Bbs/state_lock.gif' title=""须认证的论坛""></div>"
	   bbs_Down= tmp1
end function
%>