📄 board-users.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-users.asp"
if lcase(strReferedBy) <> lcase(strCurrentURL) then
response.redirect(Site_Forum_URL & "/default.asp")
end if
if isnumeric(request.form("Topics")) = false then
strTopics = 50
else
if int(request.form("Topics")) <= 0 then
strTopics = 50
else
strTopics = int(request.form("Topics"))
end if
end if
if isnumeric(request.form("Posts")) = false then
strPosts = 15
else
if int(request.form("Posts")) <= 0 then
strPosts = 15
else
strPosts = int(request.form("Posts"))
end if
end if
if isnumeric(request.form("Avatar")) = false then
strAvatar = 0
else
if int(request.form("Avatar")) <= 0 then
strAvatar = 0
else
strAvatar = int(request.form("Avatar"))
end if
end if
if isnumeric(request.form("Title")) = false then
strTitle = 0
else
if int(request.form("Title")) <= 0 then
strTitle = 0
else
strTitle = int(request.form("Title"))
end if
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_Allow_Avatar") = strAvatar
rsUpdate("Site_Allow_Title") = strTitle
rsUpdate("Site_Allow_Signature") = request.form("Signature")
rsUpdate("Site_Allow_PostCount") = request.form("PostCount")
rsUpdate("Site_View_Topic") = strTopics
rsUpdate("Site_View_Posts") = strPosts
rsUpdate.update
rsUpdate.close
set rsUpdate = nothing
'Display Confirmation
%>
<table border="0" align="center" cellpadding="2" cellspacing="1" class="main">
<tr valign="middle" class="title">
<td align="center"><%=Site_Name%> // Complete</td>
</tr>
<tr valign="top" class="body">
<td align="center">The forum settings have been updated, click <a href="<%=Site_Forum_URL%>/Admin">here</a> to return to the Admin homepage.</td>
</tr>
</table>
<%
else
'display current settings
'Grab current board settings
set rsSettings = server.createobject("adodb.recordset")
sqlSettings = "SELECT Site_Allow_Avatar, Site_Allow_Title, Site_Allow_Signature, Site_Allow_PostCount, Site_View_Topic, Site_View_Posts 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-users.asp?Action=Submit" method="post" onSubmit="this.button.disabled = true;">
<tr valign="middle" class="title">
<td align="center" colspan="2"><%=Site_Name%> // User Settings</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Allow Avatars:</b>
<br>
Enter the number of posts required before users can specify their own avatar. Enter zero to disable avatars.
</td>
<td >
<input name="Avatar" type="text" id="Avatar" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Allow_Avatar")%>" maxlength="255" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Allow Title:</b>
<br>
Enter the number of posts required before users can specify their own title. Enter zero to disable titles.
</td>
<td>
<input name="Title" type="text" id="Title" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_Allow_Title")%>" maxlength="255" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Signatures Enabled:</b>
<br>
Enable or disable signatures.
</td>
<td>
<select name="Signature" id="Signature" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Allow_Signature") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Allow_Signature") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Post Counts Enabled:</b>
<br>
Enable or disable post counts.
</td>
<td>
<select name="Postcount" id="Postcount" style="width: 200px; border: 1px solid black;">
<option value="1" <%if rsSettings("Site_Allow_PostCount") = 1 then response.write("Selected")%>>Enabled</option>
<option value="0" <%if rsSettings("Site_Allow_PostCount") = 0 then response.write("Selected")%>>Disabled</option>
</select>
</td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Topic View:</b>
<br>
Enter the number of topics to be diplayed per page.
</td>
<td>
<input name="Topics" type="text" id="Topics" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_View_Topic")%>" maxlength="100" size="20"></td>
</tr>
<tr valign="top" class="body">
<td width="200">
<b>Post View:</b>
<br>
Enter the number of posts to be diplayed per page.
</td>
<td>
<input name="Posts" type="text" id="Posts" style="width: 200px; border: 1px solid black;" value="<%=rsSettings("Site_View_Posts")%>" maxlength="100" size="20"></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 later.</td>
</tr>
</table>
<%
end if
end if
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -