<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asa"-->
<!--#include file="inc/zzjyz.asp"--> 
<%
response.ContentType = "text/html;charset=gb2312"
a = request.QueryString("a")
'*************************************************
'自动获取短消息,返回数目
'*************************************************
If a="get_msg_num" Then
	If Dreamsun_name<>"" Then 
		Set rss=conn.execute("Select Count(id) from message where incept='"&Dreamsun_name&"' and issend=1 and flag=0 and delR=0")
		If rss.eof And rss.bof Then 
			getmm=0
		Else
			getmm=rss(0)
			if isnull(getmm) then getmm=0
		End If 
		If getmm>0 Then response.write "(<font color=red>"&rss(0)&"</font>)<bgsound src=""images/msg.mp3"" loop=""1"">"
		Set rss=Nothing
	End If 
	Response.End()
End If

'*************************************************
'当前位置
'*************************************************
If a="get_wz" Then
	wz=CheckStr(Request.QueryString("wz"))
	If Dreamsun_name<>"" And wz<>"" Then
		If Application(webname&"_TieBa_OL")="" Then 
			Application.Lock
			Application(webname&"_TieBa_OL")=","
			Application.UnLock
		End If 
		If InStr(Application(webname&"_TieBa_OL"),","&Dreamsun_name&",")<=0 Then 
			Application.Lock
			Application(webname&"_TieBa_OL")=Application(webname&"_TieBa_OL")&Dreamsun_name&","

			Application.UnLock
		End If 
		response.write wz
		End If 
	Response.End()
End If

'*************************************************
'自动获取时间，测试程序用
'*************************************************
If a="get_time" Then 
	response.write Now()
	Response.End()
End If
'*************************************************
'用户注册自动判断
'*************************************************
If a="checkreg" Then
	un=CheckStr(Request.QueryString("un"))
	If un="" Then
		Response.write ("<font color=red>用户名不可为空！</font>")
		Response.End()
	ElseIf GetStrLen(un)<4 Or GetStrLen(un)>10 Then
			Response.Write "<font color=red>用户名控制4-10位字符。</font>"
			Response.End()
	Else
		If IsKeptUser(un)= True  Then
			Response.write ("<font color=red>该用户名已经存在！</font>")
			Response.End()
		End if
		sql="select * from "& UserTable &"  where username='"&un&"'"
		Set rs = Server.CreateObject("ADODB.Recordset") 
		rs.open sql,conn,1,1 
			if not rs.eof then
				Response.write ("<font color=red>该用户名已经存在！</font>")
				Response.End()
			Else
				response.write "(<font color=red>恭喜，您可以注册该用户名！</font>) "
			End If 
	End If 
	Response.End()
End If
'*************************************************
'自动获取IP归属地
'*************************************************
If a="ipname" Then 
	Dim url
	Dim ipaddr,ipresult
	if CheckStr(Request.QueryString("ip"))="" then
		Response.Write("&nbsp;")
		Response.End()
	end if
	ipaddr = CheckStr(Request.QueryString("ip"))
	t1 = CheckNum(Request.QueryString("t1"))
	url = "http://www.cz88.net/ip/default.aspx?ip="
	if url<>"" then
		Response.Write(GetIpLocation(ipaddr,url,t1))
	else 
		Response.Write("")
	end if
	Response.End()
End If 
'*************************************************
'判断附件是否归属到某个帖子、回复帖子，确认垃圾邮件
'*************************************************
If a="guishu" Then
fn=CheckStr(Request.QueryString("fn"))
	If fn="" Then 

	Else
		set rs1=server.CreateObject("adodb.recordset")
			Rs1.open"select Id,title From "&bbstable&" where content like '%"&fn&"%' or picurl like '%"&fn&"%'",conn,1,1
				if not rs1.eof then
					while not rs1.eof
					title=trim(rs1("title"))%>
					主:<A title='<%=title%>' href='ShowNews.asp?id=<%=rs1("ID")%>' target=_blank><%=title%></A><BR>
				  <%Rs1.MoveNext
				  Wend
				  end if
			rs1.close
		set rs1=Nothing
		set rs1=server.CreateObject("adodb.recordset")
			Rs1.open"select re,id From "&rebbstable&" where content like '%"&fn&"%'",conn,1,1
				if not rs1.eof then
					while not rs1.eof
					title=trim(rs1("id"))%>
					回:<A href='ShowNews.asp?id=<%=rs1("re")%>' target=_blank><%=title%></A><BR>
				  <%Rs1.MoveNext
				  Wend
				  end if
			rs1.close
		set rs1=Nothing
	End If 
	Response.End()
End If 



%>
