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

📄 admin_article.asp

📁 1] 校友多种方式注册认证[直接注册,答问注册,认证注册] 2] 校友论坛 小巧而实用的论坛,支持UBB标签,快速回复,帖子搜索,灵活的将帖子置顶,设置精华 3] 校友相册 相片上传[方便上传
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<%
'===================================================================
'= ASP FILENAME	: /admin/admin_article.asp
'= CREATED TIME : Mar,11,2004
'= LAST MODIFIED: Mar,11,2004
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION  : article manage
'= Change Log:
'===================================================================
%>

<!-- #include file = "../inc/inc_class_def.asp" -->

<!-- #include file = "../inc/inc_db_func.asp" -->
<!-- #include file = "../class/class_db.asp" -->

<!-- #include file = "../inc/inc_pub_func.asp" -->
<!-- #include file = "../inc/inc_char_func.asp" -->
<!-- #include file = "../inc/inc_data_check.asp" -->

<!-- #include file = "../class/class_html_form.asp" -->
<!-- #include file = "../class/class_html_table.asp" -->
<!-- #include file = "../main_func.asp" -->
<!-- #include file = "../inc/inc_ubb.asp" -->

<!-- #include file = "./admin_func.asp" -->

<!-- #include file = "../js/comm_func.js" -->
<!-- #include file = "../js/ubbcode.js" -->

<%
Const CONST_PAGE_FILE = "admin/admin_article.asp"
GBL_strHomeURL = "../"

Call AdminCheckExec()

Dim clsPubDB
Set clsPubDB = New classDBOprt

Call SiteHead("文章管理")

Call CheckPostExist("FormAddList,FormSaveAddList,ShowArticle,ShowList,DelList,ShowArticleSort,FormAddArticleSort,FormSaveAddArticleSort,DelArticleSort,FormMdyArticleSort,FormSaveMdyArticleSort,GetArticleNum")

Call ExeSysAdminQst()

Set clsPubDB = Nothing

%>
<%
'=============== FUNCTION BODY BEGIN ===============================
'===================================================================
'= Sub         : FormAddList()
'= Time		   : Created At Jan,13,2003
'= Input       : None

'= Called by   : ShowFuncSwitch()
'= Calls       : ShowFuncSwitch()
'= Description : Add list
'===================================================================
Sub FormAddList()

	Dim clsForm			'== Class of form
	Dim clsTable		'== Class of table
	Dim strHtmlCode
	Dim GetRSId
	Dim strActFlag
	Dim strVer,strStatus,strKey,strTitle,strContent,strType,strAdd1,strAdd2,strAdd3
	Dim intOrder

	strVer = ""
	strStatus = "0"
	strKey = ""
	strTitle = ""
	strContent = ""
	strType = "0"
	strAdd1 = ""
	strAdd2 = ""
	strAdd3 = ""
	intOrder = 0

	strActFlag = Trim(Request.QueryString("pstActFlag"))
	If strActFlag = "LIST_EDIT" Then

		GetRSId = Trim(Request.QueryString("ListId"))
		strAddInfo = "该文章"
		intErrId = DataCheck("DT_ID",GetRSId,strAddInfo,"")
		Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

		clsPubDB.Clear()
		clsPubDB.AllSQL = "SELECT LIST_TITLE,LIST_ADD1,LIST_ADD2,LIST_STATUS,LIST_ORDER,LIST_CONTENT,LIST_KEY,LIST_TYPE FROM CLASS_LIST WHERE LIST_ID=" & GetRSId
		clsPubDB.SQLRSExecute()
		Call ResultExecute(clsPubDB.intErrNum,"get data before add list","ES_ERR")
		If Not ResultExecute(clsPubDB.intRSNum,"该需要修改的文章","ES_DB_NO") Then
			strTitle = clsPubDB.objPubRS("LIST_TITLE")
			strVer = ""
			strType = clsPubDB.objPubRS("LIST_TYPE")
			strStatus = clsPubDB.objPubRS("LIST_STATUS")
			strContent = clsPubDB.objPubRS("LIST_CONTENT")
			strKey = clsPubDB.objPubRS("LIST_KEY")
			intOrder = clsPubDB.objPubRS("LIST_ORDER")
			strAdd1 = clsPubDB.objPubRS("LIST_ADD1")
			strAdd2 = clsPubDB.objPubRS("LIST_ADD2")
		End If

	End If

	Set clsForm = New classForm
	If strActFlag = "LIST_EDIT" Then
		clsForm.Action = "./admin_article.asp?action=FormSaveAddList&pstActFlag=LIST_EDIT&ListId=" & GetRSId
	Else
		clsForm.Action = "./admin_article.asp?action=FormSaveAddList"
	End If
	clsForm.Id = "frmAddList"
	clsForm.Name = "frmAddList"
	clsForm.OnSubmit = "return CheckFormAddList()"
	clsForm.ColumnScale = "20%"
	clsForm.MakeForm()
	clsForm.MakeTable "0","3","1","center","95%",GBL_cssListTable

	clsForm.AddTr GBL_cssFormTitleTd
	clsForm.AddTitle "发表新文章",""

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "*文章主题",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddText "iptTitle","240","50"
	clsForm.AddValue strTitle

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "*文章类型",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddSelect "rdoType",""
	Call GetArticleSort(clsForm,strType)

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "*文章状态",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddRadio "rdoStatus","0","普通&nbsp;",strStatus
	clsForm.AddRadio "rdoStatus","1","固顶&nbsp;",strStatus
	'clsForm.AddRadio "rdoStatus","2","推荐&nbsp;",strStatus
	'clsForm.AddRadio "rdoStatus","3","锁定&nbsp;",strStatus
	'clsForm.AddRadio "rdoStatus","4","隐藏&nbsp;",strStatus

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "排序号",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddText "iptOrder","4","4"
	clsForm.AddValue intOrder

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "关 键 字",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddText "iptKey","250","50"
	clsForm.AddValue strKey
	
	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "UBB代码",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddLine GetUbb()

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "附加1",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddText "iptAdd1","255","50"
	clsForm.AddValue strAdd1

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "附加1说明",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddLine "站长日记:cloudy,sunny,rain,stoc"

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "附加2",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddText "iptAdd2","255","50"
	clsForm.AddValue strAdd2

	clsForm.AddTr GBL_cssFormTr
	clsForm.AddTd "*文章内容",GBL_cssFormTdOne,GBL_cssFormTdTwo
	clsForm.AddTextrea "txtContent","70","15"
	clsForm.AddValue FilterHtml(strContent)

	clsForm.AddTr GBL_cssFormSubTr
	clsForm.AddSubTd GBL_cssFormSubTd
	clsForm.AddSub "subAddList","提 交","submit"
	clsForm.AddSub "rstAddList","重 写","reset"

	clsForm.OutPutForm()
	Set clsForm = Nothing

End Sub
'============== End of Function FormAddList() =====================
'===================================================================
'= Sub         : FormSaveAddList() 
'= Time	       : Created At Jan,13,2003
'= Input       : None

'= Called by   : ExecFuncSwitch()
'= Calls       : None
'= Table       : INSERT INTO CLASS_LIST
'= Description : Save user's list
'===================================================================
Sub FormSaveAddList() 

	Dim strTitle,strContent,strVer,intType,intStatus,strKey
	Dim strAddInfo
	Dim intErrId
	Dim GetRSId,strActFlag
	Dim intOrder

	strActFlag = Trim(Request.QueryString("pstActFlag"))
	If strActFlag = "LIST_EDIT" Then
		GetRSId = Trim(Request.QueryString("ListId"))
		strAddInfo = "该文章"
		intErrId = DataCheck("DT_ID",GetRSId,strAddInfo,"")
		Call ResultExecute(intErrId,strAddInfo,"ES_ERR")
	End If

	'== Check title of board
	strTitle = Trim(Request.Form("iptTitle"))
	strAddInfo = "主题"
	intErrId = DataCheck("DT_FIX_LENGTH",strTitle,strAddInfo,"1|DTC_LESS_MORE_LEN|240|")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	strType = Trim(Request.Form("rdoType"))
	strAddInfo = "类型"
	If FindArticleSort(strType) = "NULL" Then
		Call ResultExecute(E_USER_PUB,"类型选择错误","ES_ERR")
		Exit Sub
	End If

	intOrder = Trim(Request.Form("iptOrder"))
	If Not IsNumeric(intOrder) Then
		Call ResultExecute(E_USER_PUB,"排序号错误,应全为数字","ES_ERR")
		Exit Sub
	End If

	strStatus = Trim(Request.Form("rdoStatus"))
	strAddInfo = "状态"
	intErrId = DataCheck("DT_ENUM",strStatus,strStatus,"0,1")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	strKey = Trim(Request.Form("iptKey"))
	strAdd1 = Trim(Request.Form("iptAdd1"))
	strAdd2 = Trim(Request.Form("iptAdd2"))

	'== Check contents
	strContent = RTrim(Request.Form("txtContent"))
	strAddInfo = "内容"
	intErrId = DataCheck("DT_FIX_LENGTH",strContent,strAddInfo,"5|DTC_LESS_MORE_LEN|10000|")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_LIST"
	If strActFlag = "LIST_EDIT" Then
		clsPubDB.SQLType = "UPDATE"
		clsPubDB.Where = "LIST_ID=" & GetRSId
	Else
		clsPubDB.SQLType = "INSERT"
		clsPubDB.AddField "LIST_OWNER_ID",GBL_intUserId
	End If
	'clsPubDB.AddField "LIST_STATUS",strStatus
	clsPubDB.AddField "LIST_TITLE",strTitle
	clsPubDB.AddField "LIST_CONTENT",htmlencode2(strContent)
	clsPubDB.AddField "LIST_TYPE",strType
	clsPubDB.AddField "LIST_KEY",strKey
	clsPubDB.AddField "LIST_ORDER",intOrder
	clsPubDB.AddField "LIST_ADD1",strAdd1
	clsPubDB.AddField "LIST_ADD2",strAdd2

	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,"add or mdy article","ES_ERR")

	If strActFlag = "LIST_EDIT" Then
		Call ResultExecute(1002,"","ES_SUCC")
	Else
		Call ResultExecute(1001,"","ES_SUCC")
	End If
	
End Sub
'=========== End of Sub FormSaveAddList() ==========================
'===================================================================
'= Sub         : DelList()
'= Time		   : Created At June,8,2003
'= Input       : None

'= Called By   : ShowFuncSwitch()
'= Calls	   : ShowPage(),ShowContent(),ShowContentB()
'= Table       : Query CLASS_LIST
'= Description : 
'===================================================================
Sub DelList()

	Dim intErrId
	Dim strAddInfo
	Dim GetRSId

	GetRSId = Trim(Request.QueryString("ListId"))
	strAddInfo = "该要删除的文章"
	intErrId = DataCheck("DT_ID",GetRSId,strAddInfo,"")
	Call ResultExecute(intErrId,strAddInfo,"ES_ERR")

	clsPubDB.Clear()
	clsPubDB.TableName = "CLASS_LIST"
	clsPubDB.SQLType = "DELETE"
	clsPubDB.Where = "LIST_ID=" & GetRSId
	clsPubDB.SQLExecute()
	Call ResultExecute(clsPubDB.intErrNum,"del list","ES_ERR")

	Response.Redirect "./admin_article.asp?action=ShowList"

End Sub
'=============== End Of Sub DelList() ==============================
'====================================================================
'= Sub         : ShowContent(objRSCont,intMaxPerPage,intPageNow)
'= Time        : Created At May,17,2003
'= Input       : 记录集游标(objRSCont),每页最大记录,当前页数

'= Called by   : ShowList()
'= Calls       : None
'= Table       : Query CLASS_LIST
'= Description : Show per page's list
'===================================================================
Sub ShowContent(objRSCont,intMaxPerPage,intPageNow)
	Dim i				
	Dim strHtmlCode
	Dim clsTable

⌨️ 快捷键说明

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