发新话题
打印

怎样保存网站设置信息

怎样保存网站设置信息

我在后台管理里面加入了自己的内容
如图,是想保存在c_custom.asp文件里

c_custom.asp文件里加入了三个定义
Const ZC_BLOG_FLASHPIC="F"
Const ZC_BLOG_FLASHURL="D"
Const ZC_BLOG_FLASHTXT="FC"
红色的内容是我自己加的,效果如图


现在只能读出,不能保存,修改的代码如下:

以下是admin/edit_setting.asp文件内容
        tmpSng=LoadFromFile(BlogPath & "/c_custom.asp","utf-8")

        Dim strZC_BLOG_HOST
        Dim strZC_BLOG_TITLE
        Dim strZC_BLOG_SUBTITLE
        Dim strZC_BLOG_NAME
        Dim strZC_BLOG_SUB_NAME
        Dim strZC_BLOG_CSS
        Dim strZC_BLOG_COPYRIGHT
        Dim strZC_BLOG_MASTER
'自定义开始
        DIM StrZC_BLOG_FLASHPIC
        DIM StrZC_BLOG_FLASHURL
        DIM StrZC_BLOG_FLASHTXT
'自定义结束


        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_HOST",strZC_BLOG_HOST)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_TITLE",strZC_BLOG_TITLE)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_SUBTITLE",strZC_BLOG_SUBTITLE)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_NAME",strZC_BLOG_NAME)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_SUB_NAME",strZC_BLOG_SUB_NAME)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_CSS",strZC_BLOG_CSS)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_COPYRIGHT",strZC_BLOG_COPYRIGHT)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_MASTER",strZC_BLOG_MASTER)
'自定义开始
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_FLASHPIC",strZC_BLOG_FLASHPIC)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_FLASHURL",strZC_BLOG_FLASHURL)
        Call LoadValueForSetting(tmpSng,True,"String","ZC_BLOG_FLASHTXT",strZC_BLOG_FLASHTXT)
'自定义结束

        strZC_BLOG_HOST=TransferHTML(strZC_BLOG_HOST,"[html-format]")
        strZC_BLOG_TITLE=TransferHTML(strZC_BLOG_TITLE,"[html-format]")
        strZC_BLOG_SUBTITLE=TransferHTML(strZC_BLOG_SUBTITLE,"[html-format]")
        strZC_BLOG_NAME=TransferHTML(strZC_BLOG_NAME,"[html-format]")
        strZC_BLOG_SUB_NAME=TransferHTML(strZC_BLOG_SUB_NAME,"[html-format]")
        strZC_BLOG_CSS=TransferHTML(strZC_BLOG_CSS,"[html-format]")
        strZC_BLOG_COPYRIGHT=TransferHTML(strZC_BLOG_COPYRIGHT,"[html-format]")
        strZC_BLOG_MASTER=TransferHTML(strZC_BLOG_MASTER,"[html-format]")
'自定义开始
        strZC_BLOG_FLASHPIC=TransferHTML(strZC_BLOG_FLASHPIC,"[html-format]")
        strZC_BLOG_FLASHURL=TransferHTML(strZC_BLOG_FLASHURL,"[html-format]")
        strZC_BLOG_FLASHTXT=TransferHTML(strZC_BLOG_FLASHTXT,"[html-format]")
'自定义结束

        Response.Write "<br/> <b>"&ZC_MSG105&"</b>"
        Response.Write "<hr/>"

        Response.Write "<p>"& ZC_MSG104 &":</p><p><input id=""edtZC_BLOG_HOST"" name=""edtZC_BLOG_HOST"" style=""width:90%"" type=""text"" value=""" & strZC_BLOG_HOST & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG091 &":</p><p><input id=""edtZC_BLOG_NAME"" name=""edtZC_BLOG_NAME"" style=""width:90%"" type=""text"" value=""" & strZC_BLOG_NAME & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG092 &":</p><p><input id=""edtZC_BLOG_SUB_NAME"" name=""edtZC_BLOG_SUB_NAME"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_SUB_NAME & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG093 &":</p><p><input id=""edtZC_BLOG_TITLE"" name=""edtZC_BLOG_TITLE""style=""width:90%""  type=""text"" value=""" & strZC_BLOG_TITLE &""" /></p><p></p>"
        Response.Write "<p>"& ZC_MSG094 &":</p><p><input id=""edtZC_BLOG_SUBTITLE"" name=""edtZC_BLOG_SUBTITLE"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_SUBTITLE & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG095 &":</p><p><input id=""edtZC_BLOG_CSS"" name=""edtZC_BLOG_CSS"" style=""width:90%"" type=""text"" value=""" & strZC_BLOG_CSS & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG096 &":</p><p><input id=""edtZC_BLOG_COPYRIGHT"" name=""edtZC_BLOG_COPYRIGHT"" style=""width:90%"" type=""text"" value=""" & strZC_BLOG_COPYRIGHT & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG097 &":</p><p><input id=""edtZC_BLOG_MASTER"" name=""edtZC_BLOG_MASTER"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_MASTER & """ /></p><p></p>"
''自定义开始
        Response.Write "<p>"& ZC_MSG264 &":</p><p><input id=""edtZC_BLOG_FLASHPIC"" name=""edtZC_BLOG_FLASHPIC"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_FLASHPIC & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG265 &":</p><p><input id=""edtZC_BLOG_FLASHURL"" name=""edtZC_BLOG_FLASHURL"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_FLASHURL & """ /></p><p></p>"
        Response.Write "<p>"& ZC_MSG266 &":</p><p><input id=""edtZC_BLOG_FLASHTXT"" name=""edtZC_BLOG_FLASHTXT"" style=""width:90%""  type=""text"" value=""" & strZC_BLOG_FLASHTXT & """ /></p><p></p>"
'自定义结束

TOP

dddddddddddddddddddddd

TOP

问题自己解决

TOP

还要在c_system_event.asp文件里改

'*********************************************************
' 目的:    Save Blog Setting
'*********************************************************
Function SaveSetting()

        Dim i,j
        Dim s,t
        Dim strContent

        strContent=LoadFromFile(BlogPath & "/c_custom.asp","utf-8")

        Dim strZC_BLOG_HOST
        Dim strZC_BLOG_TITLE
        Dim strZC_BLOG_SUBTITLE
        Dim strZC_BLOG_NAME
        Dim strZC_BLOG_SUB_NAME
        Dim strZC_BLOG_CSS
        Dim strZC_BLOG_COPYRIGHT
        Dim strZC_BLOG_MASTER
        dim strZC_BLOG_FLASHPIC
        dim strZC_BLOG_FLASHURL
        dim strZC_BLOG_FLASHTXT
       
        strZC_BLOG_HOST=Request.Form("edtZC_BLOG_HOST")

        strZC_BLOG_TITLE=Request.Form("edtZC_BLOG_TITLE")

        strZC_BLOG_SUBTITLE=Request.Form("edtZC_BLOG_SUBTITLE")

        strZC_BLOG_NAME=Request.Form("edtZC_BLOG_NAME")

        strZC_BLOG_SUB_NAME=Request.Form("edtZC_BLOG_SUB_NAME")

        strZC_BLOG_CSS=Request.Form("edtZC_BLOG_CSS")

        strZC_BLOG_COPYRIGHT=Request.Form("edtZC_BLOG_COPYRIGHT")

        strZC_BLOG_MASTER=Request.Form("edtZC_BLOG_MASTER")
       
        strZC_BLOG_FLASHPIC=Request.Form("edtZC_BLOG_FLASHPIC")

        strZC_BLOG_FLASHURL=Request.Form("edtZC_BLOG_FLASHURL")
       
        strZC_BLOG_FLASHTXT=Request.Form("edtZC_BLOG_FLASHTXT")

        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_HOST",strZC_BLOG_HOST)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_TITLE",strZC_BLOG_TITLE)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_SUBTITLE",strZC_BLOG_SUBTITLE)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_NAME",strZC_BLOG_NAME)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_SUB_NAME",strZC_BLOG_SUB_NAME)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_CSS",strZC_BLOG_CSS)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_COPYRIGHT",strZC_BLOG_COPYRIGHT)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_MASTER",strZC_BLOG_MASTER)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_FLASHPIC",strZC_BLOG_FLASHPIC)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_FLASHURL",strZC_BLOG_FLASHURL)
        Call SaveValueForSetting(strContent,True,"String","ZC_BLOG_FLASHTXT",strZC_BLOG_FLASHTXT)

        Call SaveToFile(BlogPath & "/c_custom.asp",strContent,"utf-8",False)

       
        strContent=LoadFromFile(BlogPath & "/c_option.asp","utf-8")
..........以下相同

TOP

这个贴子就我一个人在这里说,
不知可不可以申请精华哦,给想自定义功能的一点参考

看看做出来的效果吧
www.bestsky.cn

TOP

不知所云~

TOP

经典好文, 不过可惜.....修改不成功.

TOP

按照bestsky.cn说的, 全部修改了, 但文章<#ZB_BLOG_XX#>时没调用成功, 文章直接显示<#ZB_BLOG_XX#>

TOP

发新话题