www.gusucode.com > 新锐领秀网络相册 1.1 > admin/config.asp
<!--#include file="../conn.asp"--> <!--#include file="../include/const.asp"--> <!--#include file="../include/fso.asp"--> <!--#include file="../include/function.asp"--> <!--#include file="admin_func.asp"--> <% CheckAdmin Dim action action = Request.QueryString("action") If action = "save" Then Call gConfigSave() Response.End() End If %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>相册</title> <link href="../images/admincp/admincp.css" rel="stylesheet" type="text/css"> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder"> <form name="form1" method="post" action="?action=save"> <tr class="header"> <td colspan="3">基本设置</td> </tr> <tr> <td width="26%">网站名称</td> <td colspan="2"> <input type="text" name="sitename" value="<%=gSiteName%>"> </td> </tr> <tr> <td width="26%">网站logo</td> <td colspan="2"> <input type="text" name="sitelogo" value="<%=gLogo%>"> </td> </tr> <tr> <td width="26%">顶部横幅</td> <td colspan="2"> <input type="text" name="sitebanner" value="<%=gBanner%>"> </td> </tr> <tr> <td>标题附加字</td> <td colspan="2"><input type="text" name="sitetitle" style="width:300px;" value="<%=gTitle%>"></td> </tr> <tr> <td>Keyword 关键字</td> <td colspan="2"><textarea name="sitecontent" rows="5" style="width:300px;"><%=gContent%></textarea></td> </tr> <tr> <td>网站备案号</td> <td colspan="2"><input type="text" name="sitebeian" value="<%=gBeian%>"></td> </tr> <tr> <td width="26%">缩略图宽</td> <td width="37%"> <input type="text" name="thumbw" value="<%=gThumbMaxWidth%>"> </td> <td width="37%" rowspan="2">缩略图宽,高即是前台显示的宽和高</td> </tr> <tr> <td width="26%">缩略图高</td> <td width="37%"> <input type="text" name="thumbh" value="<%=gThumbMaxHeight%>"> </td> </tr> <%If Not IsObjInstalled(gJpeg) Then%> <tr> <td width="26%">是否上传缩略图 <br />上传缩略图能大加快显示速度<br /><font color="#FF0000">适用不支持生成缩略图的主机空间</font></td> <td width="37%"> <%if UploadThumb = 0 then%> <input type="radio" name="uploadthumb" value="1">是 <input type="radio" name="uploadthumb" value="0" checked>否 <%else%> <input type="radio" name="uploadthumb" value="1" checked>是 <input type="radio" name="uploadthumb" value="0">否 <%end if %> </td> <td width="37%">系统检测到你的空间不支持缩略图组件,建议您开启该功能</td> </tr> <%End If%> <%If IsObjInstalled(gJpeg) Then%> <tr> <td colspan="3"> ::系统检测到您的空间支持缩略图组件(ASPJPEG),程序将按照您设定的比例自动生成缩略图. ::</td> </tr> <%End If%> <tr> <td>缩略图裁剪方式</td> <td> <%if ThumbType = 0 then%> <input type="radio" name="thumbtype" value="1">左上角裁剪 <input type="radio" name="thumbtype" value="0" checked>按比例生成(保持宽高比) <%else%> <input type="radio" name="thumbtype" value="1" checked>左上角裁剪 <input type="radio" name="thumbtype" value="0">按比例生成(保持宽高比) <%end if %> </td> <td>空间支持缩略图组件此设置才有效</td> </tr> <tr> <td width="26%">是否允许评论</td> <td width="37%"> <%if AllowComment = 0 then%> <input type="radio" name="allowcomment" value="1">是 <input type="radio" name="allowcomment" value="0" checked>否 <%else%> <input type="radio" name="allowcomment" value="1" checked>是 <input type="radio" name="allowcomment" value="0">否 <%end if %> </td> <td width="37%"> </td> </tr> <tr align="center" valign="middle"> <td colspan="3"><input type="submit" name="Submit" value="提交"></td> </tr> </form> </table> </body> </html> <% Sub gConfigSave() Dim s Dim gSiteName,gTitle,gContent,gBeian,gLogo,gBanner,Thumb,ThumbType,UploadThumb,gThumbMaxWidth,gThumbMaxHeight,gIsInstalledJPEG,AllowComment gSiteName = gCheckstr(gHtmlEncode(Request.Form("sitename"))) gTitle = gCheckstr(gHtmlEncode(Request.Form("sitetitle"))) gContent = gCheckstr(gHtmlEncode(Request.Form("sitecontent"))) gBeian = gCheckstr(gHtmlEncode(Request.Form("sitebeian"))) gLogo = gCheckstr(gHtmlEncode(Request.Form("sitelogo"))) gBanner = gCheckstr(gHtmlEncode(Request.Form("sitebanner"))) 'Thumb = gCheckstr(gHtmlEncode(Request.Form("thumb"))) ThumbType = gCheckstr(gHtmlEncode(Request.Form("thumbtype"))) gThumbMaxWidth = gCheckstr(gHtmlEncode(Request.Form("thumbw"))) gThumbMaxHeight = gCheckstr(gHtmlEncode(Request.Form("thumbh"))) UploadThumb = gCheckstr(gHtmlEncode(Request.Form("uploadthumb"))) AllowComment = gCheckstr(gHtmlEncode(Request.Form("allowcomment"))) If UploadThumb = "" Then UploadThumb = 0 gIsInstalledJPEG = IsObjInstalled(gJpeg) If gIsInstalledJPEG Then Thumb = 1 Else Thumb = 0 End If s = s & "Const IsUsePassport=0" & VBCRLF s = s & "Const IsOpenRegister = 1" & VBCRLF s = s & "Const gFSO=""Scripting.FileSystemObject""" & VBCRLF s = s & "Const gRS=""ADODB.RecordSet""" & VBCRLF s = s & "Const gRsCmd=""ADODB.Command""" & VBCRLF s = s & "Const gJpeg=""Persits.Jpeg""" & VBCRLF s = s & "Const gCookies=""Gong""" & VBCRLF s = s & "Const IsUseVCode=0" & VBCRLF s = s & "Const gLogo=""" & gLogo & """" & VBCRLF s = s & "Const gBanner=""" & gBanner & """" & VBCRLF s = s & "Const gSiteName=""" & gSiteName & """" & VBCRLF s = s & "Const gTitle=""" & gTitle & """" & VBCRLF s = s & "Const gContent=""" & gContent & """" & VBCRLF s = s & "Const gBeian=""" & gBeian & """" & VBCRLF s = s & "Const gThumbMaxWidth=" & gThumbMaxWidth & "" & VBCRLF s = s & "Const gThumbMaxHeight=" & gThumbMaxHeight & "" & VBCRLF s = s & "Const InstalledJPEG = " & gIsInstalledJPEG & "" & VBCRLF s = s & "Const Thumb = " & Thumb & "" & VBCRLF s = s & "Const ThumbType = " & ThumbType & "" & VBCRLF s = s & "Const UploadThumb = " & UploadThumb & "" & VBCRLF s = s & "Const AllowComment = " & AllowComment & "" & VBCRLF 's = s & chr(37) & chr(62) & VBCRLF Dim css,falg css = gLoadFile(server.mappath("../tpl/css.htm")) css = Replace(css,"{containerWidth}",gThumbMaxWidth+4) css = Replace(css,"{containerHeight}",gThumbMaxWidth+28) css = Replace(css,"{thumbMaxWidth}",gThumbMaxWidth) css = Replace(css,"{thumbMaxHeight}",gThumbMaxWidth) flag = gCreatetFile(server.MapPath("../css/style.css"),css) Call gCreateConstFile(chr(60) & chr(37) & s & chr(37) & chr(62)) End Sub Sub gCreateConstFile(Content) Dim falg flag = gCreatetFile(server.MapPath("../include/const.asp"),Content) %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta http-equiv="refresh" content="2;url=config.asp"> <title>相册</title> <link href="../images/admincp/admincp.css" rel="stylesheet" type="text/css"> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder"> <tr class="header"> <td>提示信息</td> </tr> <tr> <td align="center"><br /><br /><a href="config.asp">您的修改已保存,如果页面没有自动跳转,请点击这里.</a><br /><br /></td> </tr> </table> </html> <% End Sub Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If Err = 0 Then IsObjInstalled = True If Err = -2147352567 Then IsObjInstalled = True Set xTestObj = Nothing Err = 0 End Function %>