?? admin_article.asp
字號(hào):
<%
'===================================================================
'= 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 "發(fā)表新文章",""
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 "*文章狀態(tài)",GBL_cssFormTdOne,GBL_cssFormTdTwo
clsForm.AddRadio "rdoStatus","0","普通 ",strStatus
clsForm.AddRadio "rdoStatus","1","固頂 ",strStatus
'clsForm.AddRadio "rdoStatus","2","推薦 ",strStatus
'clsForm.AddRadio "rdoStatus","3","鎖定 ",strStatus
'clsForm.AddRadio "rdoStatus","4","隱藏 ",strStatus
clsForm.AddTr GBL_cssFormTr
clsForm.AddTd "排序號(hào)",GBL_cssFormTdOne,GBL_cssFormTdTwo
clsForm.AddText "iptOrder","4","4"
clsForm.AddValue intOrder
clsForm.AddTr GBL_cssFormTr
clsForm.AddTd "關(guān) 鍵 字",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說(shuō)明",GBL_cssFormTdOne,GBL_cssFormTdTwo
clsForm.AddLine "站長(zhǎng)日記: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 "*文章內(nèi)容",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,"類型選擇錯(cuò)誤","ES_ERR")
Exit Sub
End If
intOrder = Trim(Request.Form("iptOrder"))
If Not IsNumeric(intOrder) Then
Call ResultExecute(E_USER_PUB,"排序號(hào)錯(cuò)誤,應(yīng)全為數(shù)字","ES_ERR")
Exit Sub
End If
strStatus = Trim(Request.Form("rdoStatus"))
strAddInfo = "狀態(tài)"
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 = "內(nèi)容"
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 = "該要?jiǎng)h除的文章"
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 : 記錄集游標(biāo)(objRSCont),每頁(yè)最大記錄,當(dāng)前頁(yè)數(shù)
'= 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
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -