📄 yns_setup.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn_news.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="3"
MM_authFailedURL="default.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
'请尊重作者劳动成果不要删除以上信息
'业一新闻系统3.0正式版
'主页:http://yeyi.net
'论坛:http://bbs.yeyi.net
'业一网络 承接各种网站制作
'程序开发 软件开发业务
'业务联系
'电话: 13007310512
'联系人:郝亚平
'QQ:24344842 (只谈业务,技术问题请访问论坛)
'请尊重作者劳动成果不要删除以上信息
%>
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_conn_news_STRING
MM_editTable = "t_setup"
MM_editColumn = "st_id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "yns_ok.htm"
MM_fieldsStr = "st_title|value|st_url|value|st_logo|value|st_banner|value|st_copyright|value|st_cnum|value|st_ccnu|value|st_cnnu|value|st_lnum|value"
MM_columnsStr = "st_title|',none,''|st_url|',none,''|st_logo|',none,''|st_banner|',none,''|st_copyright|',none,''|st_cnum|none,none,NULL|st_ccnu|none,none,NULL|st_cnnu|none,none,NULL|st_lnum|none,none,NULL"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim rssetup
Dim rssetup_numRows
Set rssetup = Server.CreateObject("ADODB.Recordset")
rssetup.ActiveConnection = MM_conn_news_STRING
rssetup.Source = "SELECT * FROM t_setup"
rssetup.CursorType = 0
rssetup.CursorLocation = 2
rssetup.LockType = 1
rssetup.Open()
rssetup_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>业一新闻系统3.0正式版-------业一网络Yeyi.net制作</title>
<link href="style/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">
<td height="3" colspan="2" align="right" nowrap></td>
</tr>
<tr>
<td height="7" colspan="2" align="right" nowrap class="bg"></td>
</tr>
<tr>
<td height="30" colspan="2" align="center" nowrap><div align="center"><font color="#FF0000">请管理人员务必善自改动,本后台程序是用易63网络公司技术<br>
部门开发,如果有技术上的问题请直接跟本公式技术部门连心</font><br>
<br>
</div></td>
</tr>
<tr>
<td width="26%" height="30" align="center" nowrap>网站标题:</td>
<td width="70%" height="30"> <input type="text" name="st_title" value="<%=(rssetup.Fields.Item("st_title").Value)%>" size="32">
</td>
</tr>
<tr class="bg">
<td width="26%" height="30" align="center" nowrap>网站地址:</td>
<td height="30"> <input type="text" name="st_url" value="<%=(rssetup.Fields.Item("st_url").Value)%>" size="32">
</td>
</tr>
<tr>
<td width="26%" height="30" align="center" nowrap>网站Logo:</td>
<td height="30"> <input type="text" name="st_logo" value="<%=(rssetup.Fields.Item("st_logo").Value)%>" size="40">
</td>
</tr>
<tr class="bg">
<td width="26%" height="30" align="center" nowrap>网站Banner:</td>
<td height="30"> <input type="text" name="st_banner" value="<%=(rssetup.Fields.Item("st_banner").Value)%>" size="40">
</td>
</tr>
<tr>
<td width="26%" height="30" align="center" nowrap>版权所有:</td>
<td height="30"> <input type="text" name="st_copyright" value="<%=(rssetup.Fields.Item("st_copyright").Value)%>" size="40">
</td>
</tr>
<tr class="bg">
<td width="26%" height="30" align="center" nowrap><font color="#FF0000">大类新闻</font>每页显示数:</td>
<td height="30"> <input type="text" name="st_cnum" value="<%=(rssetup.Fields.Item("st_cnum").Value)%>" size="5">
</td>
</tr>
<tr>
<td width="26%" height="30" align="center" nowrap><font color="#FF0000">推荐新闻</font>每页显示数:</td>
<td height="30"><input name="st_ccnu" type="text" id="st_ccnu" value="<%=(rssetup.Fields.Item("st_ccnu").Value)%>" size="5">
</td>
</tr>
<tr class="bg">
<td height="30" align="center" nowrap><font color="#FF0000">搜索结果</font>每页显示数:</td>
<td height="30"><input name="st_cnnu" type="text" id="st_cnnu" value="<%=(rssetup.Fields.Item("st_cnnu").Value)%>" size="5"></td>
</tr>
<tr>
<td height="30" align="center" nowrap><font color="#FF0000">后台</font>每页显示数:</td>
<td height="30"><input type="text" name="st_lnum" value="<%=(rssetup.Fields.Item("st_lnum").Value)%>" size="5"></td>
</tr>
<tr>
<td width="26%" height="30" align="center" nowrap> </td>
<td height="30"> <input type="submit" value="系统设置"> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= rssetup.Fields.Item("st_id").Value %>">
</form>
<p> </p>
</body>
</html>
<%
rssetup.Close()
Set rssetup = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -