📄 user_editarticle.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../SysCls/KS_UserCommonCls.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2005-2006 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New User_EditArticle
KSCls.Execute()
Set KSCls = Nothing
Class User_EditArticle
Private KSCMS,KSUser
Private Sub Class_Initialize()
Set KSCMS=New CommonCls
Set KSUser = New UserCls
End Sub
Private Sub Class_Terminate()
Set KSCMS=Nothing
Set KSUser=Nothing
End Sub
Public Sub Execute()
IF Cbool(KSUser.UserLoginChecked)=false Then
Response.Write "<script>location.href='Login.asp';</script>"
Exit Sub
End If
KSUser.LoadHead()
%>
<TABLE height="380" cellSpacing=0 width=770 align=center border=0>
<TR>
<TD vAlign=top bgColor=#FFFFFF>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32"> 当前位置 >> <a href="<%=KSCMS.GetConfig("WebUrl")%>"><%=KSCMS.GetConfig("WebName")%></a> >> <a href="index.asp">会员中心</a> >> 文章管理 >> 编辑文章 </td>
</tr>
<tr>
<td>
<%
KSUser.LoadMenu()
%>
</td>
</tr>
</table>
<table width="770" height="380" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<script language = "JavaScript">
function CheckForm()
{
if (frames["ArticleContent"].CurrMode!='EDIT') {alert('其他模式下无法保存,请切换到设计模式');return false;}
document.myform.Content.value=frames["ArticleContent"].KS_EditArea.document.body.innerHTML;
if (document.myform.ClassID.value=="0")
{
alert("请选择文章栏目!");
document.myform.ClassID.focus();
return false;
}
if (document.myform.Title.value=="")
{
alert("请输入文章标题!");
document.myform.Title.focus();
return false;
}
if (document.myform.Content.value=='')
{
alert("请输入文章内容!");
frames["ArticleContent"].KS_EditArea.focus();
return false;
}
return true;
}
</script>
<%Call KSUser.ArticleMenu
IF KSCMS.G("Action")="Save" Then
Dim ClassID:ClassID=KSCMS.G("ClassID")
Dim Title:Title=Trim(KSCMS.G("Title"))
Dim KeyWords:KeyWords=Trim(KSCMS.G("KeyWords"))
Dim Author:Author=Trim(KSCMS.G("Author"))
Dim Origin:Origin=Trim(KSCMS.G("Origin"))
Dim Content:Content=KSCMS.G("Content")
Dim ArticleStatus:ArticleStatus=KSCMS.G("Status")
Dim ArticleID:ArticleID=KSCMS.G("ID")
Dim PicUrl:PicUrl=KSCMS.G("PicUrl")
Dim RSObj
If ArticleID="" Or Not Isnumeric(ArticleID) Then ArticleID=0
if ClassID="" Then ClassID=0
If ClassID=0 Then
Response.Write "<script>alert('你没有选择文章栏目!');history.back();</script>"
Exit Sub
End IF
If Title="" Then
Response.Write "<script>alert('你没有输入文章标题!');history.back();</script>"
Exit Sub
End IF
If Content="" Then
Response.Write "<script>alert('你没有输入文章内容!');history.back();</script>"
Exit Sub
End IF
Set RSObj=Server.CreateObject("Adodb.Recordset")
RSObj.Open "Select * From KS_UserArticle Where ID=" & ArticleID,Conn,1,3
RSObj("Title")=Title
RSObj("ClassID")=ClassID
RSObj("KeyWords")=KeyWords
RSObj("Author")=Author
RSObj("UserName")=KSUser.Get_UserName
RSObj("Origin")=Origin
RSObj("Content")=Content
RSObj("Status")=ArticleStatus
RSObj("PicUrl")=PicUrl
if PicUrl<>"" Then
RSObj("PicNews")=1
Else
RSObj("PicNews")=0
End if
RSObj("AddDate")=Now '更新时间
RSObj.Update
RSObj.Close
Set RSObj=Nothing
Response.Write "<script>alert('文章修改成功!');location.href='User_MyArticle.asp?page=" & KSCMS.G("Page") &"';</script>"
Else
Dim RSE,I
Dim ID:ID=KSCMS.G("ID")
IF ID="" or Not isnumeric(ID) Then
Response.Write "<script>alert('参数传递有误');history.back();</script>"
Exit Sub
End IF
Set RSE=Server.CreateObject("Adodb.Recordset")
RSE.Open "Select * From KS_UserArticle Where ID=" & ID ,CONN,1,1
IF RSE.Eof And RSE.Bof Then
Response.Write "<script>alert('参数传递有误');history.back();</script>"
Exit Sub
Else
%>
<table width="765" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="42"><table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="180"><table width="100%" border="0" cellspacing="0" cellpadding="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -