📄 board-general.asp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="../Includes/site-dataconn.asp" -->
<!--#include file="../Includes/func-common.asp" -->
<!--#include file="../Includes/site-config.asp" -->
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>
<head>
<title>// <%=Site_Name%> //</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL=stylesheet TYPE="text/css" HREF="../Includes/Site-Style.css">
</head>
<body>
<%
'Admin Check
if session("admin") <> true then
response.redirect(Site_Forum_URL & "/default.asp")
end if
%>
<table width="100%" height="10" border="0" cellspacing="0" cellpadding="1">
<tr valign="top">
<td width="150">
<!--#include file="inc-navigation.asp" -->
</td>
<td align="center">
<%
Action = request.querystring("Action")
if Action = "Submit" then
'check that the form was submitted from here
if instr(1, request.servervariables("HTTP_REFERER"), "?", 1) > 0 then
strReferedBy = left(request.servervariables("HTTP_REFERER"), (instr(1, request.servervariables("HTTP_REFERER"), "?", 1)-1))
else
strReferedBy = request.servervariables("HTTP_REFERER")
end if
strCurrentURL = Site_Forum_URL &"/Admin/board-general.asp"
if lcase(strReferedBy) <> lcase(strCurrentURL) then
response.redirect(Site_Forum_URL & "/default.asp")
end if
'Check specific form fields have been completed
if request.form("Name") = "" then strError = "Forum Name"
if request.form("Home_URL") = "" then strError = "Home URL"
if request.form("Forum_URL") = "" then strError = "Forum URL"
if strError = "" then
strHomeURL = request.form("Home_URL")
strForumURL = request.form("Forum_URL")
'Remove final / if present
if right(strHomeURL, 1) = "/" then
strHomeURL = left(strHomeURL, (InStrRev(strHomeURL, "/") - 1))
end if
if right(strForumURL, 1) = "/" then
strForumURL = left(strForumURL, (InStrRev(strForumURL, "/") -1))
end if
'Submit new settings to the database
set rsUpdate = server.createobject("adodb.recordset")
sqlUpdate = "SELECT * FROM Forum_Config;"
rsUpdate.cursortype = 2
rsUpdate.locktype = 3
rsUpdate.open sqlUpdate, adoConn, CMDText
rsUpdate("Site_Enabled") = request.form("Site_Enabled")
rsUpdate("Site_Name") = request.form("Name")
rsUpdate("Site_Description") = request.form("Description")
rsUpdate("Site_Home_URL") = strHomeURL
rsUpdate("Site_Forum_URL") = strForumURL
rsUpdate("Site_Time_Format") = request.form("Time_Format")
rsUpdate("Site_Account_Create") = request.form("Account_Create")
rsUpdate("Site_Account_Verification") = request.form("Account_Verification")
rsUpdate("Site_Topic_Review") = request.form("Review")
rsUpdate("Site_Online_View") = request.form("Online")
rsUpdate.update
rsUpdate.close
set rsUpdate = nothing
strHeader = "Success"
strMessage = "The forum settings have been updated, click <a href='"& Site_Forum_URL &"/Admin'>here</a> to return to the Admin homepage."
else
strHeader = "Error"
strMessage = "There was an error updating the general settings you did not input a valid entry for the <b>"& strError &"</b> field. Please click <a href='"& Site_Forum_URL &"/Admin/board-general.asp'>here</a> to re-configure the forum settings."
end if
'Display Confirmation
%>
<table border="0" cellpadding="2" cellspacing="1" align="center" class="main">
<tr valign="middle" class="title">
<td align="center"><%=Site_Name%> // <%=strHeader%></td>
</tr>
<tr valign="top" class="body">
<td align="center"><%=strMessage%></td>
</tr>
</table>
<%
else
'Grab current board settings
set rsSettings = server.createobject("adodb.recordset")
sqlSettings = "SELECT Site_Enabled, Site_Name, Site_Description, Site_Home_URL, Site_Forum_URL, Site_Time_Format, Site_Account_Create, Site_Account_Verification, Site_Topic_Review, Site_Online_View FROM Forum_Config;"
rsSettings.open sqlSettings, adoConn
if not (rsSettings.eof or rsSettings.bof) then
%>
<table border="0" cellspacing="1" cellpadding="3" align="center" class="main">
<form action="board-general.asp?Action=Submit" method="post" onSubmit="this.button.disabled = true;">
<tr valign="middle" class="title">
<td align="center" colspan="2"><%=Site_Name%> // 论坛常规设置
(Enabled为开;Disabled为关)</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>论坛开关:</b>
<br>
Enable or disable the forums.
</td>
<td >
<select name="Site_Enabled" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Enabled") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Enabled") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>论坛名称:</b>
<br>
The forum name, used for page titles and logo alt text.
</td>
<td>
<input name="Name" type="text" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Name")%>" maxlength="255" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>论坛描述:</b>
<br>
The tag line for the forum, used in the header.
</td>
<td>
<input name="Description" type="text" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Description")%>" maxlength="255" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>主页地址:</b>
<br>
The URL of your website.
</td>
<td >
<input name="Home_URL" type="text" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Home_URL")%>" maxlength="100" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>论坛地址:</b>
<br>
The URL of the forums.
</td>
<td>
<input name="Forum_URL" type="text" id="Forum_URL" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Forum_URL")%>" maxlength="100" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>时间形式:</b>
<br>
Set the forums time format.</td>
<td>
<select name="Time_Format" id="Time_Format" style="width: 200px; border: 1px solid black;">
<option value="UK" <%if rsSettings("Site_Time_Format") = "UK" then response.write("Selected")%>>UK</option>
<option value="US" <%if rsSettings("Site_Time_Format") = "US" then response.write("Selected")%>>US</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>是否允许用户注册:</b>
<br>
Enable or disable the creation of new accounts.</td>
<td>
<select name="Account_Create" id="Account_Create" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Account_Create") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Account_Create") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>是否自动发E-mail:</b>
<br>
Enable or disable account verification.</td>
<td>
<select name="Account_Verification" id="Account_Verification" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Account_Verification") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Account_Verification") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>话题查看:</b>
<br>
Enable or disable the topic review when replying to topics.
</td>
<td>
<select name="Review" id="Review" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Topic_Review") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Topic_Review") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>在线童计:</b>
<br>
Enable or disable the the users online listings.
</td>
<td>
<select name="Online" id="Review" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Online_View") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Online_View") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200"> </td>
<td><input name="button" type="submit" value="Submit"></td>
</tr>
</form>
</table>
<%
rsSettings.close
set rsSettings = nothing
else
%>
<table border="0" cellspacing="1" cellpadding="2" align="center" class="main">
<tr valign="middle" class="title">
<td align="center"><%=Site_Name%> // Error</td>
</tr>
<tr valign="top" class="body">
<td align="center">Unfortunately there was an error retrieving the forum details, please try again.</td>
</tr>
</table>
<%
end if
end if
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -