📄 ad_photomodify.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=4
Const PurviewLevel_Photo=3
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ad_code_Photo.asp"-->
<%
dim PhotoID,rsPhoto,sql,FoundErr,ErrMsg,PurviewChecked
dim ClassID,tClass,ClassName,RootID,ParentID,Depth,ParentPath,ClassMaster
dim SkinID,LayoutID,SkinCount,LayoutCount,BrowsePurview,AddPurview
PurviewChecked=False
FoundErr=False
PhotoID=trim(request("PhotoID"))
if PhotoID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定要修改的图片ID</li>"
call WriteErrMsg()
call CloseConn()
response.end
else
PhotoID=CLng(PhotoID)
end if
sql="select * from Photo where PhotoID=" & PhotoID & ""
Set rsPhoto= Server.CreateObject("ADODB.Recordset")
rsPhoto.open sql,conn,1,1
if rsPhoto.bof and rsPhoto.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到图片</li>"
call WriteErrMsg()
else
ClassID=rsPhoto("ClassID")
set tClass=conn.execute("select ClassName,RootID,ParentID,Depth,ParentPath,ClassMaster From PhotoClass where ClassID=" & ClassID)
if tClass.bof and tClass.eof then
founderr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的栏目</li>"
else
ClassName=tClass(0)
RootID=tClass(1)
ParentID=tClass(2)
Depth=tClass(3)
ParentPath=tClass(4)
ClassMaster=tClass(5)
end if
if rsPhoto("Editor")=AdminName and rsPhoto("Passed")=False then
PurviewChecked=True
else
if AdminPurview=1 or AdminPurview_Photo<=2 then
PurviewChecked=True
else
PurviewChecked=CheckClassMaster(ClassMaster,AdminName)
if PurviewChecked=False and ParentID>0 then
set tClass=conn.execute("select ClassMaster from PhotoClass where ClassID in (" & ParentPath & ")")
do while not tClass.eof
PurviewChecked=CheckClassMaster(tClass(0),AdminName)
if PurviewChecked=True then exit do
tClass.movenext
loop
end if
end if
if PurviewChecked=False then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>对不起,您的权限不够,不能修改此张图片!</li>"
end if
end if
end if
if FoundErr=True then
call WriteErrMsg()
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="MicroPhoto FrontPage 3.0">
<title>修改图片</title>
<link rel="stylesheet" type="text/css" href="ad_Style.css">
<script language = "JavaScript">
function CheckForm()
{
if (document.myform.ClassID.value=="")
{
alert("图片所属栏目不能指定为含有子栏目的栏目!");
document.myform.ClassID.focus();
return false;
}
if (document.myform.ClassID.value==0)
{
alert("图片所属栏目不能指定为外部栏目!");
document.myform.ClassID.focus();
return false;
}
if (document.myform.PhotoName.value=="")
{
alert("图片名称不能为空!");
document.myform.PhotoName.focus();
return false;
}
if (document.myform.Keyword.value=="")
{
alert("关键字不能为空!");
document.myform.Keyword.focus();
return false;
}
if (document.myform.PhotoUrl_Thumb.value=="")
{
alert("缩略图地址不能为空!");
document.myform.PhotoUrl_Thumb.focus();
return false;
}
if (document.myform.PhotoSize_Thumb.value=="")
{
alert("缩略图文件大小不能为空!");
document.myform.PhotoSize_Thumb.focus();
return false;
}
if (document.myform.PhotoUrl.value=="")
{
alert("原始图片地址不能为空!");
document.myform.PhotoUrl.focus();
return false;
}
if (document.myform.PhotoSize.value=="")
{
alert("原始图片文件大小不能为空!");
document.myform.PhotoSize.focus();
return false;
}
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<form method="POST" name="myform" onSubmit="return CheckForm();" action="ad_PhotoSave.asp" target="_self">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="title">
<td height="22" align="center"><b>修 改 图 片</b></td>
</tr>
<tr align="center">
<td>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr class="tdbg">
<td width="100" align="right"><strong>所属栏目:</strong></td>
<td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%
if AdminPurview=1 or AdminPurview_Photo<=2 then
response.write "<select name='ClassID'>"
call Admin_ShowClass_Option(3,rsPhoto("ClassID"))
response.write "</select></td><td>"
response.write "<font color='#FF0000'><strong>注意:</strong></font><font color='#0000FF'>1、不能指定为含有子栏目的栏目,或者外部栏目"
else
call Admin_ShowPath2(ParentPath,ClassName,Depth)
response.write "<input type='hidden' name='ClassID' value='" & rsPhoto("ClassID") & "'>"
end if
%>
</td>
<td> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -