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

📄 admin_upload_configure.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 3 页
字号:
	End With
	
	
	
	
	
	
	
	'Empty the application level variable so that the changes made are seen in the main forum
	Application.Lock
	Application(strAppPrefix & "blnConfigurationSet") = false
	Application.UnLock	
	
End If


'Read in the deatils from the database
If NOT rsCommon.EOF Then

	'Read in the e-mail setup from the database
	strUploadComponent = rsCommon("Upload_component")
	strImageTypes = rsCommon("Upload_img_types")
	intMaxImageSize	= CInt(rsCommon("Upload_img_size"))
	strFileTypes = rsCommon("Upload_files_type")
	intMaxFileSize	= CInt(rsCommon("Upload_files_size"))
	strAvatarTypes = rsCommon("Upload_avatar_types")
	intMaxAvatarSize = CInt(rsCommon("Upload_avatar_size"))
	blnAvatarEnabled = CBool(rsCommon("Upload_avatar"))
	If isNull(rsCommon("Upload_allocation")) Then intAllocatedSpace = 1 Else intAllocatedSpace = CInt(rsCommon("Upload_allocation"))
End If


'Close db
rsCommon.Close



'Initalise the strSQL variable with an SQL statement to query the database
'WHERE cluse added to get round bug in myODBC which won't run an ADO update unless you have a WHERE cluase
strSQL = "SELECT " & strDbTable & "Group.* " & _
"FROM " & strDbTable & "Group " & _
"WHERE " & strDbTable & "Group.Group_ID > 0 " & _
"ORDER BY " & strDbTable & "Group.Group_ID ASC;"
	
'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
rsCommon.CursorType = 2

'Set the Lock Type for the records so that the record set is only locked when it is updated
rsCommon.LockType = 3

'Query the database
rsCommon.Open strSQL, adoCon




'Update the db with file and image upload for groups
If Request.Form("postBack") AND blnBadFileType = false Then
	
	'Loop through cats
	Do While NOT rsCommon.EOF
	
		'Update the recordset
		rsCommon.Fields("Image_uploads") = CBool(Request.Form("imageGroup" & rsCommon("Group_ID")))
		rsCommon.Fields("File_uploads") = CBool(Request.Form("fileGroup" & rsCommon("Group_ID")))

		'Update the database
		rsCommon.Update
   
		'Move to next record in rs
		rsCommon.MoveNext
	Loop
	
	
	'Re-run the query to read in the updated recordset from the database
	'.Requery
End If




%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<title>Upload Settings</title>
<meta name="generator" content="Web Wiz Forums" />

<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->" & vbCrLf)
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<script  language="JavaScript" type="text/javascript">

//Function to check form is filled in correctly before submitting
function CheckForm () {


	//Check for a image types name
	if (document.frmUpload.imageTypes.value==""){
		alert("Please enter Image file types to upload");
		document.frmUpload.imageTypes.focus();
		return false;
	}

	//Check for a file types name
	if (document.frmUpload.fileTypes.value==""){
		alert("Please enter File types to upload");
		document.frmUpload.fileTypes.focus();
		return false;
	}

	//Check for a file to image upload folder
	if (document.frmUpload.filePath.value==""){
		alert("Please enter the Path to upload files to");
		document.frmUpload.filePath.focus();
		return false;
	}
	
	//Check for a avatar types name
	if (document.frmUpload.avatarTypes.value==""){
		alert("Please enter Avatar types to upload");
		document.frmUpload.avatarTypes.focus();
		return false;
	}

	return true
}<%

'If error display message
If blnBadFileType Then
	
	Response.Write(vbCrLf & "alert('For security reasons the following file type\(s\) are not permited.\n\n" & strBadFileTypeName & "')")	
End If

%>	
</script>
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
	font-size: 16px;
}
-->
</style>
<!-- #include file="includes/admin_header_inc.asp" -->
<div align="center">
 <h1>Upload Settings</h1>
 <br />
  <a href="admin_menu.asp<% = strQsSID1 %>">Control Panel Menu</a><br />
  <br />
  <table border="0" cellpadding="4" cellspacing="1" class="tableBorder">
    <tr>
      <td align="center" class="tableLedger">Important - Please Read First!</td>
    </tr>
    <tr class="tableRow" align="left">
      <td>To be able to use file and image upload in your forums, you must have an upload component installed on the web server, if you are unsure about this check with your 
          web hosts, if they have any of the upload components mentioned below installed.<br />
          <br />
          If you run the web server yourself then you could download and install one of the following supported components.<br />
          <br />
          You will also need to make sure that the upload folder and it's subfolders have read, write and modify permissions for the Internet User Account (IUSR_&lt;MachineName&gt;) and is inside the root of your forum.
          <ul>
          <li class="text"><span>Persits AspUpload</span> 2.x or above<br />
            Component available form <a href="http://www.aspupload.com" target="_blank">www.aspupload.com</a></li>
          <li class="text"><span>Dundas Upload</span> 2.0<br />
            Free component available from <a href="http://aspalliance.com/dundas/default.aspx" target="_blank">aspalliance.com/dundas</a></li>
          <li class="text"><span>SoftArtisans FileUp</span> 3.2 or above (<span>SA FileUp</span>)<br />
            Component available form <a href="http://www.softartisans.com" target="_blank">www.softartisans.com</a></li>
          <li class="text"><span>aspSmartUpload</span><br />
            Free component available from <a href="http://www.aspsmart.com/" target="_blank">www.aspsmart.com</a></li>
          <li class="text"><span>AspSimpleUpload</span><br />
            Free component available from <a href="http://www.asphelp.com/" target="_blank">www.asphelp.com</a></li>
        </ul>
       <p class="text"><span>Please note</span>: - The ASP<span> File System Object</span> (FSO) is also required when using upload features, check with your web hosting company that 
          they have not disabled this object.<br />
          <br />
          <span class="style1">Security Warning</span> <strong>- Best Practice </strong><br />
         Allowing users to upload their own files and images requires that write and modify permissions are enabled on the upload directory for the Internet User Account (IUSR). The best practice for this is to ONLY allow write and modify permissions on the upload directory and 'read only' permissions for the rest of your web site. In the event that your site comes under attack from a hacker who manages to gain control  through the IUSR account, this measure prevents the hacker from destroying or defacing the rest of your web site. </td>
    </tr>
  </table>
</div>
<br />
<form action="admin_upload_configure.asp<% = strQsSID1 %>" method="post" name="frmUpload" id="frmUpload" onsubmit="return CheckForm();">
  <table width="100%" height="182" border="0" align="center" cellpadding="4" cellspacing="1" class="tableBorder">
    <tr align="left">
      <td height="30" colspan="2" class="tableLedger">General Upload Setup </td>
    </tr>
    <tr>
      <td align="left" class="tableRow">Upload Component to use:<br />
        <span class="smText">Check with your web hosting company which component, if any they support. Free web hosts usually 
      won't support any.</span></td>
      <td valign="top" class="tableRow"><select name="component"<% If blnDemoMode Then Response.Write(" disabled=""disabled""") %>>
          <option value="AspUpload"<% If strUploadComponent = "AspUpload" Then Response.Write(" selected") %>>Persits AspUpload</option>
          <option value="Dundas"<% If strUploadComponent = "Dundas" Then Response.Write(" selected") %>>Dundas Upload</option>
          <option value="fileUp"<% If strUploadComponent = "fileUp" Then Response.Write(" selected") %>>SA FileUp</option>
          <option value="aspSmart"<% If strUploadComponent = "aspSmart" Then Response.Write(" selected") %>>aspSmartUpload</option>
          <option value="AspSimple"<% If strUploadComponent = "AspSimple" Then Response.Write(" selected") %>>AspSimpleUpload</option>
      </select></td>
    </tr>
    <tr>
      <td width="59%" align="left" class="tableRow">Allocated Upload Space:<br />
      <span class="smText">This is the amount of space allocated to each of your members on the server for uploading files and images to.</span></td>
      <td width="41%" valign="top" class="tableRow"><select name="allocatedSpace" id="allocatedSpace"<% If blnDemoMode Then Response.Write(" disabled=""disabled""") %>>
       <option<% If intAllocatedSpace = 1 Then Response.Write(" selected") %>>1</option>
       <option<% If intAllocatedSpace = 2 Then Response.Write(" selected") %>>2</option>
       <option<% If intAllocatedSpace = 3 Then Response.Write(" selected") %>>3</option>
       <option<% If intAllocatedSpace = 4 Then Response.Write(" selected") %>>4</option>			
       <option<% If intAllocatedSpace = 5 Then Response.Write(" selected") %>>5</option>
       <option<% If intAllocatedSpace = 10 Then Response.Write(" selected") %>>10</option>
       <option<% If intAllocatedSpace = 15 Then Response.Write(" selected") %>>15</option>
       <option<% If intAllocatedSpace = 20 Then Response.Write(" selected") %>>20</option>
       <option<% If intAllocatedSpace = 25 Then Response.Write(" selected") %>>25</option>
       <option<% If intAllocatedSpace = 30 Then Response.Write(" selected") %>>30</option>
       <option<% If intAllocatedSpace = 35 Then Response.Write(" selected") %>>35</option>
       <option<% If intAllocatedSpace = 40 Then Response.Write(" selected") %>>40</option>
       <option<% If intAllocatedSpace = 45 Then Response.Write(" selected") %>>45</option>
       <option<% If intAllocatedSpace = 50 Then Response.Write(" selected") %>>50</option>
       <option<% If intAllocatedSpace = 55 Then Response.Write(" selected") %>>55</option>

⌨️ 快捷键说明

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