<%'@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'Option Explicit
'Response.buffer=true 				'开启缓冲页面功能

dim web_config,web_cookies,web_login,web_setup,web_menu,web_num,web_color,web_upload,web_safety,web_edition,web_label
dim web_news_art,web_down,web_shop,web_stamp,space_mod,web_skin,web_vt,objv7
dim web_error,user_grade,user_power,forum_type,now_time,timer_start,redx,kong,ukong,go_back,closer,lefter,righter
dim login_username,login_password,login_mode,login_message,login_popedom,login_emoney,login_integral
dim rs,sql,i,tit,tit_fir,index_url,action,page_power,m_unit,sk_bar,sk_class,sk_jt,sk_img
dim login_skins,morepic,web_skins,web_style,web_skins_open,titt,web_reg,web_lst,mbname,timmb,timemb
%>
<!-- #include file="common.asp" -->
<!-- #include file="common_skins.asp" -->
<!-- #include file="functions.asp" -->
<!-- #include file="jk_class.asp" -->
<%
set objv7=new fun_class

objv7.web_load()
web_vt=2
redx="&nbsp;<font color='#ff0000'>*</font>&nbsp;"
kong="<table width='100%' height=2><tr><td></td></tr></table>"
ukong="<table border=0><tr><td height=6></td></tr></table>"
go_back="<a href='javascript:history.back(1)'>返回上一页</a>"
closer="<a href='javascript:self.close()'>『关闭窗口』</a>"
sk_bar=11:sk_class="end":sk_jt="jt0"
sk_img="&nbsp;<img src='images/small/img.gif' border=0>"	' align=absmiddle
web_skin=objv7.web_var(web_config,5)
login_mode=""
login_popedom=""
login_message=0
login_username=trim(request.cookies(web_cookies)("login_username"))
login_password=jk_decrypt(trim(request.cookies(web_cookies)("login_password")))
login_skins=trim(request.cookies(web_cookies)("login_skins"))
if symbol_name(login_skins)<>"yes" then
login_skins=web_skins
end if
action=trim(request.querystring("action"))
morepic="<img src='skins/"&login_skins&"/more.gif' border=0>"

'-----------------------------------查看用户信息------------------------------------
function format_user_view(uuser,ut,uc)
  if len(uuser)<1 then format_user_view="<font class=gray>-----</font>":exit function
  if uc<>"" then uc=" class="&uc
  format_user_view="<a href='user_view.asp?username="&server.urlencode(uuser)&"' title='查看 "&uuser&" 的详细资料'"
  if ut=1 then format_user_view=format_user_view&" target=_blank"
  format_user_view=format_user_view&uc&">"&uuser&"</a>"
end function

'------------------------------------格式化图片-------------------------------------
function format_img(fvar)
  format_img="<img border=0 src='images/"&objv7.web_var(web_config,5)&"/"&fvar&"'>"
end function

function img_small(snum)
  img_small="<img border=0 src='images/small/"&snum&".gif' align=absmiddle>&nbsp;"
end function

function img_skins()
  img_skins="<img border=0 src='skins/"&login_skins&"/bullet.gif' align=absmiddle>"
end function

function img_tpic(co)
  if co=0 then
  img_tpic="<img border=0 src='skins/news/folderClose.gif' align=absmiddle>"
  else
  img_tpic="<img border=0 src='skins/news/folderopen.gif' align=absmiddle>"
  end if
end function
'------------------------------------格式化前台窗口------------------------------------
function main_bar(tpp,tit,tc,om,omm,more)
dim temp1,lorr
    select case tpp
    case 1
    lorr="mframe"
    case else
    lorr="lframe"
    end select
    main_bar=vbcrlf&"<table width="&omm&" cellspacing=0 cellpadding=0><tr><td class="&lorr&"-t-left></td><td class="&lorr&"-t-mid>" & _
    vbcrlf&"<span class="&lorr&"-t-text>"&tit&"</span></td>" & _
    vbcrlf&"<td class="&lorr&"-t-right></td></tr></table><table width="&omm&" cellspacing=0 cellpadding=0><tr><td class="&lorr&"-m-left></td><td class="&lorr&"-m-mid>" & _
    vbcrlf&""&tc&"" & _
    vbcrlf&"</td><td class="&lorr&"-m-right></td></tr></table>"
    select case om
    case 1
    temp1="<table width="&omm&" cellspacing=0 cellpadding=0><tr><td class="&lorr&"-m-left></td><td class="&lorr&"-m-mid align=right>"&more&"</td><td class="&lorr&"-m-right></td></tr></table>"
    case else
    temp1=""
    end select
    main_bar=main_bar&temp1&vbcrlf&"<table width="&omm&" cellspacing=0 cellpadding=0><tr><td class="&lorr&"-b-left></td>" & _
    vbcrlf&"<td class="&lorr&"-b-mid>&nbsp;</td><td class="&lorr&"-b-right></td></tr></table>"
