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

📄 admin_function.asp

📁 网站代码
💻 ASP
字号:
<%
  Response.Expires = -1  
  Response.ExpiresAbsolute = Now() - 1  
  Response.cachecontrol = "no-cache"  
%>
<script language="javascript">
<!--  
  if (window == top)top.location.href = "admin.asp"; 
// -->
</script>

<script language="Javascript">
//弹出上存窗口
function killErrors() {
  return true;
}
   window.onerror = killErrors;

function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',left=450,top=300,resizable=1,scrollbars=no,menubar=no,status=no' );
}
function openem()
{ 
openScript('upload.asp',300,100); 
}
function preview(){
window.open(document.form.pic.value)
}
// 当上传图片等文件时,往下拉框中填入图片路径,可根据实际需要更改此函数
	function doChange(objText, objDrop){
		if (!objDrop) return;
		var str = objText.value;
		var arr = str.split("|");
		var nIndex = objDrop.selectedIndex;
		objDrop.length=1;
		for (var i=0; i<arr.length; i++){
			objDrop.options[objDrop.length] = new Option(arr[i], arr[i]);
		}
		objDrop.selectedIndex = nIndex;
	}

//Other NoPic
function pic(smileface)
{
	document.form.pic.value=smileface;
}
</Script>
<%
'常用函数页
'一些信息的过虑--------------------
function strFilter(str)
		str=Replace(str,"'","''")
		str=replace(str,"|","/")
        str=Replace(str,"' ","'")
		strFilter=str
end function
'管理后台头部----------------------
function header(popedomnum,titmenu)
header = VbCrLf & "<html><head><title>Power_Wenday_Sys - "&web_title&"</title>" & _
	   VbCrLf & "<meta http-equiv=Content-Type content=text/html; charset=gb2312>" & _
	   VbCrLf & "<link rel=stylesheet href='img/admin.css' type=text/css>" & _
	   VbCrLf & "</head>" & VbCrLf & "<body topmargin=0 leftmargin=0><center>" & _
	   VbCrLf & "<table border=0 width=95% cellspacing=0 cellpadding=0>" & _
	   vbcrlf & "<tr><td height=30 align=center>"&titmenu&"&nbsp;┋&nbsp;<a href='javascript:;' onclick=""javascript:document.location.reload()"">刷新</a></td></tr></table><br>"
end function
dim ender:ender="<table><tr><td><hr size=1 width=550></td></tr><tr><td height=30 align=center>Copyright &copy; 2003-2004 <a href=http://www.w"&"en"&"day."&"C"&"om/ target=_blank><b><font face=Arial color=#CC3300>W"&"en"&"day</font><font face=Arial>.Com</font></b></a> All Rights Reserved</td></tr></table>"

function code_html(strers,chtype,cutenum)
  dim strer:strer=strers
  if isnull(strer) or strer="" then code_html="":exit function
  strer=health_var(strer,1)
  if cutenum>0 then strer=cuted(strer,cutenum)
  strer=replace(strer,"<","&lt;")
  strer=replace(strer,">","&gt;")
  strer=replace(strer,chr(39),"&#39;")		'单引号
  strer=replace(strer,chr(34),"&quot;")		'双引号
  strer=replace(strer,chr(32),"&nbsp;")		'空格
  select case chtype
  case 1
    strer=replace(strer,chr(9),"&nbsp;")	'table
    strer=replace(strer,chr(10),"")		'回车
    strer=replace(strer,chr(13),"")
  case 2
    strer=replace(strer,chr(9),"&nbsp; &nbsp;")'table
    strer=replace(strer,chr(10),"<br>")		'回车
    strer=replace(strer,chr(13),"<br>")
  end select
  code_html=strer
end function



function health_var(hnn,vt)
  dim ti,tj,tdim,ht,hn:hn=hnn
  if vt=1 then
    tdim=split(web_Badwords,"|")
    for ti=0 to ubound(tdim)
      ht=""
      for tj=1 to len(tdim(ti))
        ht=ht&"*"
      next
      hn=replace(hn,tdim(ti),ht)
    next
    erase tdim
  end if
  health_var=hn
end function

function code_admin(strers)
  dim strer:strer=trim(strers)
  if isnull(strer) or strer="" then code_admin="":exit function
  strer=replace(strer,"'","""")
  code_admin=strer
end function

'判断发言是否来自外部--------------
function post_chk()
  dim server_v1,server_v2
  post_chk="no"
  server_v1=Request.ServerVariables("HTTP_REFERER")
  server_v2=Request.ServerVariables("SERVER_NAME")
  if mid(server_v1,8,len(server_v2))=server_v2 then post_chk="yes":exit function
end function

'函数名:IsObjInstalled
'作  用:检查组件是否已经安装
'参  数:strClassString ----组件名
'返回值:True  ----已经安装
'        False ----没有安装
Function IsObjInstalled(strClassString)
	On Error Resume Next
	IsObjInstalled = False
	Err = 0
	Dim xTestObj
	Set xTestObj = Server.CreateObject(strClassString)
	If 0 = Err Then IsObjInstalled = True
	Set xTestObj = Nothing
	Err = 0
End Function

'函数名:JoinChar
'作  用:向地址中加入 ? 或 &
'参  数:strUrl  ----网址
'返回值:加了 ? 或 & 的网址

function JoinChar(strUrl)
	if strUrl="" then
		JoinChar=""
		exit function
	end if
	if InStr(strUrl,"?")<len(strUrl) then 
		if InStr(strUrl,"?")>1 then
			if InStr(strUrl,"&")<len(strUrl) then 
				JoinChar=strUrl & "&"
			else
				JoinChar=strUrl
			end if
		else
			JoinChar=strUrl & "?"
		end if
	else
		JoinChar=strUrl
	end if
end function

%>

⌨️ 快捷键说明

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