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

📄 user_flashedit.asp

📁 俄罗斯方块源码 俄罗斯方块源码 俄罗斯方块源码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<%
if session("username")="" then
  call mb("对不起,您还没有登陆!","login.asp",1)
end if

dim id
id=request("id")
if not isinteger(id) then
   call mb("请指定要编辑的Flash的ID参数!","",0)
end if

if request("action")="save" then
 dim flashname,bigclassid,smallclassid,url,url2,picurl,remark
 
 
 flashname=checkstr(trim(request.form("flashname")))
 url=checkstr(trim(request.form("url")))
 url2=checkstr(trim(request.form("url2")))
 picurl=checkstr(trim(request.form("picurl")))
 remark=checkstr(trim(request.form("remark")))

 bigclassid=request.form("bigclassid")
 smallclassid=request.form("smallclassid")

 if flashname="" or strlength(flashname)>25 then
  call mb("Flash名称不能为空,或大于25个字符!","",0)
 end if

 if url="" then
  call mb("Flash文件地址不能为空!","",0)
 end if

 if remark="" then
  call mb("Flash说明不能为空!","",0)
 end if

 set rs=server.createobject("adodb.recordset")
 sql="select * from flash where id="&id
 rs.open sql,conn,1,3
 if rs.bof and rs.eof then
   call mb("找不到要编辑的Flash!","",0)
 elseif rs("username")<>session("username") then
   call mb("对不起,您无权编辑其他作者发布的作品!","",0)
 else
  if bigclassid<>"" and smallclassid<>"" then
    rs("bigclassid")=bigclassid
    rs("smallclassid")=smallclassid
  end if
  rs("flashname")=flashname
  rs("url")=url
  rs("url2")=url2
  rs("picurl")=picurl
  rs("remark")=remark
  rs.update
 end if
 rs.close
 call mb("编辑Flash作品成功!","user_index.asp",1)
else
 set rs=conn.execute("select * from smallclass")
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
		dim count:count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("smallclassname"))%>","<%= trim(rs("bigclassid"))%>","<%= trim(rs("smallclassid"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing
        %>
onecount=<%=count%>;

function changelocation(bigclassid)
    {
    document.put.smallclassid.length = 0; 

    var bigclassid=bigclassid;
    var i;
    document.put.smallclassid.options[0] = new Option('请选择二级分类','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == bigclassid)
            { 
                document.put.smallclassid.options[document.put.smallclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<%dim rsf:set rsf=conn.execute("select * from flash where id="&id)
if rsf.bof and rsf.eof then
  call mb("对不起,找不到您要编辑的Flash!","",0)
elseif rsf("username")<>session("username") then
  call mb("对不起,您无权编辑其他作者发布的作品!","",0)
else
%>
<table width="780" height="200" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="190" valign="top" background="index3/flash_bg4.gif" bgcolor="#F7F7F7" class="regbg"> 
      <!--#include file="user_menu.asp"-->
    </td>
    <td valign="top"><TABLE align=center 
      background="images/line01.gif" 
      border=0 cellPadding=0 cellSpacing=0 height=24 width="100%">
        <TR> 
          <TD height=21 width="55%">&nbsp;<IMG height=12 
            src="images/A3.gif" width=12> 当前位置:<A 
            href="index.asp" title="联盟首页">闪闪之家</A> -&gt; 作品编辑</TD>
          <TD height=21 width="45%">&nbsp;</TD>
        </TR>
      </TABLE> 
      <form action="?action=save" method="post" name="put" id="put">
        <TABLE align=center border=0 borderColor=#000000 cellPadding=0 cellSpacing=0 width="98%">
          <TR> 
            <TD background="images/T_back.gif" width="18%"><IMG src="images/T_1.gif" width=90 height=24 border="0"></TD>
            <TD 
          background="images/T_back.gif" 
          width="78%"><strong>作 品 编 辑</strong></TD>
            <TD width="4%"><IMG height=24 
            src="images/T_2.gif" 
          width=29></TD>
          </TR>
        </TABLE>
        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#FFFBFF"> 
            <td height="25" align="center">原Flash分类:</td>
            <td height="25">&nbsp;<a href="showsmall.asp?classid=<%=rsf("bigclassid")%>" title="查看该分类的详细信息..." target=_blank><%=showbigclassname(rsf("bigclassid"))%></a>&nbsp;->&nbsp;<a href="showflash.asp?smallclassid=<%=rsf("smallclassid")%>" title="查看该分类的详细信息..." target=_blank><%=showsmallclassname(rsf("smallclassid"))%></a></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="27%" height="25" align="center">一级分类:</td>
            <td width="73%" height="25"> <select name="bigclassid" size="1" id="bigclassid" onChange="changelocation(document.put.bigclassid.options[document.put.bigclassid.selectedIndex].value)">
                <option value='' selected>请选择一级分类</option>
                <%set rs=conn.execute("select bigclassid,bigclassname from bigclass order by bigclassid")
					 do until rs.eof
					   response.write "<option value='"&rs(0)&"'>"&rs(1)&"</option>"
					 rs.movenext
					 loop
					 rs.close
					 %>
              </select></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" align="center">二级分类:</td>
            <td height="25"> <select name="smallclassid" size="1" id="smallclassid">
                <option value='' selected>请选择二级分类</option>
              </select></td>
          </tr>
          <tr bgcolor="#FFFBFF"> 
            <td height="25" align="center">Flash名称:</td>
            <td height="25"> 
              <input name="flashname" type="text" class="input" id="flashname" value="<%=rsf("flashname")%>" size="30"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" align="center">文件地址:</td>
            <td height="25"> <input name="url" type="text" class="input" id="url" value="<%=rsf("url")%>" size="30"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" align="center">观看地址二:</td>
            <td height="25"> <input name="url2" type="text" class="input" id="flashname3" value="<%=rsf("url2")%>" size="30"></td>
          </tr>
          <tr bgcolor="#FFFBFF"> 
            <td height="25" align="center">缩略图地址:</td>
            <td height="25"> 
              <input name="picurl" type="text" class="input" id="flashname4" value="<%=rsf("picurl")%>" size="30"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" align="center">简短说明:</td>
            <td height="25"> <textarea name="remark" cols="45" rows="10" class="input" id="textarea"><%=rsf("remark")%></textarea></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" align="center">&nbsp;</td>
            <td height="30"> <input name="Submit" type="submit" class="button" value=" 发布我的作品 "> 
              <input name="id" type="hidden" id="id" value="<%=id%>"> </td>
          </tr>
        </table><br>

      </form></td>
  </tr>
</table>
<%
 end if
 rsf.close
 set rsf=nothing
end if%>
<!--#include file="bottom.asp"-->
</DIV>
</BODY></HTML>

⌨️ 快捷键说明

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