?? articlemodify.asp
字號:
<%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim ArticleID,rsArticle,FoundErr,ErrMsg
ArticleID=trim(request("ArticleID"))
FoundErr=False
if ArticleID="" then
response.Redirect("ArticleManage.asp")
end if
sql="select * from Product where ArticleID=" & ArticleID & ""
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sql,conn,1,1
if FoundErr=True then
call WriteErrMsg()
else
%>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
function CheckForm()
{
if (editor.EditMode.checked==true)
document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
else
document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML;
if (document.myform.Title.value=="")
{
alert("文章標題不能為空!");
document.myform.Title.focus();
return false;
}
if (document.myform.Key.value=="")
{
alert("關鍵字不能為空!");
document.myform.Key.focus();
return false;
}
if (document.myform.Content.value=="")
{
alert("文章內容不能為空!");
editor.HtmlEdit.focus();
return false;
}
return true;
}
function loadForm()
{
editor.HtmlEdit.document.body.innerHTML=document.myform.Content.value;
return true
}
</script>
<html>
<head>
<title>修改管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<body onLoad="javascipt:setTimeout('loadForm()',1000);">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="862" align="center" valign="top">
<br>
<b> </b><b>修 改 產 品</b><br><form method="POST" name="myform" onSubmit="return CheckForm();" action="ArticleSave.asp?action=Modify">
<table width="685" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr>
<td height="25" align="center" class="title" style="background-color: #E1F4EE"> </td>
</tr>
<tr align="center">
<td class="tdbg">
<table width="100%" border="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="170" height="22" align="right" bgcolor="#E1F4EE">所屬欄目:</td>
<td width="507" bgcolor="#E1F4EE">
<%
if session("purview")=3 or session("purview")=4 then
response.write rsArticle("BigClassName") & "<input name='BigClassName' type='hidden' value='" & rsArticle("BigClassName") & "'>>>"
else
sql = "select * from BigClass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "請先添加欄目。"
else
%>
<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<%
do while not rs.eof
%>
<option <% if rs("BigClassName")=rsArticle("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<%
end if
if session("purview")=4 then
response.write rsArticle("SmallClassName") & "<input name='SmallClassName' type='hidden' value='" & rsArticle("SmallClassName") & "'>"
else
%>
<select name="SmallClassName">
<option value="" <%if rsArticle("SmallClassName")="" then response.write "selected"%>>不指定小類</option>
<%
sql="select * from SmallClass where BigClassName='" & rsArticle("BigClassName") & "'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
do while not rs.eof%>
<option <% if rs("SmallClassName")=rsArticle("SmallClassName") then response.Write("selected") end if%> value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<%
end if
%>
</td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">產品編號:</td>
<td bgcolor="#E1F4EE">
<input name="Product_Id" type="text"
id="Product_Id" value="<%=rsArticle("Product_Id")%>" size="9" maxlength="9">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">產品名稱:</td>
<td bgcolor="#E1F4EE">
<input name="Title" type="text"
id="Title" value="<%=rsArticle("Title")%>" size="50" maxlength="80">
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">關鍵字:</td>
<td bgcolor="#E1F4EE">
<input name="Key" type="text"
id="Key" value="<%=trim(rsArticle("Key"))%>" size="50" maxlength="255">
<font color="#FF0000">*</font><br>
用來查找相關文章,可輸入多個關鍵字,中間用空格分開。不能出現"'*?()等字符。</td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">產品說明:</td>
<td bgcolor="#E1F4EE"> </td>
</tr>
<tr bgcolor="#E3E3E3">
<td colspan="2" align="right" bgcolor="#E1F4EE">
<div align="left">
<textarea name="Content" style="display:none"><%=rsArticle("Content")%></textarea>
<iframe ID="editor" src="../editor.asp" frameborder=1 scrolling=no width="620" height="405"></iframe>
</div></td>
</tr>
<tr>
<td width="170" align="right" bgcolor="#E1F4EE" height="30"><strong>內容分頁方式:</strong></td>
<td bgcolor="#E1F4EE" height="30">
<select name="PaginationType" id="PaginationType">
<option value="0" <%if rsArticle("PaginationType")=0 then response.write " selected"%>>不分頁</option>
<option value="1" <%if rsArticle("PaginationType")=1 then response.write " selected"%>>自動分頁</option>
<option value="2" <%if rsArticle("PaginationType")=2 then response.write " selected"%>>手動分頁</option>
</select> <strong><font color="#0000FF">注:</font></strong><font color="#0000FF">手動分頁符標記為“</font><font color="#FF0000">[NextPage]</font><font color="#0000FF">”,注意大小寫</font></td>
</tr>
<tr>
<td width="170" align="right" bgcolor="#E1F4EE">首頁圖片:
<input name="IncludePic" type="hidden" id="IncludePic" value="yes"></td>
<td bgcolor="#E1F4EE">
<input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="<%=rsArticle("DefaultPicUrl")%>" size="50" maxlength="200">
<br>
首頁的圖片,直接從上傳圖片中選擇:
<select name="DefaultPicList" id="DefaultPicList" onChange="DefaultPicUrl.value=this.value;">
<option value=""<% if rsArticle("DefaultPicUrl")="" then response.write "selected" %>>不指定首頁圖片</option>
<%
if rsArticle("UploadFiles")<>"" then
dim IsOtherUrl
IsOtherUrl=True
if instr(rsArticle("UploadFiles"),"|")>1 then
dim arrUploadFiles,intTemp
arrUploadFiles=split(rsArticle("UploadFiles"),"|")
for intTemp=0 to ubound(arrUploadFiles)
if rsArticle("DefaultPicUrl")=arrUploadFiles(intTemp) then
response.write "<option value='" & arrUploadFiles(intTemp) & "' selected>" & arrUploadFiles(intTemp) & "</option>"
IsOtherUrl=False
else
response.write "<option value='" & arrUploadFiles(intTemp) & "'>" & arrUploadFiles(intTemp) & "</option>"
end if
next
else
if rsArticle("UploadFiles")=rsArticle("DefaultPicUrl") then
response.write "<option value='" & rsArticle("UploadFiles") & "' selected>" & rsArticle("UploadFiles") & "</option>"
IsOtherUrl=False
else
response.write "<option value='" & rsArticle("UploadFiles") & "'>" & rsArticle("UploadFiles") & "</option>"
end if
end If
if IsOtherUrl=True then
response.write "<option value='" & rsArticle("DefaultPicUrl") & "' selected>" & rsArticle("DefaultPicUrl") & "</option>"
end if
end if
%>
</select>
<input name="UploadFiles" type="hidden" id="UploadFiles" value="<%=rsArticle("UploadFiles")%>">
</td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">已通過審核:</td>
<td bgcolor="#E1F4EE">
<input name="Passed" type="checkbox" id="Passed" value="yes" <% if rsArticle("Passed")=true then response.Write("checked") end if%>>
是<font color="#0000FF">(如果選中的話將直接發(fā)布)</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">瀏覽權限:</td>
<td bgcolor="#E1F4EE">
<select name="ReadLevel" id="select">
<option value="9999" <%if rsArticle("ReadLevel")=9999 then response.write " selected"%>>站內游客</option>
<option value="999" <%if rsArticle("ReadLevel")=999 then response.write " selected"%>>注冊用戶</option>
<option value="99" <%if rsArticle("ReadLevel")=99 then response.write " selected"%>>企業(yè)用戶</option>
<option value="9" <%if rsArticle("ReadLevel")=9 then response.write " selected"%>>VIP用戶</option>
</select>
<font color="#0000FF">(只有具有相應權限的人才能閱讀此文章)</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">首頁顯示:</td>
<td bgcolor="#E1F4EE">
<input name="Elite" type="checkbox" id="Elite" value="yes" <% if rsArticle("Elite")=true then response.Write("checked") end if%>>
是<font color="#0000FF">(如果選中的話將在首頁做為新產品顯示)</font></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#E1F4EE">錄入時間:</td>
<td bgcolor="#E1F4EE">
<input name="UpdateTime" type="text" id="UpdateTime" value="<%=now()%>" maxlength="50">
當前時間為:<%=now()%> 注意不要改變格式。</td>
</tr>
</table>
</td>
</tr>
</table>
<div align="center">
<p>
<input name="ArticleID" type="hidden" id="ArticleID" value="<%=rsArticle("ArticleID")%>">
<input
name="Save" type="submit" id="Save" value="保存修改結果">
</p>
</div>
</form>
</td>
</tr>
</table>
<%
end if
rsArticle.close
set rsArticle=nothing
call CloseConn()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -