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

📄 cls.asp

📁 教师评估系统
💻 ASP
📖 第 1 页 / 共 3 页
字号:
function DelFile(DelFilePath)
on error resume next
dim fso 
DelFile=true
set fso=server.CreateObject("Scripting.FileSystemObject")
fso.deleteFile Server.MapPath(BBSPath&DelFilePath),true
if Err Then
Err.Clear
DelFile=false
end if
set fso=nothing
end function

function CheckPOST
if Request.ServerVariables("Request_method") <> "POST" then
%><form method="post" name="CheckPOST" action="?<%=Request.ServerVariables("Query_String")%>"></form><script type="text/javascript">if(confirm('您确定要执行该操作?')){returnValue=CheckPOST.submit()}else{returnValue=history.back()}</script><%
Response.end
end if
end function

function CheckSize(ByteSize)
if ByteSize=>1024000000 then
ByteSize=FormatNumber(ByteSize/1024000000)&" GB"
elseif ByteSize=>1024000 then
ByteSize=FormatNumber(ByteSize/1024000)&" MB"
elseif ByteSize=>1024 then
ByteSize=FormatNumber(ByteSize/1024)&" KB"
else
ByteSize=ByteSize&" 字节"
end if
CheckSize=ByteSize
end function

function ShowRole(RoleID)
ShowRole=Cache("Role"&RoleID)
end function

Function IsWebSearch()
IsWebSearch = False
Dim Botlist,i
BotList = "Google,Baiduspider,Microsoft-ATL-Native,yahoo,yisou,Isaac,SurveyBot,3721,ia_archiver,P.Arthur,FAST-WebCrawler,Java,TurnitinBot,WebGather,Sleipnir"
Botlist = Split(Botlist,",")
For i = 0 To UBound(Botlist)
if InStr(Lcase(Request.ServerVariables("HTTP_USER_AGENT")),Lcase(Botlist(i))) > 0 Then
IsWebSearch = True
Exit For
end if
Next
end Function

function ClubTree
 ClubTree="<span id='tempk'><a onmouseover=""loadtree('','3')"" href='"&Cache("SiteUrl")&"'>"&Cache("SiteName")&"</a></span>"
end function