end function
'------------------------------------格式化后台窗口------------------------------------
function admin_bar(tit,tc,om)
  select case tc
  case 1
  admin_bar=vbcrlf&"<table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=mframe-t-left></td><td class=mframe-t-mid>" & _
    vbcrlf&"<span class=mframe-t-text>"&tit&"</span></td>" & _
    vbcrlf&"<td class=mframe-t-right></td></tr></table><table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=mframe-m-left></td><td class=mframe-m-mid>"
  case else
  admin_bar=vbcrlf&"</td><td class=mframe-m-right></td></tr></table>" & _
    vbcrlf&"<table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=mframe-b-left></td>" & _
    vbcrlf&"<td class=mframe-b-mid>&nbsp;</td><td class=mframe-b-right></td></tr></table>"
  end select
end function
'------------------------------------格式化登陆窗口------------------------------------
function login_bar(tit,tc,om)
  select case tc
  case 1
  login_bar=vbcrlf&"<table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=lframe-t-left></td><td class=lframe-t-mid>" & _
    vbcrlf&"<span class=lframe-t-text>"&tit&"</span></td>" & _
    vbcrlf&"<td class=lframe-t-right></td></tr></table><table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=lframe-m-left></td><td class=lframe-m-mid>"
  case else
  login_bar=vbcrlf&"</td><td class=lframe-m-right></td></tr></table>" & _
    vbcrlf&"<table width="&om&" cellspacing=0 cellpadding=0 align=center><tr><td class=lframe-b-left></td>" & _
    vbcrlf&"<td class=lframe-b-mid>&nbsp;</td><td class=lframe-b-right></td></tr></table>"
  end select
end function
'-------------------------------------功能跳转--------------------------------------
function left_action(jt,lat)
  dim jtn:jtn=img_skins()
  left_action=vbcrlf&"<table border=0 width='96%' cellspacing=0 cellpadding=2 align=center>" & _
		vbcrlf&"<tr><td height=5 width='50%'></td><td width='50%'></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='user_action.asp?action=list'>用户列表</a></td><td>"&jtn&"<a href='online.asp'>与我在线</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='user_action.asp?action=top'>发贴排行</a></td><td>"&jtn&"<a href='user_action.asp?action=emoney'>财富排行</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=new'>论坛新贴</a></td><td>"&jtn&"<a href='forum_action.asp?action=hot'>论坛热贴</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=top'>论坛置顶</a></td><td>"&jtn&"<a href='forum_action.asp?action=good'>论坛精华</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=tim'>回复新贴</a></td><td>"&jtn&"<a href='help.asp?action=forum'>论坛帮助</a></td></tr>" & _
		vbcrlf&"</table>"
    left_action=kong&main_bar(0,"功能跳转",left_action,0,"100%","")&kong
end function

'-------------------------------------数据统计--------------------------------------
sub main_stat(sh,sjt,sm,st,sbg)
  dim num_topic,num_data,num_reg,new_username,num_news,num_article,num_down,stat_temp
  sql="select * from configs where id=1"
  set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    rs.close
    call configs_load()
    set rs=conn.execute(sql)
  end if
  num_topic=rs("num_topic")
  num_data=rs("num_data")
  num_reg=rs("num_reg")
  new_username=rs("new_username")
  num_news=rs("num_news")
  num_article=rs("num_article")
  num_down=rs("num_down")
  rs.close
  if sjt<>"" then sjt=img_skins()
  stat_temp="<table border=0 width='100%' align=center>"
  stat_temp=stat_temp&vbcrlf&"<tr><td>"&sjt&"网站注册：<font class=time>"&num_reg&"</font> 人</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"最新注册："&format_user_view(new_username,1,"")&"</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"主题总数：<font class=time>"&num_topic&"</font> 贴</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"贴子总数：<font class=time>"&num_data&"</font> 贴</td></tr>"
  if st=1 then
    'vbcrlf&"<tr><td height="&space_mod&">"&sjt&"网站模式：<font class=blue>"&objv7.web_var(web_stamp,int(mid(web_setup,3,1))+1)&"</font></td></tr>" & _
    stat_temp=stat_temp&vbcrlf&"<tr><td height="&space_mod&">"&sjt&"当前在线：<font class=time>"&online_num&"</font> 人</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"新闻总数：<font class=time>"&num_news&"</font> 条</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"文章总数：<font class=time>"&num_article&"</font> 篇</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"软件总数：<font class=time>"&num_down&"</font> 个</td></tr>"
  end if
  stat_temp=stat_temp&vbcrlf&"</table>"

  if st=1 then
    call left_type(stat_temp,"网站统计",0)
  else
    response.write kong&main_bar(0,"论坛数据",stat_temp,0,"100%","")
  end if
end sub
%>


<%'用户IP限制
function LockIP(sip)
	dim str1,str2,str3,str4,sql20,csk3,sql21,why
Set csk3=Server.CreateObject("ADODB.Recordset")
sql21="select * from LockIP"
csk3.open sql21,conn,1,3
conn.execute("update lockip set notim=true where now()>time")


	dim num,csk
	LockIP=false
	if isnumeric(left(sip,2)) then
		str1=left(sip,instr(sip,".")-1)
		sip=mid(sip,instr(sip,".")+1)
		str2=left(sip,instr(sip,".")-1)
		sip=mid(sip,instr(sip,".")+1)
		str3=left(sip,instr(sip,".")-1)
		str4=mid(sip,instr(sip,".")+1)
		if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
	
		else
			num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
			sql20="select count(*) from LockIP where mbname='' and notim<>true and ip1 <="&num&" and ip2 >="&num&""
			set csk=conn.execute(sql20)
Set csk3=Server.CreateObject("ADODB.Recordset")
sql21="select why from LockIP where mbname='' and ip1 <="&num&" and ip2 >="&num&""
csk3.open sql21,conn,1,3
if csk3.eof and csk3.bof then
else
why=csk3("why")
end if
if csk(0)>0 then 
				LockIP=true
			end if
			set csk=nothing
		end if
	end if
end function
%>

<%'网吧用户IP自动登录
function LockmbIP(sip)
	dim str1,str2,str3,str4,sql20,csk3,sql21,why
	dim num,csk
	lockmbIP=false
	if isnumeric(left(sip,2)) then
		str1=left(sip,instr(sip,".")-1)
		sip=mid(sip,instr(sip,".")+1)
		str2=left(sip,instr(sip,".")-1)
		sip=mid(sip,instr(sip,".")+1)
		str3=left(sip,instr(sip,".")-1)
		str4=mid(sip,instr(sip,".")+1)
		if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
	
		else
			num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
			sql20="select count(*) from LockIP where mbname<>'' and notim<>true and ip1 <="&num&" and ip2 >="&num&""
			set csk=conn.execute(sql20)
Set csk3=Server.CreateObject("ADODB.Recordset")
sql21="select * from LockIP where mbname<>'' and ip1 <="&num&" and ip2 >="&num&""
csk3.open sql21,conn,1,3
if csk3.eof and csk3.bof then
else
mbname=csk3("mbname")
timmb=csk3("tim")
timemb=csk3("time")
why=csk3("why")
end if
            if csk(0)>0 then 
				lockmbIP=true
			end if
			set csk=nothing
		end if
	end if
end function
'ip封
sub ip()
if LockIP(Request.ServerVariables("REMOTE_ADDR")) then
	response.write "<script>alert('您的IP:"&request.servervariables("remote_addr")&"已经被限制不能访问，请和管理员联系!');location.href='mailto:sczywj@163.com'</script><script>window.close();</script>"
	response.end
	end if
end sub


'-------代理广告加点-------
sub dlads()
dim rs9,sql9,dl
if request.cookies("DLIP")<>"" and request.cookies("DLIP2")<>request.cookies("DLIP") then
Set rs9=Server.CreateObject("ADODB.Recordset")
dl=request.cookies("DLER")
sql9="select * from user_data where username='"&dl&"'"
rs9.open sql9,conn,1,3
if rs9.eof and rs9.bof then
else
rs9("emoney")=rs9("emoney") + objv7.web_var(web_reg,11)
rs9("integral")=rs9("integral") + objv7.web_var(web_reg,10)
rs9("usercp")=rs9("usercp") + objv7.web_var(web_reg,10)
rs9("goleer")=rs9("goleer") + objv7.web_var(web_reg,11)
rs9.update
response.cookies("DLIP2")=request.servervariables("remote_addr")
response.cookies("DLIP2").expires=date+365
response.cookies("DLIP").expires=date+365
end if
rs9.close
set rs9=nothing
end if
end sub
'-------代理广告加点END-------
	'response.write "<script>alert('您的"&request.cookies("DLER")&"，请和管理员联系!');</script>"
%>