⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 in_conn.asp

📁 一个超级漂亮的班级主页asp代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Session.CodePage=936 %>

<script language="JavaScript" charset='gb2312'>
var Startime,Endtime;
var now =new Date()
Startime=now.getTime()
</script>

<%
'页面执行的开始时间
dim tm_start,tm_end
tm_start=timer()


%>


<!--#include file="in_conn_db.asp"-->


<%
Function stryin(str1)
stryin=Replace(str1,"'","''")
End Function

Function stryin2(str33)
stryin2=Replace(str33,chr(34),"&quot;")
End Function


'截取中英文字符串前n个全角位的函数
Function hhstr(str,cd)
Dim i
dim Sum
dim S,mo
Sum=0.0
for i=1 to Len(str)
	S=Asc(mid(Str,i,1))
	if S<0 Then
		S=S+65536
	end if
	If S<256 then
		Sum=Sum+0.5
	Else
		Sum=Sum+1
	End If

	If Sum>cd Then
		if S<256 then
			Sum=Sum-0.5
		else
			Sum=Sum-1
		end if
		if Sum<CD then
			mo=" …"
		else
			mo="…"
		end if

		hhstr=Left(str,i-1)&mo
		Exit Function
	End if             
Next
    hhstr=str      
End Function

'处理html标记的函数
Function unhtml(str)
dim vstr
dim l
l=len(str)
vstr=""
dim i
for i = 1 to l
	select case mid(str,i,1)
		   case "<"
				vstr=vstr+"&lt;"
		   case ">"
				vstr=vstr+"&gt;"
		   case chr(34)
				vstr=vstr+"&quot;"
		   case "&"
				vstr=vstr+"&amp;"
		   case chr(13)
				vstr=vstr+"<br>"
		   case chr(9)
				vstr=vstr+"&nbsp;&nbsp;&nbsp;&nbsp;"
		   case chr(32)
				'vstr=vstr+"&nbsp;"
				if i+1<=l and i-1>0 then
				   if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9)  then
					  vstr=vstr+"&nbsp;"
				   else
					  vstr=vstr+" "
				   end if
				else
				   vstr=vstr+"&nbsp;"
				end if
		   case else
				vstr=vstr+mid(str,i,1)
	 end select
   next
   unhtml=vstr
end Function


'去除html标注
Function KillHTMLLabel(str)

	Dim n,m,str2
	n = inStr(str,"<")
	m = inStr(str,">")
	str2 = str
	Do while n > 0 and n < m
		str2 = Left(str2,n-1) & Mid(str2,m+1)
		n = inStr(str2,"<")
		m = inStr(str2,">")
	Loop
	KillHTMLLabel = str2

End Function



'去除段落末尾的回车
Function jiewei(strwei)
dim lenwei
dim str4
	lenwei=LEN(strwei)-2
	str4=strwei
	DO UNTIL right(str4,2)<>vbCrLf
		str4=left(str4,lenwei)
		lenwei=LEN(str4)-2
	LOOP
jiewei=Replace(str4,vbCrLf&vbCrLf,vbCrLf)
End Function


'获取站点默认信息
dim DEF_webname,DEF_weburl,DEF_classname,DEF_sysadm,DEF_logo,DEF_top
dim DEF_msgmax,DEF_top_w,DEF_top_h

sqlstr="SELECT webname,weburl,classname,sysadm,msgmax,logofile,topfile,topw,toph,mb_check,pg_txb,pg_bbs,pg_topic,pg_fj,val_log,val_pub,cl_1,cl_2,cl_3,cl_4,cl_5,cl_6,cl_7 FROM tblsys"
rs.Open sqlstr,conn,1,1
if rs.eof AND rs.bof then
	Response.write "数据库出错"
	Response.End
else
	DEF_webname=rs("webname")
	DEF_weburl=rs("weburl")
	DEF_classname=rs("classname")
	DEF_msgmax=rs("msgmax")
	DEF_sysadm=rs("sysadm")
	DEF_logo=rs("logofile")
	DEF_top=rs("topfile")
	DEF_top_w=rs("topw")
	DEF_top_h=rs("toph")
	DEF_mb_chk=rs("mb_check")
	DEF_pg_txb=rs("pg_txb")
	DEF_pg_bbs=rs("pg_bbs")
	DEF_pg_topic=rs("pg_topic")
	DEF_pg_fj=rs("pg_fj")
	DEF_val_log=rs("val_log")
	DEF_val_pub=rs("val_pub")
	DEF_cl1=rs("cl_1")
	DEF_cl2=rs("cl_2")
	DEF_cl3=rs("cl_3")
	DEF_cl4=rs("cl_4")
	DEF_cl5=rs("cl_5")
	DEF_cl6=rs("cl_6")
	DEF_cl7=rs("cl_7")
end if

rs.close


'检查是否已经登录,如果cookies有永久登陆的信息,则从cookies获取登陆信息
if Session("sname")="" AND Request.Cookies(DEF_weburl)("name")<>"" then
	sqlstr="SELECT lastlog,cnt_on FROM tblmates WHERE name='"&stryin(Request.Cookies(DEF_weburl)("name"))&"'"
		rs.open sqlstr,conn,1,3

		if NOT(rs.eof AND rs.bof) then
			Session("sname")=Request.Cookies(DEF_weburl)("name")
			Response.Cookies(DEF_weburl).Expires=DateAdd("d",1000,Date())
			rs("lastlog")=now()
			rs("cnt_on")=rs("cnt_on")+1
			rs.update
		end if
		rs.close
end if

dim u_name
u_name=Session("sname")



'成员积分级别函数
dim DEF_vclass
Function umark(iion,iiwater)
dim iiclass,iitotal
	iitotal=iion*DEF_val_log+iiwater*DEF_val_pub
	IF iitotal<=20 THEN
		iiclass=1
	ELSEIF iitotal<=50 THEN
		iiclass=2
	ELSEIF iitotal<=100 THEN
		iiclass=3
	ELSEIF iitotal<=200 THEN
		iiclass=4
	ELSEIF iitotal<=300 THEN
		iiclass=5
	ELSEIF iitotal<=400 THEN
		iiclass=6
	ELSEIF iitotal<=600 THEN
		iiclass=7
	ELSEIF iitotal<=800 THEN
		iiclass=8
	ELSEIF iitotal<=1100 THEN
		iiclass=9
	ELSEIF iitotal<=1400 THEN
		iiclass=10
	ELSEIF iitotal<=1700 THEN
		iiclass=11
	ELSEIF iitotal<=2000 THEN
		iiclass=12
	ELSEIF iitotal<=3400 THEN
		iiclass=13
	ELSEIF iitotal<=4800 THEN
		iiclass=14
	ELSEIF iitotal<=6200 THEN
		iiclass=15
	ELSEIF iitotal<=8000 THEN
		iiclass=16
	ELSEIF iitotal<=12000 THEN
		iiclass=17
	ELSEIF iitotal<=20000 THEN
		iiclass=18
	ELSEIF iitotal<=25000 THEN
		iiclass=19
	ELSEIF iitotal<=30000 THEN
		iiclass=20
	ELSEIF iitotal>30000 THEN
		iiclass=21
	END IF
	SELECT CASE iiclass
		Case 1,2,3
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#000000'>"&DEF_cl1&"</font>]<br><img src='img/c1.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 4,5,6
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#131987'>"&DEF_cl2&"</font>]<br><img src='img/c2.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 7,8,9
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#E40001'>"&DEF_cl3&"</font>]<br><img src='img/c3.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 10,11,12
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#FF870F'>"&DEF_cl4&"</font>]<br><img src='img/c4.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 13,14,15
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#1D3817'>"&DEF_cl5&"</font>]<br><img src='img/c5.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 16,17,18
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='#100063'>"&DEF_cl6&"</font>]<br><img src='img/c6.gif' border='0' alt='当前积分:"&iitotal&"'>"
		Case 19,20,21
			Response.Write "<br>等级"&iiclass&"&nbsp;[头衔:<font color='red'>"&DEF_cl7&"</font>]<br><img src='img/c7.gif' border='0' alt='当前积分:"&iitotal&"'>"
	END SELECT
	DEF_vclass=iiclass
End Function


'访问统计相关
IF Request.Cookies("uck").HasKeys THEN
	Response.Cookies("uck").Expires=DateAdd("n",20,now())
END IF


'清理封禁情况
sqlstr="UPDATE tblmates SET power=1 WHERE power<0 AND fobdate<#"&CDate(FormatDateTime(now(),2))&"#"
conn.Execute sqlstr
%>

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><% =DEF_webname %></title>
<style type="text/css">
<!--#include file="style.asp"-->
</style>

<style type='text/css'id='defaultPopStyle'>
.cPopText { font-family: Verdana, 宋体; background-color: <% =cohover %>; border: 3px <% =cohover %> double; font-size: 11px;color: #FFFFFF; padding-right: 2px; padding-left: 2px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}
</style>

<script language="JavaScript" charset='gb2312' src="common.js"></script>


</head>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -