<!--#include file="../conn.asp" -->
<%
if session("username")="" then
response.Redirect("merr.asp?action=err")
response.End()
else
username=session("username")
userid=session("userid")
end if
%>
<%
userid=session("userid")
set rs=server.CreateObject("adodb.Recordset")
sql2="select * from diaryuser where userid="&userid&""
Rs.Open Sql2,conn,1,1
username=Rs("username")
bookname=Rs("bookname")
shuyu=Rs("shuyu")
fenmian=Rs("fenmian")
gongao=Rs("gongao")
bgbg=Rs("bgimg")
lyb=Rs("kg")
showopen=Rs("showinfo")
wishopen=Rs("wishopen")
showbook=Rs("showbook")
siren=Rs("opi")
Rs.close
if bgbg="" or bgbg="0" then bgbg="diary/index_bg1.jpg"
bgx=Request.Cookies("bgrndc") 
if bgx="" then
bgx="me"
else
bgx="all"
end if
if Trim(Request.QueryString("action"))="edit" then
username=session("username")
bookname=Trim(Request.Form("bookname"))
shuyu=Trim(Request.Form("shuyu"))
fenmian=Trim(Request.Form("fenmian"))
wishopen=Trim(Request.Form("wishopen"))
showinfo=Trim(Request.Form("showinfo"))
showbook=Trim(Request.Form("showbook"))
siren=Trim(Request.Form("siren"))
lyb=Trim(Request.Form("lyb"))
gongao=Trim(Request.Form("gongao"))
bgbg=Trim(Request.Form("bgbg"))
bgx=Trim(Request.Form("bgx"))
if bgx="all" then
Response.cookies("bgrndc")=bgbg
Response.cookies("bgrndc").expires=dateadd("m",9,now)
else
Response.cookies("bgrndc")=""
end if
shuyu=stripHTML(shuyu)
bookname=stripHTML(bookname)
lyb=stripHTML(lyb)
gongao=stripHTML(gongao)
set rs99=server.CreateObject("adodb.recordset")
sql99="select * from diaryuser where userid="&userid
rs99.open sql99,conn,1,3
rs99("bookname")=bookname
rs99("shuyu")=shuyu
rs99("fenmian")=fenmian
rs99("showinfo")=showinfo
rs99("wishopen")=wishopen
rs99("showbook")=showbook
rs99("opi")=siren
rs99("kg")=lyb
rs99("gongao")=gongao
rs99("bgimg")=bgbg
rs99.update
rs99.close
set rs99=nothing
response.Redirect("mdiaryset.asp?userid="&userid)
end if
%>
<html>
<head>
<title>日记属性设定</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<link href="../diary/css.css" rel="stylesheet" type="text/css">
<script src="img/alt.js"></script>
<script language="javascript">
	function SwitchCover(nCover,nBookID,sImageType)
	{
		if(nCover==-1)
			preview.src="../diary/img/"+nBookID+"."+sImageType
		else
			preview.src="../diary/"+nCover+""
	}
	function UploadCover(sPath)
	{
		preview.src=sPath
	}
	function SetCurrentCover(nCover)
	{
		bookcover=document.all("bookcover")
		for(var i=0;i<bookcover.options.length;i++)
		{
			if(bookcover(i).value==nCover)
			{
				bookcover(i).selected=true;
				return;
			}
		}
	}
	function SwitchCoverbg(nCover,nBookID,sImageType)
	{
		if(nCover==-1)
		   //var bg="img/"+nBookID+"."+sImageType
		   //preview.src="img/"+nBookID+"."+sImageType
		   preview.src="diary/"+bg+""
		   //document.write("<BODY BACKGROUND="+"img/"+nBookID+"."+sImageType+">");
			   //document.body.style.backgroundImage=="url("+"img/"+nBookID+"."+sImageType+")" 
		else
			//preview.src=""+nCover+""
			parent.document.body.style.backgroundImage="url("+nCover+")" 
	}	
</script>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" style="background-color=transparent">
<table width="284" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="370" width="284" align="right">
      <table border="0" width="284" id="table8" cellspacing="0" cellpadding="0" height="370">
        <tr> 
          <td height="19" colspan="3">　</td>
        </tr>
        <tr> 
          <td height="19" width="6"></td>
          <td height="19" colspan="2"><font color="#51300C"><font color="#800000"><%=rs("username")%></font> 
            日记属性设置</font></td>
        </tr>
        <tr> 
          <td background="diary/linebg2.gif" colspan="3" height="1"><img border="0" src="diary/linebg2.gif" width="4" height="1"></td>
        </tr>
        <tr valign="top"> 
          <td colspan="2"></td>
          <td width="274" align="center"> 
            <form language="javascript"  name="regform" method="post" action="mdiaryset.asp?userid=<%=userid%>&action=edit">
              <table border="0" width="99%" id="table7" cellspacing="0" cellpadding="0" align="center">
                <tr> 
                  <td width="60"></td>
                  <td colspan="3"></td>
                </tr>
                <tr> 
                  <td width="60" height="19"><b><font color="#77520A">注册账户:</font></b></td>
                  <td colspan="3" height="19"><b><font color="#77520A"><%=username%></font></b></td>
                </tr>
                <tr> 
                  <td width="60" height="2"><b><font color="#77520A">日记本名:</font></b></td>
                  <td height="2"><b> 
                    <input name="bookname" type="text" id="username4" size="8" maxlength="8" value="<%=bookname%>">
                    </b> </td>
                  <td height="2"><b><font color="#77520A">日记封面:</font></b></td>
                  <td height="2"> 
                    <select name="fenmian" class="input" id="fenmian" style="width:60px" onChange="SwitchCover(this.value,6913,'jpg')">
                      <option value="img/01.jpg" <%if fenmian="img/01.jpg" then response.Write("selected")%>>图1</option>
                      <option value="img/02.jpg" <%if fenmian="img/02.jpg" then response.Write("selected")%>>图2</option>
                      <option value="img/03.jpg" <%if fenmian="img/03.jpg" then response.Write("selected")%>>图3</option>
                      <option value="img/04.jpg" <%if fenmian="img/04.jpg" then response.Write("selected")%>>图4</option>
                      <option value="img/05.jpg" <%if fenmian="img/05.jpg" then response.Write("selected")%>>图5</option>
                      <option value="img/06.jpg" <%if fenmian="img/06.jpg" then response.Write("selected")%>>图6</option>
                      <option value="img/07.jpg" <%if fenmian="img/07.jpg" then response.Write("selected")%>>图7</option>
                      <option value="img/08.jpg" <%if fenmian="img/08.jpg" then response.Write("selected")%>>图8</option>
                      <option value="img/09.jpg" <%if fenmian="img/09.jpg" then response.Write("selected")%>>图9</option>
                      <option value="img/10.jpg" <%if fenmian="img/10.jpg" then response.Write("selected")%>>图10</option>
                      <option value="img/11.jpg" <%if fenmian="img/11.jpg" then response.Write("selected")%>>图11</option>
                      <option value="img/12.jpg" <%if fenmian="img/12.jpg" then response.Write("selected")%>>图12</option>
                      <option value="img/13.jpg" <%if fenmian="img/13.jpg" then response.Write("selected")%>>图13</option>
                      <option value="img/14.jpg" <%if fenmian="img/14.jpg" then response.Write("selected")%>>图14</option>
                      <option value="img/15.jpg" <%if fenmian="img/15.jpg" then response.Write("selected")%>>图15</option>
                      <option value="img/16.jpg" <%if fenmian="img/16.jpg" then response.Write("selected")%>>图16</option>
                      <option value="img/17.jpg" <%if fenmian="img/17.jpg" then response.Write("selected")%>>图17</option>
                      <option value="img/18.jpg" <%if fenmian="img/18.jpg" then response.Write("selected")%>>图18</option>
                      <option value="img/19.jpg" <%if fenmian="img/19.jpg" then response.Write("selected")%>>图19</option>
                      <option value="img/20.jpg" <%if fenmian="img/20.jpg" then response.Write("selected")%>>图20</option>
                      <option value="img/21.jpg" <%if fenmian="img/21.jpg" then response.Write("selected")%>>图21</option>
                      <option value="img/22.jpg" <%if fenmian="img/22.jpg" then response.Write("selected")%>>图22</option>
                      <option value="img/23.jpg" <%if fenmian="img/23.jpg" then response.Write("selected")%>>图23</option>
                      <option value="img/24.jpg" <%if fenmian="img/24.jpg" then response.Write("selected")%>>图24</option>
                      <option value="img/25.jpg" <%if fenmian="img/25.jpg" then response.Write("selected")%>>图25</option>
                      <option value="img/26.jpg" <%if fenmian="img/26.jpg" then response.Write("selected")%>>图26</option>
                      <option value="img/27.jpg" <%if fenmian="img/27.jpg" then response.Write("selected")%>>图27</option>
                      <option value="img/28.jpg" <%if fenmian="img/28.jpg" then response.Write("selected")%>>图28</option>
                      <option value="img/29.jpg" <%if fenmian="img/29.jpg" then response.Write("selected")%>>图29</option>
                      <option value="img/30.jpg" <%if fenmian="img/30.jpg" then response.Write("selected")%>>图30</option>
                      <option value="img/31.jpg" <%if fenmian="img/31.jpg" then response.Write("selected")%>>图31</option>
                      <option value="img/32.jpg" <%if fenmian="img/32.jpg" then response.Write("selected")%>>图32</option>
                      <option value="img/33.jpg" <%if fenmian="img/33.jpg" then response.Write("selected")%>>图33</option>
                      <option value="img/34.jpg" <%if fenmian="img/34.jpg" then response.Write("selected")%>>图34</option>
                      <option value="img/35.jpg" <%if fenmian="img/35.jpg" then response.Write("selected")%>>图35</option>
                      <option value="img/36.jpg" <%if fenmian="img/36.jpg" then response.Write("selected")%>>图36</option>
                    </select>
                  </td>
                </tr>
                <tr> 
                  <td width="60" height="19"><font color="#77520A"><b>留言本本:</b></font></td>
                  <td width="68" height="19"><b> 
                    <input name="lyb" type="text" id="username4" size="8" maxlength="8" value="<%=lyb%>">
                    </b> </td>
                  <td width="66" height="19"><font color="#77520A"><b>来客留言:</b></font></td>
                  <td width="77" height="19"> 
                    <select name="showbook" class="input" id="showbook" style="width:60px">
                      <option value="1" <%if showbook="1" then response.Write("selected")%>>启用</option>
                      <option value="0" <%if showbook="0" then response.Write("selected")%>>禁用</option>
                    </select>
                  </td>
                </tr>
                <tr> 
                  <td width="60" height="19"><font color="#77520A"><b>私人日记:</b></font></td>
                  <td height="19"> 
                    <select name="siren" class="input" id="siren" style="width:60px">
                      <option value="0" <%if siren="0" then response.Write("selected")%>>对外隐藏</option>
                      <option value="1" <%if siren="1" then response.Write("selected")%>>显示标题</option>
                    </select>
                  </td>
                  <td height="19"><font color="#77520A"><b>许愿小寺:</b></font></td>
                  <td height="19"> 
                    <select name="wishopen" class="input" id="wishopen" style="width:60px">
                      <option value="no" <%if wishopen="no" then response.Write("selected")%>>主人专用</option>
                      <option value="yes" <%if wishopen="yes" or wishopen="" then response.Write("selected")%>>访客可用</option>
                    </select>
                    <select name="showinfo" class="input" id="wishopen" style="display:none;width:60px">
                      <option value="no" <%if wishopen="no" then response.Write("selected")%>>主人专用</option>
                      <option value="yes" <%if wishopen="yes" or wishopen="" then response.Write("selected")%>>访客可用</option>
                    </select>
                  </td>
                </tr>
                <tr> 
                  <td width="60" height="19"><font color="#77520A"><b>日记背景:</b></font></td>
                  <td height="19"> 
                    <select name="bgbg" class="input" id="bgbg" style="width:60px" onChange="SwitchCoverbg(this.value,6913,'jpg')">
				  <%				  
set rsbg=server.CreateObject("adodb.Recordset")
sql2="select * from diarymb order by diarymbid"
rsbg.Open Sql2,conn,1,1
				do while not rsbg.eof
				%>
<option value="<%=rsbg("diarymbjpg")%>" <%if bgbg=rsbg("diarymbjpg") then response.Write("selected")%>><%=rsbg("diarymbname")%></option>
				<%
				rsbg.movenext
				loop
				set rsbg=nothing
				%>
</select>
                  </td>
                  <td height="19" colspan="2"> 应用
                    <input type="radio" name="bgx" value="me" <%if bgx="me" then response.Write("checked")%>>
                    日记本<input type="radio" name="bgx" value="all" <%if bgx="all" then response.Write("checked")%>>全站 </td>
                </tr>
                <tr> 
                  <td width="60" height="19"><font color="#774212"><b>日记首语:</b></font></td>
                  <td height="19" colspan="3"> 
                    <textarea id="shuyu"  name="shuyu" cols="25" rows="3"><%=shuyu%></textarea>
                  </td>
                </tr>
                <tr> 
                  <td width="60" height="19"><font color="#77520A"><b><font color="#77520A">日记公告:</font></b></font></td>
                  <td height="19" colspan="3"> 
                    <textarea rows="3" name="gongao" cols="25"><%=gongao%></textarea>
                  </td>
                </tr>
                <tr> 
                  <input name="password3" type="hidden" id="password3" value="<%=password3%>">
                  <td colspan="4"> 
                    <p align="center"> 
                      <input type="submit" name="Submit" value=" 提 交 ">
                      <input type="reset" name="Submit2" value=" 重 置 ">
                  </td>
                </tr>
              </table>
            </form>
            <img id="preview" src="<%=alltubg%><%=fenmian%>" width="110" height="80"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>



