论坛模版导出功能 | 论坛模版导入功能
<% dim admin_flag admin_flag="44" if not master or instr(session("flag"),admin_flag)=0 then Errmsg=Errmsg+"
"+"
  • 本页面为管理员专用,请登陆后进入。
  • 您没有管理本页面的权限。" call dvbbs_error() else if request("action")="inputskin" then call inputskin() elseif request("action")="loadskin" then call loadskin() elseif request("action")="load" then call load() elseif request("action")="rename" then call rename() elseif request("action")="savenm" then call savenm() else CALL MAIN() end if end if %>
  • 论坛模版导出功能 | 论坛模版导入功能
    <%SUB MAIN() dim sname,act,mdbname,tconn if request("action")="loadthis" then sname="导入" act="loadskin" mdbname=Checkstr(trim(request.form("skinmdb"))) if mdbname="" then ErrMsg=ErrMsg+"
    "+"
  • 请填写导出模版保存的表名" response.write Errmsg exit sub end if else sname="导出" act="inputskin" end if %> <% if act="loadskin" then Set tconn = Server.CreateObject("ADODB.Connection") tconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdbname) set rs=tconn.execute(" select id,Forum_Body,SkinName,active from dvskin order by id ") else set rs=conn.execute(" select id,Forum_Body,SkinName,active from config order by id ") end if do while not rs.eof response.write "" %> <% rs.movenext loop rs.close set rs=nothing %>
    <%=sname%>论坛模版列表
    序号 模版名称 操作 选择
    <%=rs("id")%> <%=rs("SkinName")%> &mdbname=<%=mdbname%>" >改名

    ">">

    <%=sname%>的数据库: 全选
    注意
    1,确认模版数据库名正确;
    2,如模版数据库放在skin目录下,即填写:skin/skin.mdb;
    3,模版数据库内备份的表名为DVSKIN,请不要更改;
    4,模版数据包括论坛CSS设置,与及所有论坛图片设置.
    <% END SUB sub inputskin() dim skid,mdbname,TCONN skid=checkstr(request("skid")) mdbname=Checkstr(trim(request.form("skinmdb"))) if skid="" or isnull(skid) then ErrMsg=ErrMsg+"
    "+"
  • 您还未选取要导出的模版" response.write Errmsg exit sub end if if mdbname="" then ErrMsg=ErrMsg+"
    "+"
  • 请请填写导出模版数据库名" response.write Errmsg exit sub end if response.write "模版ID:"&skid if request("submit")="删除" then set rs=conn.execute("select skinname from config where active=1 and id in ("&skid&")") if rs.eof and rs.bof then conn.execute("delete from config where id in ("&skid&")") response.write "
    删除成功。" else response.write "
    错误提示:当前使用的论坛模板不能删除,请先设置该模板为不是当前模板状态。" end if rs.close set rs=nothing else Set tconn = Server.CreateObject("ADODB.Connection") tconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdbname) dim trs,nrs set rs=conn.execute(" select Forum_Body,SkinName,Forum_pic,Forum_boardpic,Forum_TopicPic,Forum_statePic,Forum_ubb,Forum_userface,Forum_PostFace,Forum_emot from config where id in ("&skid&") order by id ") do while not rs.eof tconn.execute("insert into dvskin (Forum_Body,SkinName,Forum_pic,Forum_boardpic,Forum_TopicPic,Forum_statePic,Forum_ubb,Forum_userface,Forum_PostFace,Forum_emot) values ('"&rs("Forum_Body")&"','"&rs("SkinName")&"','"&rs("Forum_pic")&"','"&rs("Forum_boardpic")&"','"&rs("Forum_TopicPic")&"','"&rs("Forum_statePic")&"','"&rs("Forum_ubb")&"','"&rs("Forum_userface")&"','"&rs("Forum_PostFace")&"','"&rs("Forum_emot")&"')") rs.movenext loop rs.close set rs=nothing if err.number<>0 then ErrMsg=ErrMsg+"
    "+"
  • 数据库操作失败,请以后再试,"&err.Description err.clear response.write Errmsg exit sub else response.write "数据导出成功!
    " end if end if end sub sub load() %>

    导入模版数据

    导入模版数据库名:

    <% end sub sub loadskin() dim skid,mdbname,TCONN skid=checkstr(request("skid")) mdbname=Checkstr(trim(request.form("skinmdb"))) if skid="" or isnull(skid) then ErrMsg=ErrMsg+"
    "+"
  • 您还未选取要导入的模版" response.write Errmsg exit sub end if if mdbname="" then ErrMsg=ErrMsg+"
    "+"
  • 请填写导入模版数据库名" response.write Errmsg exit sub end if response.write "模版ID:"&skid dim trs,ars Set tconn = Server.CreateObject("ADODB.Connection") tconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdbname) if request("submit")="删除" then tconn.execute("delete from dvskin where id in ("&skid&")") response.write "删除成功。" else set trs=tconn.execute(" select * from dvskin where id in ("&skid&") order by id ") do while not trs.eof set Ars=conn.execute("select * from config where active=1") set rs = server.CreateObject ("adodb.recordset") sql="select * from config" rs.open sql,conn,1,3 rs.addnew '==========================导入的数据开始======================= rs("skinname")=trs("skinname") rs("Forum_body")=trs("Forum_body") rs("Forum_pic")=trs("Forum_pic") rs("Forum_boardpic")=trs("Forum_boardpic") rs("Forum_TopicPic")=trs("Forum_TopicPic") rs("Forum_statePic")=trs("Forum_statePic") rs("Forum_ubb")=trs("Forum_ubb") rs("Forum_userface")=trs("Forum_userface") rs("Forum_PostFace")=trs("Forum_PostFace") rs("Forum_emot")=trs("Forum_emot") '==========================导入的数据结束======================= rs("Forum_info")=ars("Forum_info") rs("Forum_copyright")=ars("Forum_copyright") rs("Forum_Setting")=ars("Forum_Setting") rs("StopReadme")=ars("StopReadme") rs("Forum_upload")=ars("Forum_upload") rs("Forum_ads")=ars("Forum_ads") rs("Forum_user")=ars("Forum_user") rs("badwords")=ars("badwords") rs("splitwords")=ars("splitwords") rs("birthuser")=ars("birthuser") rs("Maxonline")=ars("Maxonline") rs("MaxonlineDate")=ars("MaxonlineDate") rs("LastPost")="$$"&Now()&"$$$$$" rs("allposttable")=ars("allposttable") rs("allposttablename")=ars("allposttablename") rs("NowUseBBS")=ars("NowUseBBS") rs("NowUseBBS")=ars("NowUseBBS") rs("Cookiepath")=ars("Cookiepath") rs("Forum_sn")=ars("Forum_sn") rs.update rs.close set rs=nothing trs.movenext loop trs.close set trs=nothing if err.number<>0 then ErrMsg=ErrMsg+"
    "+"
  • 数据库操作失败,请以后再试,"&err.Description err.clear response.write Errmsg exit sub else response.write "数据导入成功!
    " end if call cache_skin() end if end sub sub rename() dim skid,mdbname,tconn dim srs skid=checkstr(request("skid")) mdbname=Checkstr(trim(request("mdbname"))) if request("act")="loadskin" then Set tconn = Server.CreateObject("ADODB.Connection") tconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdbname) set srs=tconn.execute(" select id,Forum_Body,SkinName from dvskin where id="&skid&" ") else set srs=conn.execute(" select id,Forum_Body,SkinName from config where id="&skid&" ") end if %> <% if request("act")="loadskin" then %> <% end if %> "> ">

    更改模版名称 ID=<%=srs("ID")%>

    模版原名: <%=srs("SkinName")%>
    模版新名:

    <% srs.close set srs=nothing end sub sub savenm() dim skid,mdbname,tconn,skinNAME skid=checkstr(request("skid")) mdbname=Checkstr(trim(request("mdbname"))) skinNAME=Checkstr(trim(request.form("skinname"))) if request("act")="loadskin" then Set tconn = Server.CreateObject("ADODB.Connection") tconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdbname) tconn.execute(" UPDATE dvskin set SkinName='"&skinNAME&"' where id="&skid&" ") else conn.execute(" UPDATE config set SkinName='"&skinNAME&"' where id="&skid&" ") end if call cache_skin() response.write "数据更新成功!点击返回
    " end SUB sub cache_skin() myCache.name="stylelist" dim stylelist stylelist="恢复默认设置
    " set rs=conn.execute("select id,skinname from config order by id") do while not rs.eof stylelist=stylelist & ""&rs(1)&"
    " rs.movenext loop myCache.add stylelist,dateadd("n",60,now) end sub %>