<%
Response.Buffer = True'''''''打开缓存
Dim Start
start=timer()

Dim SchoolmateURL

Dim PointSet

Dim IntVar,StrVar
Dim BoolVar(25)
dim joinquestion,joinanswer,joinanswerts

Dim ClassNum
Dim UserNum,Photonum,liuyannum
Dim bbsnum,topicnum,todaynum

Dim TableBorderColor,LightTBColor,DarkTBColor,BodyColor

TableBorderColor="#ffffff"
LightTBColor="#ecf2fc"
DarkTBColor="#E6ecf9"
BodyColor="#fafaff"

Dim Conn,ConnStr
%>
<!--#include file="SqlConfig.asp" -->
<%
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"

On Error Resume Next
Set Conn = Server.CreateObject("ADODB.Connection")
On Error Resume Next
Conn.Open ConnStr
If Err Then
	err.Clear
	Set Conn = Nothing
	Response.Write "数据库连接出错，请检查连接字串。"
	Response.End
End If

Call getconst()

Sub getconst()

	Dim ConfigRs,ConfigStr
	Dim pageurl,tmpstr,i
	ConfigStr=""

    if application("FengLing_Config")="" or DateDiff("s",CDate(Application("FengLing_Updatetime")),Now()) >= 3600 Then
	set ConfigRs=Conn.Execute("select point,IntVar,StrVar,BoolVar,UserNum,ClassNum,bbsNum,topicNum,TodayNum,Photonum,Liuyannum,question,answer,answerts from config")
	for i=0 to 13
	if ConfigStr<>"" Then
	   ConfigStr=ConfigStr&"@@@"&ConfigRs(i)
	else
	ConfigStr=ConfigRs(i)
	end if
	next
	application("FengLing_Config")=ConfigStr
	Application("FengLing_Updatetime")=now()
	end if
	ConfigStr=application("FengLing_Config")
	ConfigRs=split(ConfigStr,"@@@")
	
	pageurl=Request.ServerVariables("server_name")&Request.ServerVariables("URL")
	tmpstr=Split(pageurl,"/")
	schoolmateurl="http://"&replace(pageurl, tmpstr(ubound(tmpstr)), "")
    
	UserNum=ConfigRs(4)
	ClassNum=ConfigRs(5)
	Photonum=ConfigRs(9)
	Liuyannum=ConfigRs(10)

	bbsnum=ConfigRs(6)
	topicnum=ConfigRs(7)
	todaynum=ConfigRs(8)

	PointSet=split(ConfigRs(0),",")
	IntVar=split(ConfigRs(1),",")
	StrVar=split(ConfigRs(2),"|||")
    joinquestion=split(ConfigRs(11),"|")
	joinanswer=split(ConfigRs(12),"|")
	joinanswerts=split(ConfigRs(13),"|")
	
	for i=0 to ubound(BoolVar)
		BoolVar(i)=cbool(mid(ConfigRs(3),i+1,1))
	next

	Set ConfigRs=Nothing

End Sub


Sub EndConnection()
	Conn.close
	Set Conn=Nothing
	Erase IntVar
	Erase StrVar
	Erase BoolVar
	Erase PointSet
    Erase joinquestion
	Erase joinanswer
	Erase joinanswerts
	
End Sub
if BoolVar(14) then
call closeweb()
end if
sub closeweb()
response.write "<html>"
response.write "<head>"
response.write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>"
response.write "<link href=""Class_Main.css"" rel=""stylesheet"" type=""text/css"">"
response.write "</hend>"
response.write "<body>"
response.write "<div align=center>"
response.write "<p>&nbsp;</p>"
response.write "<p>&nbsp;</p>"
response.write "<p>&nbsp;</p>"
response.write "<table width=760 height=400 border='0' cellspacing='0' cellpadding='0'>"
response.write "<tr height=24><th width=10></th><th width=740>"
response.write "由于以下原因，本站暂停开放"
response.write "</th><th width=10></th></tr>"
response.write "<tr class=LightTableBody>"
response.write "<td colspan=3 class=td2 valign=top>"
response.write "<br>"
response.write StrVar(10)
response.write "<p>&nbsp;</p>"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
response.write "<td colspan=3 class=td2>"
response.write "<div align=center>由此进入"
response.write "<a href='admin/admin_index.asp'>>>后台管理>></a>"
response.write "</div>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.write "</div>"
response.write "</body>"
response.write "</html>"
call EndConnection()
response.end()
end sub

Sub Error(errorlevel,ErrMsg)

if BoolVar(1) Then
	Response.Write "<bgsound src=""sound/"&errorlevel&".wav"" border=0>"
End if
%>
<br><br>
<table cellpadding=0 cellspacing=0 border=0	width=80% Class=TableBorder	align=center>
<tr>
	<td>
		<table cellpadding=5 cellspacing=1 border=0	width=100%>
		<tr	align="center">	
		  <th width="100%"><b>校友录错误信息</b></th>
		</tr>
		<tr	Class=LightTableBody>
			<td><table	width="100%" height="100%" border="0" Class=LightTableBody>
				<tr><td width=80 align=center><img src="images/<%=errorlevel%>.gif" align=absmiddle></td>
					<td class=mp valign=center><br><b>产生错误的可能原因：</b><br><br>
					<li>您是否仔细阅读了<a href=Class_Help.asp target=_blank>帮助文件</a><%=ErrMsg%><br><br>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr	align="center">	
		  <td width="100%" Class=DarkTableBody><input type=button onclick="javascript:history.go(-1)" value="确定(O)" style="width:65px" accesskey=o class=button>
		  </td>
		</tr>  
		</table>
	</td>
</tr>
</table><BR>

<%End Sub%>