<!-- #Include File="../../Include/Skin.asp" -->
<!-- #Include File="Common.asp" -->
<!-- #Include File="Con_bbs_Board.asp" -->
<%

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

Call Channel_Loader()

dim var_topic_field
var_topic_field="id,bbs_id,username,topic,tcolor,tbb,icon,tim,re_username," & _
                "re_counter,re_tim,istop,isvote,counter,vote_num," & _
                "islock,isgood,order_id,filetype,t_isspecial,SpecialID"

dim h_var3,dim_Bbs,dim_bbs_num,dim_bbs_data,dim_bbs_config,dim_Bbss_config,ftit,Bbsid,viewid
h_var3=2
dim_Bbs=split(Cls.ChannelOption,"|")
dim_bbs_num=ubound(dim_Bbs)
ftit=""
Bbsid=Cls.code_id("fid")
viewid=Cls.code_id("id")

sub bbs_end()
  erase dim_Bbs
  if isarray(dim_topic) then erase dim_topic
  if isarray(dim_bbs_data) then erase dim_bbs_data
  if isarray(dim_bbs_config) then erase dim_bbs_config
end sub

sub bbs_redirect(frvar)
  call bbs_end()
  call format_redirect(frvar)
end sub

'//* 版主显示 *//
Function bbs_Super_Type(st_var,st_con)
  dim tmp_1,s_select_type,tmp_dim,ti
  if st_con="" then st_con=0
  s_select_type=st_con
  tmp_1="<img src='"&Cls.web_skindir&"Bbs/bbs_power.gif' align=absmiddle title='论坛版主' border=0>"
  if st_var="" then
    tmp_1=tmp_1&"&nbsp;<font class=Gys>还没呢</font>"
    bbs_super_type=tmp_1
    exit function
  end if
  tmp_dim=split(st_var,"|")
  if s_select_type=1 then
    tmp_1=tmp_1&"&nbsp;<select name=bbs_power_sel onchange=""if(this.options[this.selectedIndex].value!=''){window.open('"&Cls.Web_Dir&"User/View.asp?username='+this.options[this.selectedIndex].value);}""><option value='' class=Gys>本版版主</option>"
    for ti=0 to ubound(tmp_dim)
      tmp_1=tmp_1&"<option value='"&tmp_dim(ti)&"'>"&tmp_dim(ti)&"</option>"
    next
    tmp_1=tmp_1&"</select>"
  else
    for ti=0 to ubound(tmp_dim)
      tmp_1=tmp_1&"&nbsp;"&format_user_view(tmp_dim(ti),1,0)
    next
  end if
  erase tmp_dim
  bbs_Super_Type=tmp_1
End Function

function base_bbs_isview(b_isvote,b_islock,b_re_counter,b_istop,b_isgood)
  dim temp_b
  if b_isvote=true then temp_b="<img src='"&Cls.web_skindir&"Bbs/isvote.gif' border=0 align=absMiddle title='投票主题'>&nbsp;&nbsp;"
  if b_re_counter>=10 then
        temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/ishot.gif' border=0 align=absMiddle title='热门主题'>&nbsp;&nbsp;"
  else
        temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/isok.gif' border=0 align=absMiddle title='开放主题'>&nbsp;&nbsp;"
  end if
  if b_islock=1 then temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/islock.gif' border=0 align=absMiddle title='锁定主题'>&nbsp;&nbsp;"
  if b_istop=1 then temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/istop.gif' border=0 align=absMiddle title='固顶主题'>&nbsp;&nbsp;"
  if b_istop=2 then temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/istopz.gif' border=0 align=absMiddle title='区固顶主题'>&nbsp;&nbsp;"
  if b_istop=3 then temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/istops.gif' border=0 align=absMiddle title='总固顶主题'>&nbsp;&nbsp;"
  if b_isgood=1 then temp_b=temp_b&"<img src='"&Cls.web_skindir&"Bbs/isgood.gif' border=0 align=absMiddle title='精华主题'>&nbsp;&nbsp;"
  base_bbs_isview=temp_b
end function

Function bbs_User_Sex0(fu_sex,fu_last_tim)
  Dim tmp1,tmpa,tmpb,tmpnum,tmpsex,tmpsname
  tmp1=fu_sex
  tmpa="0"
  tmpb="离线了"
  tmpnum=DateDiff("s",fu_last_tim,Cls.now_time)
  If tmpnum<=(Format_Mid_Num(14)*60) Then
    tmpa=""
    tmpb="在线哦！有人找吗？"
  End If
  tmpsex="boy"
  tmpsname=Cls.Web_Boy
  If fu_sex=False Then
    tmpsex="girl"
    tmpsname=Cls.Web_Girl
  End If
  bbs_User_Sex="<img src='"&Cls.web_skindir&"sys/"&tmpsex&tmpa&".gif' align=absmiddle title='"&tmpsname&"，"&tmpb&"' border=0>"
End Function

Function bbs_User_Sex(fu_sex,fu_last_tim)
  Dim tmp1,tmpa,tmpb,tmpnum,tmpsex,tmpsname,tmponline
  tmp1=fu_sex
  tmpa="0"
  tmpb="离线"
  tmpnum=DateDiff("s",fu_last_tim,Cls.now_time)
  If tmpnum<=(Format_Mid_Num(14)*60) Then
    tmpa=""
    tmpb="<b>在线</b>"
  End If
  tmpsex="boy"
  tmpsname=Cls.Web_Boy
  If fu_sex=False Then
    tmpsex="girl"
    tmpsname=Cls.Web_Girl
    tmponline="<font class=red2>"&tmpsname&"</font>"&tmpb&""
  Else
    tmponline="<font class=blue>"&tmpsname&"</font>"&tmpb&""
  End If
 'bbs_User_Sex="<img src='"&Cls.web_skindir&"sys/"&tmpsex&tmpa&".gif' align=absmiddle title='"&tmpsname&"，"&tmpb&"' border=0>"
  bbs_User_Sex=tmponline
End Function

Function bbs_Power_Grade(fp_power,fp_bbs_counter,fp_JF,fp_JY)
  Dim UserPut,UserLevelName,Powern,Pg_Star,Pg_Power,Pg_Grade_Name,gi,UserJF,UserJY,pBbs,pjf,pjy,fi,yi,ii
  Powern=format_power(fp_power,2)
  Pg_Power=format_power2(Powern,1)
  UserPut = Split(Cls.Web_UserLevel(0),",")
  UserLevelName = Split(Cls.Web_UserLevel(1),",")
  UserJF = Split(Cls.Web_UserLevel(2),",")
  UserJY = Split(Cls.Web_UserLevel(3),",")
  For gi = 0 To Ubound(UserPut)-1
      If int(fp_bbs_counter)>=int(UserPut(gi)) Then
      pBbs=gi
	  End If
  Next
  For fi = 0 To Ubound(UserJF)-1
      If int(fp_JF)>=int(UserJF(fi)) Then
      pjf=fi
	  End If
  Next
  For yi = 0 To Ubound(UserJY)-1
      If int(fp_JY)>=int(UserJY(yi)) Then
      pjy=yi
	  End If
  Next
  if pBbs>pjf and pBbs>pjy then
   ii=pBbs
  else
  if pjf>pBbs and pjf>pjy then
   ii=pjf
  else 
  ii=pjy
  end if
 end if
  Pg_Star=ii
  Pg_Grade_Name=UserLevelName(ii)
  Erase UserPut
  Erase UserJF
  Erase UserJY
  Erase UserLevelName
  Select Case Powern
  Case 1,2,3
    Pg_Star=Pg_Power
  Case 4
    Pg_Star="p"&Pg_Star
  End Select
  bbs_Power_Grade="<img src='"&Cls.web_skindir&"star/star_"&Pg_Star&".gif' border=0 align=absMiddle><br>等级："&Cls.img("icon_"&Pg_Power)&Pg_Grade_Name
End Function

Function bbs_UserName_Color(Power,Gt)
    If Gt=1 Then
	  bbs_UserName_Color=format_power(Power,6)
	Else
      bbs_UserName_Color=format_power(Power,5)
    End If
End Function

Function bbs_PowerName(Power)
  Dim TmpStr,pi
	TmpStr=Cls.Cache_Get("User_Group")
	For pi=0 To 2
	  If int(format_power(Power,2))-1=pi Then
        bbs_PowerName=TmpStr(1,pi)
      End If
    Next
End Function

Function bbs_Power_True(pvar)
  bbs_Power_True=False
  If int(login_modep)=1 or int(login_modep)=2 Then
    bbs_Power_True=true
    Exit Function
  End If
  If int(login_modep)>3 Or pvar="" Or login_username="" Then
    Exit Function
  End If
  If instr("|"&lcase(pvar)&"|","|"&lcase(login_username)&"|")>0 Then
    bbs_Power_True=true
  End If
End Function

Function bbs_Medal_Grade(Medal)
  Dim MedalName,MedalRemark,Ti,Tii,Tmp
  Medal=Split(Medal,"|")
  For Ti=0 To Ubound(Medal)
	MedalName = Split(Cls.Web_Medal(0),",")
	MedalRemark = Split(Cls.Web_Medal(1),",")
	For Tii=0 To ubound(MedalName)
	  If Cint(Medal(Ti))=Tii+1 Then bbs_Medal_Grade=bbs_Medal_Grade&"<img src="&Cls.Web_Dir&"Images/Medal/Medal"&Tii+1&".gif title='"&MedalName(Tii)&vbcrlf&MedalRemark(Tii)&"' align=absMiddle>&nbsp;"	
    Next
	Erase MedalName
	Erase MedalRemark
  Next
  Erase Medal
End Function

Public Function bbs_Topic_Folder(b_re_counter,page_num_hot,b_istop,b_isvote)
  dim Temp_b
  Temp_b="isok"
  If b_isvote<>0 Then
    Temp_b="isvote"
  else
   select case b_istop
    case 1
     Temp_b="istop"
    case 2
     Temp_b="istopz"
    case 3
     Temp_b="istops"
    case else
     If b_re_counter>=page_num_hot Then Temp_b="ishot"
   End select
  End if
  bbs_Topic_Folder=Temp_b
End Function

Public Function bbs_User_Blog(ByVal UserName)
 Dim tmp1
    sql="select classid from AsaiMHblog where username='"&UserName&"'"
    set rs=Cls.exec(sql,1)
    if not rs.eof then
    classid=rs(0)
    tmp1 = "<a href='"&Cls.Web_Dir&"Blog/?"&UserName&"' target='_blank'><font class=red2>浏览 <b><font class=blue>"&UserName&"</font></b> 的博客</font></a>"
	'else
    'tmp1 = "<font class=red2>点此<a href='../Blog/user.asp?action=reg'><b><font class=blue>申请</font></b></a>我的博客圈</font>"
    end if
   rs.close
   bbs_User_Blog = tmp1
End Function 

Public Function bbs_User_Isgood(ByVal UserName)
 Dim Num,tmp1
    sql="select count(id) from AsaiMHBbstopic where Isgood=1 and UserName='"&UserName&"'"
    set rs=Cls.exec(sql,1)
    if not rs.eof then
    Num=rs(0)
    tmp1 = "<font class=red2>"&Num&"</font>"
    end if
   rs.close
   bbs_User_Isgood = tmp1
End Function 

'//* 论坛底部主体信息说明  *//
Function bbs_img_topic()
  bbs_img_topic=Cls.ReadTemplate("img_topic")
 End Function

Sub bbs_Msg(frvar)
  Dim tmp1
  tmp1=vbcrlf&"<tr class=bbs_tr><td colspan=2 align=center height=200><font class=red><b>"&frvar&"</b></font><br><br>【<a href=""javascript:history.back(1)"">返回修改</a>】</td></tr>"
  Cls.ReadPage "common"
  Cls.HtmlRcod "title",tit&" - 系统提示信息"
  Cls.HtmlRcod "BbsGrade",bbs_grade(0)
  Cls.HtmlRcod "BbsTopBar",bbs_top(0,"")
  Cls.HtmlRcod "body",tmp1
  Cls.HtmlRcod "body",tmp1
  Cls.OutPage
End Sub

sub bbs_post_chk()
  dim tmp1
  tmp1=vbcrlf&"<tr class=bbs_tr><td colspan=2 align=left height=240>" & _
       vbcrlf&"<table border=0 align=left>" & _
       vbcrlf&"<tr><td align=left height=20><font class=red2>"&tit&"成功！谢谢您的发贴。</font></td></tr>" & _
       vbcrlf&"<tr><td  height=30>您现在可以选择以下操作：</td></tr>" & _
       vbcrlf&"<tr><td>　　1、<a href='View.asp?id=" & viewid & "'>您所发表或回复的主题</a>" & _
       vbcrlf&"<tr><td>　　2、<a href='List.asp?fid=" & Bbsid & "'>返回 <b>" & bbs_data(2) & "</b></a></td></tr>" & _
       vbcrlf&"<tr><td>　　3、<a href='Index.asp'>返回论坛首页</a></td></tr>" & _
       vbcrlf&"<tr><td>系统将在 "&Format_Mid_Num(25)&" 秒钟后自动返回 <b>" & bbs_data(2) & "</b> …</td></tr>" & _
       vbcrlf&"</table>" & _
       vbcrlf&"</td></tr>" & _
       vbcrlf&"<meta http-equiv='refresh' content='"&Format_Mid_Num(25)&"; url=List.asp?fid=" & Bbsid & "'>"
  Cls.ReadPage "common"
  Cls.HtmlRcod "title",tit
  Cls.HtmlRcod "BbsGrade",bbs_grade(0)
  Cls.HtmlRcod "BbsTopBar",bbs_top(0,"")
  Cls.HtmlRcod "body",tmp1
  Cls.OutPage
end sub

'================================================
'作  用：用户星座
'参  数：
'	birthday,ishowbir : 用户星座
'================================================
Public Function bbs_User_Star(ByVal Birthday,ByVal Ishowbir)
  If Birthday="" Or Cls.Is_Null(Birthday)="" Then Exit Function
  Dim bir,birmon,birday,mon,da:Mon=Month(birthday)
  If len(mon)=1 then mon="0"&mon
  Da=Day(birthday)
  If len(da)=1 then da="0"&da
  bir=mon&da
  If bir>="0120" and bir<="0218" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z11.gif alt=水瓶座"&mon&"-"&da&">":exit Function
  If bir>="0219" and bir<="0320" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z12.gif alt=双鱼座"&mon&"-"&da&">":exit Function
  If bir>="0321" and bir<="0419" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z1.gif alt=白羊座"&mon&"-"&da&">":exit Function
  If bir>="0420" and bir<="0520" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z2.gif alt=金牛座"&mon&"-"&da&">":exit Function
  If bir>="0521" and bir<="0621" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z3.gif alt=双子座"&mon&"-"&da&">":exit Function
  If bir>="0622" and bir<="0722" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z4.gif alt=巨蟹座"&mon&"-"&da&">":exit Function
  If bir>="0723" and bir<="0822" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z5.gif alt=狮子座"&mon&"-"&da&">":exit Function
  If bir>="0823" and bir<="0922" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z6.gif alt=处女座"&mon&"-"&da&">":exit Function
  If bir>="0923" and bir<="1023" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z7.gif alt=天秤座"&mon&"-"&da&">":exit Function
  If bir>="1024" and bir<="1121" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z8.gif alt=天蝎座"&mon&"-"&da&">":exit Function
  If bir>="1122" and bir<="1221" then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z9.gif alt=射手座"&mon&"-"&da&">":exit Function
  If bir>="1222"  or bir<="0119"  then  bbs_User_Star = "<img src="&Cls.Web_Dir&"images/star/z10.gif alt=摩羯座"&mon&"-"&da&">":exit Function
  If Ishowbir then bbs_User_Star=bbs_User_Star&"Birthday"
End Function

%>
