<!--#include file="conn.asp"-->
<!--#include file="inc/publicfun.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="bbsuser.asp"-->
<%
userid=request.cookies("clubuser_id")
ftblog_old=request("ftblog_old")
nav=request("nav")
if nav="b" then
   blogphoto=0
   n="分类"
else
   blogphoto=1
   n="相册"
end if
if ftblog_old<>"" then
   sql="update ftblog_type set blogtype='"&trim(request("ftblog"))&"' where blogtype='"&ftblog_old&"' and blogphoto="&blogphoto
   conn.execute sql
   sql="update ftbbs_upload set photo_name='"&trim(request("ftblog"))&"' where photo_name='"&ftblog_old&"' and clubuser_id="&userid
   conn.execute sql
end if
if request("act")="y" then
   if trim(request.form("ftblog"))="" then
   	response.write "<SCRIPT language=JavaScript>alert('分类不能为空！');history.go(-1);</script>"        
    response.end
   end if
   sql="select * from ftblog_type where blogtype='"&trim(request.form("ftblog"))&"' and userid="&userid&" and blogphoto="&request("blogphoto")&" order by id desc"
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,3
   if rs.eof then
   rs.addnew
   rs("userid")=request.cookies("clubuser_id")
   rs("blogtype")=request.form("ftblog")
   rs("blogphoto")=blogphoto
   rs("qs")=0
   rs("userip")=request.servervariables("remote_addr")
   rs.update
   rs.close
   set rs=nothing
   else
	response.write "<SCRIPT language=JavaScript>alert('你添加的分类已存在！');history.go(-1);</script>"        
    response.end
   end if
end if
%>
<!--#include file="memberinfo.asp"-->
<html><head><meta http-equiv=content-type content="text/html; charset=gb2312">
</head>
<script language="javascript" src="js/publicfun.js"></script>
<body>
<center>
<title><%=username%>的日志分类管理中心</title>
<link rel="stylesheet" type="text/css" href="<%=cssfile%>">
<!--#include file="usernav.asp" -->
<%if nav="b" then%>
<!--#include file="bokerhead.asp" -->
<%elseif nav="a" then%>
<!--#include file="photohead.asp" -->
<%end if%>
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<!--#include file="usercalog.asp" -->
</div>
</td>
<td valign="top" class="c2t1">
<div id="m_blog" class="modbox">
              <table width="100%"  border="0" cellspacing="0" cellpadding="0">
<form name="form1" method=post action="" onsubmit="return chkForm(this)">                
<tr valign="top"> 
                  <td height="50" colspan="5" class=new14 valign="middle"> 
                    <div align="left">
                      
                        &nbsp;请输入你的<%=n%>名称: 
                        <input name="ftblog" type="text" class="text" />
                        <input name="Submit" type="Submit" class="button" value="创建<%=n%>" />
                        <input name="act" type="Hidden" id="act2" value="y">
						<input name="nav" type="Hidden" value=<%=nav%>>
						<input name="blogphoto" type="Hidden" value=<%=blogphoto%>>
                      
                    </div></td>
                </tr>
</form>
                <tr> 
                  <td height="1" colspan="5" bgcolor="#336699" class=new14><spacer height="1" type="block"></td>
                </tr>
                <tr id="t1"  style="display:none"> 
                  <td height="25" colspan="5" class=new14> <fieldset>
                    <legend>修改“<span id="oldgroupname" style="color:red"></span>”<%=n%>名称:</legend>
                    <table width="100%"  border="0" align="center" cellpadding="3" cellspacing="1">
                      <tr> 
                        <td colspan="2"><form name="form2" method=post action="?act=addGroup" onsubmit="return chkForm(this)">
                            <div align="center"> 
                              <input name="ftblog" type="text" class="text" id="ftblog" />
                              <input name="Submit" type="submit" class="button" value="修 改" />
                              <input name="cannel" type="reset" id="cannel" value="取 消" class="button" onclick="closechk()">
                              <input type="Hidden" name="ftblog_old">
							  <input name="nav" type="Hidden" value=<%=nav%>>
                              (注意:只能是中文,英文或数字) </div>
                          </form></td>
                      </tr>
                    </table>
                    </fieldset></td>
                </tr>
                <tr> 
                  <td width="57%" height="25"> <div align="left"><strong>&nbsp;<%=n%>名称</strong></div></td>
                  <td width="12%">
<div align="center">改名</div></td>
                  <td width="19%">
<div align="center">权限</div></td>
                  <!--<td width="7%" bgcolor="#FFFFFF"><div align="center">排序</div></td>-->
                  <td width="12%"><div align="center">删除</div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="5" background="blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<%
   sql="select * from ftblog_type where userid="&request.cookies("clubuser_id")&" and blogphoto="&blogphoto&" order by indate desc"
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,1
   do while not rs.eof
   sign=rs("sign")		  
%>
                <tr> 
                  <td height="25"><div class="opt">&nbsp;<a href="photomanage.asp?id=<%=rs("id")%>&photo_name=<%=rs("blogtype")%>"><%=rs("blogtype")%></a></div></td>
                  <td height="25" align="center"><div class="opt"><a href="#" onclick="chk('<%=rs("blogtype")%>')">改名</a></div></td>
                  <td height="25" align="center">
				  <div class="opt">
				  <%if nav="b" then%>
				  <%if sign=1 then%><a href="op.asp?id=<%=rs("id")%>&sign=0&act=qs&photo_name=<%=rs("blogtype")%>"><font color=red>隐藏</font></a><%else%><a href="op.asp?id=<%=rs("id")%>&sign=1&act=qs&photo_name=<%=rs("blogtype")%>">显示</a><%end if%></a>
				  <%else%>
				  <a href="op.asp?id=<%=rs("id")%>&sign=0&act=qs&photo_name=<%=rs("blogtype")%>"><%if sign=0 then%><font color=red>公开</font><%else%>公开<%end if%></a>
				  <a href="op.asp?id=<%=rs("id")%>&sign=1&act=qs&photo_name=<%=rs("blogtype")%>"><%if sign=1 then%><font color=red>隐藏</font><%else%>隐藏<%end if%></a>
				  <a onClick=pwd('<%=rs("id")%>','<%=userid%>','<%=rs("blogtype")%>') href="#"><%if sign=2 then%><font color=red>已加密</font><%else%>未加密<%end if%></a>				  
				  <%end if%>
				  </div></td>
                  <!--<td height="25" bgcolor="#FFFFFF"><div align="center"><a href="op.asp?id=<%=rs("id")%>&act=odby">排序</a></div></td>-->
                  <td height="25" align="center"><div class="opt"><a href="op.asp?id=<%=rs("id")%>&act=del">删除</a></div></td>
                </tr>
                <tr> 
                  <td height="1" colspan="5" background="../blogimages/dotbg.gif"><spacer height="1" type="block"></td>
                </tr>
<%
rs.movenext
loop
rs.close
%>
              </table>
              <br>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
    <!--#include file="tail.asp" -->
  </center>
</center>
</body>
</html>
<%closedb%>