function GetJsStr(str)
if IsNull(str) Then
Str = ""
Else
Str = Replace(str,"'","\'")
Str = Replace(str,chr(34),"\"&chr(34))
end if
GetJsStr = str
end Function

Function WriteVerifyCode()
WriteVerifyCode="<input type=""text"" name=""VerifyCode"" size=""10"" /> <img src=""GetCode.asp"" alt=""验证码,看不清楚?请点击刷新验证码"" class=""hand"" onclick=""this.src='GetCode.asp?'+Math.random()+'';"" />"
end Function

sub CleanCookies
For Each Item In Request.Cookies
Response.Cookies(Item)=Empty
Next
end sub

sub ShowRank(Experience)
sql="select top 1 RankName,RankIconUrl from [WxRanks] where PostingCountMin<="&Experience&" order by PostingCountMin Desc"
Set UserRank=Conn.Execute(sql)
if UserRank.Eof then
RankName="未知级别"
RankIconUrl="Images/level/1.gif"
else
RankName=UserRank(0)
RankIconUrl=UserRank(1)
end if
Set UserRank = Nothing
end sub

sub top(title,disptop)
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Keywords" content="<%=Cache("MetaKeywords")%>" />
<meta name="Description" content="<%=Cache("MetaDescription")%>" />
<script src="Themes/<%=Cookies("Themes")%>/Theme.js" type="text/javascript"></script>
<script src="Inc/global.js" type="text/javascript"></script>
<style type="text/css">
@import url(Themes/Themes.css);
@import url(Themes/<%=Cookies("Themes")%>/Theme.css);
</style>
<title><%=title%> - <%=Cache("SiteName")%></title>
</head>

<body>
<%if disptop then%>
<script type="text/javascript">ShowSysTop('<%=CookieUserName%>','<%=UserRoleID%>',<%=NewMessage%>);</script>
<div id="Popup"></div>
<div id="mainbody"><%
if Cache("DisplayTopAd") Then Response.write Cache("TopAd")
toptrue=1
end if
end sub

sub HtmlEnd
%><div align="center" class="ac cb"><%=Cache("BottomAd")%></div>
</div>
<div id="footer">
Total <%=FormatNumber(timer()-startime,5,true)%>(s) , Time now is:<%=Now()%>.<br />
Powered by WxBBS v<%=SysVersion%> Code &copy; 2004-08 <a href="http://www.wxsky.cn" target="_blank">Wxsky</a> Labs.<br />
<a href="<%=Cache("CompanyUrl")%>" target="_blank"><%=Cache("CompanyName")%></a> | <a href="http://www.miibeian.gov.cn" target="_blank"><%=Cache("ICPName")%></a>
</div>
<script type="text/javascript">ShowBottom();</script>
</body>
</html><%
CloseDataBase
end sub

sub Succ(desc,help,Url)
if toptrue<>1 Then
top "操作成功",True
end if:Response.write "<div class=""nav dt""><img alt="""" src=""Images/Forum_nav.gif"" />&nbsp; "&ClubTree&" → 提示信息</div>"%>
<meta http-equiv="refresh" content="<%=Cache("RefreshTime")%>;Url=<%=URL%>" />
<div class="tb dt" style="width:600px;">
<div id="tt" class="ac"><%=Cache("SiteName")%> - 操作成功</div>
<div class="tc">
<div class="fl ac w2" style="padding-top:20px;"><img alt="" src="Images/succ.gif" /></div>
<div class="fl al" style="padding-top:15px;"><span class="gr"><b><%=desc%></b> 成功</span>,浏览器将自动跳转。<a href="<%=Url%>">如果浏览器没有跳转请点这里</a><br />
<ul>
    <%=help%>
    <li><a href="Default.asp">返回论坛首页</a></li>
</ul>
</div>
</div>
</div>
<%
HtmlEnd
end sub

sub Error(desc,help)
if toptrue<>1 Then top "错误信息",True
Response.write "<div class=""nav dt""><img alt="""" src=""Images/Forum_nav.gif"" />&nbsp; "&ClubTree&" → 提示信息</div>"
if IsNumeric(desc) Then
 Select case desc
  case 0
   desc="您还没有登录或权限不足"
   if ChkNumeric(ForumID)>0 Then help=help+"<li><a href=ForumsPower.asp?Fid="&ForumID&">查看我的权限</a></li>"
   if Not IsUser Then help="<li><a onclick="&chr(34)&"return ShowModal('登录论坛','Login.asp');"&chr(34)&">点这里登录论坛</a></li>"+help
  case 2
   desc="该功能限游客操作"
   help="<li><a href=Login.asp?menu=out>点这里退出登录</a></li>"
  case 3
   desc="输入数值有误"
   help=help&"<li>请检查更正后提交</li>"
  case 4
   desc="操作错误"
  case 5
   desc="申请内容有误"
  case Else
   desc="其他原因"
 end Select
end if
%>
<div class="tb dt" style="width:600px;">
<div id="tt" class="ac"><%=Cache("SiteName")%> - 操作失败</div>
<div class="tc">
<div class="fl ac w2" style="padding-top:20px;"><img alt="" src="Images/error.gif" /></div>
<div class="fl al" style="padding-top:15px;">因为 <span class="or"><b><%=desc%></b> 操作失败</span><br />
<ul>
    <%=help%>
    <li>请<a href="Help.asp" target="_blank">阅读帮助文件</a>或询问管理员</li>
</ul>
</div>
</div>
<div class="tc ac cb"><input type="button" onclick="history.back()" value=" << 返 回 上 一 页 " /></div>
</div>
<%
HtmlEnd
end sub

sub Error2(Message)
%><script type="text/javascript">alert('<%=Message%>');history.back();</script><script type="text/javascript">window.close();</script><%
CloseDataBase
end sub

sub Alert(Message)
%><script type="text/javascript">alert('<%=Message%>');</script><%
CloseDataBase
end sub

sub ChkUser()
if Not IsUser Then Error 0,""
end sub

sub ChkVisitor()
if IsUser Then Error 2,""
end sub

sub ForumTree(selec)
sql="select ID,ForumName,ParentID from [WxForums] where id="&selec&""
Set Rsx=Conn.Execute(sql)
if Not Rsx.Eof then
ForumTreeList="<span id='temp"&selec&"'><a onmouseover=""loadtree('"&selec&"','0')"" href='Forums.asp?Fid="&Rsx(0)&"'>"&Rsx(1)&"</a></span> → "&ForumTreeList&""
ForumTree Rsx(2)
end if
Rsx.close
Set Rsx=Nothing
end sub

sub ShowPage()
PageUrl=ReplaceText(Request.QueryString,"PageIndex=([0-9]*)&","")
PageUrl=ReplaceText(PageUrl,"PageIndex=([0-9]*)","")
if Request.Form<>"" then PageUrl=""&PageUrl&"&"&Request.Form&""
Response.write "<div class=""pages"">"
if PageCount<4 Then
 PageStart=1
Else
 PageStart=PageCount-4
end if
if TotalPage>(PageCount+4) Then
 PageEnd=PageCount+4
Else
 PageEnd=TotalPage
end if
Response.write "<a href=""?PageIndex=1&"&PageUrl&"""><b>&laquo;</b></a>"
For i=PageStart to PageEnd
if i=PageCount Then
	Response.write "&nbsp;<b>"&i&"</b>&nbsp;"
Else
	Response.write "<a href=""?PageIndex="&i&"&"&PageUrl&""">"&i&"</a>"
end if
next
%>
<input size="3" type="text" onKeyDown="javascript: if((event.keyCode==13)&amp;&amp;(this.value!=''))window.location='?PageIndex='+this.value+'&<%=PageUrl%>';" onKeyUp="if(isNaN(this.value))this.value=''" />
<a href="?PageIndex=<%=TotalPage%>&amp;<%=PageUrl%>"><b>&raquo;</b></a> Pages: ( <%=PageCount%>/<%=TotalPage%> total )</div>
<%
end sub

sub Log(Message)
if Message=Empty Then Message="系统日志"
Content="浏览器:"&HTMLEncode(Request.Servervariables("HTTP_User_AGENT"))&"<br />IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br />系统描述:"&Message&"<br />提交方式:"&Request.ServerVariables("Request_method")&"<br />提交内容:?"&HTMLEncode(Request.ServerVariables("Query_String"))&"<br />提交来源:"&HTMLEncode(Request.ServerVariables("HTTP_REFERER"))&"<br />表单数据:"&HTMLEncode(Request.Form)
Conn.Execute("insert into [WxLog] (UserName,Content,DateCreated) values ('"&CookieUserName&"','"&Content&"','"&Now()&"')")
end sub

sub BBSList(selec)
Set Rsx=Conn.Execute("select ID,ForumName from [WxForums] where ParentID="&selec&" order by SortNum")
Do While Not Rsx.Eof
ForumsList=ForumsList&"<option value="&Rsx(0)&">"&string(ii," ")&""&Rsx(1)&"</option>"
ii=ii+1
BBSList Rsx(0)
ii=ii-1
rsx.MoveNext
loop
Set Rsx = Nothing
end sub

sub ShowThreads()
if Request("checkbox")=1 then
IconImage="<input type=""checkbox"" value="""&ID&""" name=""ThreadID"" />"
elseif IsLocked=1 then
IconImage="<img alt='' src=Images/f_lock.gif />"
elseif ThreadStatus=1 or Icon=11 then
IconImage="<img alt='' src=Images/brow/11.gif />"
elseif Replies=>Cache("PopularPostThresholdPosts") or Views=>Cache("PopularPostThresholdViews") then
IconImage="<img alt='' src=Images/f_hot.gif />"
elseif Replies>0 then
IconImage="<img alt='' src=Images/f_new.gif />"
else
IconImage="<img alt='' src=Images/f_norm.gif />"
end if

if Category<>"" then CategoryHtml="[<a href=Forums.asp?Fid="&ForumID&"&Category="&Category&">"&Category&"</a>] "

⌨️ 快捷键说明

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