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

📄 style.asp

📁 BBS论坛的开发和设计
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#Include file = "BBSConfig.asp"-->
<!--#include file="Session.asp"-->
<!--#include file = "function.asp"-->
<!--#include file="../INC/FSO.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>风格管理</title>
<link href="Style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<br>
<%
'---------------------------------------
if not testObj("Scripting.FileSystemObject") then
	testFso = false
else
	testFso = true
End if
action = trim(request.QueryString("action"))
SELECT Case action
	Case "add"
		Call add()
	Case "SaveNew"
		Call SaveNew()
	Case "SaveEdit"
		Call SaveEdit()
	Case "Edit"
		Call Edit()
	Case "Del"
		Call Del()
	Case else
		Call list()
End SELECT
'============================
Sub SaveNew()
	styleid = replace(trim(request.Form("styleid")),"'","")
		if Not(IsNumeric(styleid)) then ErrorMsg "参数错误"
	stylename = replace(trim(request.Form("stylename")),"'","")
		if stylename = "" then ErrorMsg "风格名称不可为空!~"
	CssStr = replace(trim(request.Form("CssStr")),"'","")
	img_path = trim(request.Form("img_path"))
		if not IsNumeric(img_path) then img_path = 0
	Menu_top = trim(request.form("Menu_top"))
		if not IsNumeric(Menu_top) then Menu_top = 0
	TopString = replace(trim(request.Form("TopString")),"'","''")
	table_Top = replace(trim(request.Form("table_Top")),"'","''")
	table_Bottom = replace(trim(request.Form("table_Bottom")),"'","''")
	BottomString = replace(trim(request.Form("BottomString")),"'","''")
	Copyright_Bottom = trim(request.form("Copyright_Bottom"))
		if not IsNumeric(Copyright_Bottom) then Copyright_Bottom = 0
	conn.ExeCute("insert into JBB_style(styleid,stylename,img_path,Menu_top,TopString,table_Top,table_Bottom,BottomString,Copyright_Bottom) values("&styleid&",'"&stylename&"',"&img_path&","&Menu_top&",'"&TopString&"','"&table_Top&"','"&table_Bottom&"','"&BottomString&"',"&Copyright_Bottom&")")
	response.write " 新风格<b> "&stylename&" </b>添加成功<br>"
	if testFso = true then
		call FileSub("../Skin/"&styleid&"/Style.Css",CssStr)
	else
		response.write " <font color=red>由于您的服务器不支持Fso,Css文件未能生成,请上传您的style.css文件到:</font><font color=blue>论坛目录/Skin/"&styleid&"/</font>"
	End if
End Sub
'============================
Sub SaveEdit()
		styleid = replace(trim(request.Form("styleid")),"'","")
		if Not(IsNumeric(styleid)) then ErrorMsg "参数错误"
	stylename = replace(trim(request.Form("stylename")),"'","")
		if stylename = "" then ErrorMsg "风格名称不可为空!~"
	CssStr = replace(trim(request.Form("CssStr")),"'","")
	img_path = trim(request.Form("img_path"))
		if not IsNumeric(img_path) then img_path = 0
	Menu_top = trim(request.form("Menu_top"))
		if not IsNumeric(Menu_top) then Menu_top = 0
	TopString = replace(trim(request.Form("TopString")),"'","''")
	table_Top = replace(trim(request.Form("table_Top")),"'","''")
	table_Bottom = replace(trim(request.Form("table_Bottom")),"'","''")
	BottomString = replace(trim(request.Form("BottomString")),"'","''")
	Copyright_Bottom = trim(request.form("Copyright_Bottom"))
		if not IsNumeric(Copyright_Bottom) then Copyright_Bottom = 0
	conn.ExeCute("update JBB_style set stylename='"&stylename&"',img_path="&img_path&",Menu_top="&Menu_top&",TopString='"&TopString&"',table_Top='"&table_Top&"',table_Bottom='"&table_Bottom&"',BottomString='"&BottomString&"',Copyright_Bottom="&Copyright_Bottom&" where styleid="&styleid)
	response.write " 风格<b> "&stylename&" </b>修改成功"
	if styleid=1 then styleid="Default"
	Application.Lock
		Application(JBBMasterCookies&"BBS_Skin_"&Styleid)=""
	Application.UnLock	
	if testFso = true then
		call FileSub("../Skin/"&styleid&"/Style.Css",CssStr)
	else
		response.write " <font color=red>由于您的服务器不支持Fso,Css文件未能重新生成,请上传您的style.css文件到:</font><font color=blue>论坛目录/Skin/"&styleid&"/</font>"
	End if
End Sub
'============================
Sub Del()
	styleid = trim(request.QueryString("styleid"))
		if Not(IsNumeric(newsid)) then ErrorMsg "参数错误!~"
	if trim(request.Form("Submit")) = "确定删除" then
		Conn.ExeCute("Delete From JBB_style where styleID="&styleid &" and styleid <>1")
		Application.Lock
			Application(JBBMasterCookies&"BBS_Skin_"&Styleid)=""
		Application.UnLock
		response.Write("<br><br>  删除完毕!~")
	else
%>
<br>
<table width="340" height="47" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  <form name="form2" method="post" action="?action=Del&styleid=<%=styleid%>">
    <tr> 
      <td bgcolor="#EFEFE7">
<div align="center"><strong>确认删除</strong></div></td>
    </tr>
    <tr> 
      <td height="50" bgcolor="#FFFFFF">
<div align="center"><font color="#FF0000">您确定删除此风格吗?</font></div></td>
    </tr>
    <tr> 
      <td bgcolor="#EFEFE7">
<div align="center"> 
          <input name="Submit" type="submit" class="form1" id="Submit" value="确定删除">
            
          <input name="Submit6" type="button" class="form1" onClick="MM_callJS('history.back()')" value="返回">
        </div></td>
    </tr>
  </form>
</table>
<%
	End if
End Sub
'============================
Sub add()
	set rs = Conn.ExeCute("select max(styleid) from JBB_style")
	styleid = rs(0)+1
	set rs = nothing	
%>
<form name="form1" method="post" action="?action=SaveNew">
  <table width="580" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
    <tr bgcolor="#EFEFE7"> 
      <td colspan="2"><strong>添加风格样式</strong></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="188">风格名称</td>
      <td width="388"> <input name="StyleName" type="text" id="StyleName"> <input name="styleid" type="hidden" id="styleid" value="<%=styleid%>"> 
      </td>
    </tr>
    <tr bgcolor="#F5F5F5"> 
      <td valign="top">是否使用自定义图片?<br>
        选择否使用论坛默认风格图片<br> </td>
      <td valign="top"> <input type="radio" name="img_path" value="1">
        是&nbsp;&nbsp; <input name="img_path" type="radio" value="0" checked>
        否<br>
        选择是请将自定义图片上传到:<font color="#FF0000">论坛目录/Skin/<%=styleid%>/img/</font>,中</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td valign="top">CSS文件格式<br>
        书写参考:<br> <font color="#FF0000">.table</font>'主体表格<br> <font color="#FF0000">.table-title</font>'标题表格<br> 
        <font color="#FF0000">.table-light</font>'深色表格<br> <font color="#FF0000">.table-dark</font>' 
        浅色表格<br> <font color="#FF0000">.table-noColor</font>'没颜色的表格<br>
        <font color="#FF0000">.Menu-table</font>'菜单表格<br>
        <font color="#FF0000">.path-table</font>'页面路径<br> </td>
      <td valign="top"> <%	
		if testFso <> true then
			response.write "<br><br>&nbsp;&nbsp;您的空间不支持FSO,请手动建立/编辑<font color=""#FF0000"">论坛目录/Skin/"&styleid&"/</font>下的<font color=""#FF0000"">style.css</font>文件"
		else
			'-------------------------
			set fso = Server.Createobject("Scripting.FileSystemObject")
			path = server.MapPath("../Skin/Default/style.css")
			'打开文件
			set file = fso.opentextfile(path, 1,true)
			If Not File.AtEndOfStream Then
       			CssStr= CssStr&file.ReadAll
			End If
			file.close
			set file = nothing
			set fso = nothing
			FolderSub("../Skin/"&styleid)
			FolderSub("../Skin/"&styleid&"/img")
			'response.write CssStr
			response.write"以下为默认风格的Css文件,您需要对其修改<br>"
		%> <textarea name="CssStr" cols="52" rows="18" id="textarea3"><%=server.htmlEncode(CssStr)%></textarea> 
        <%
		End if
		%> </td>
    </tr>
    <tr bgcolor="#F5F5F5"> 
      <td valign="top">页面头部内容(支持html代码)<br>
        此处内容显示在页面顶部</td>
      <td valign="top"> <textarea name="TopString" cols="52" rows="12" id="textarea"></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td valign="top">论坛菜单显示在页面头部上方?<br>
        选择否则菜单显示在页面头部内容下方 </td>
      <td valign="top"><input type="radio" name="Menu_top" value="1">
        是&nbsp;&nbsp; <input name="Menu_top" type="radio" value="0" checked>
        否</td>
    </tr>
    <tr bgcolor="#F5F5F5"> 
      <td valign="top">表格头部内容(支持html代码)<br>
        此处表格指文章列表和论坛首页版块列表表格</td>
      <td valign="top"> <textarea name="table_Top" cols="52" rows="6" id="table_Top"></textarea></td>
    </tr>

⌨️ 快捷键说明

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