📄 admin_article.asp
字号:
Response.Write "</td>"
Response.Write " <td height=""22"" class=""forumrow""><input type=""submit"" name=""Submit"" value=""执行操作"" class=button onclick=""{if(confirm('您确定执行的操作吗?')){this.document.selform.submit();return true;}return false;}""></td>"
Response.Write " </tr></form>"
Response.Write " <tr>"
Response.Write " <td height=""22"" colspan=""5"" class=""forumRowHighlight"">"
Call showpage
Response.Write "</td></tr>"
Response.Write "</table>"
End Sub
Private Sub setclass(isEdit)
Dim NC_HtmlEdit
Dim srtClassList
Set NC_HtmlEdit = New HtmlEditor_Cls
If isEdit Then
SQL = "select * from NC_Article where id=" & Request("id")
Rs.Open SQL, Conn, 1, 1
DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
'If Err.Number <> 0 Then Response.Write "数据库出错"
classid = CStr(Rs("classid"))
rootid = CStr(Rs("rootid"))
ArticleTitle = "编辑文章"
Else
ArticleTitle = "添加文章"
End If
Response.Write "<script src=images/checksave.js type=text/javascript></script>"
Response.Write "<div onkeydown=CtrlEnter()>"
Response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" class=""tableBorder"">"
Response.Write "<form name=""myform"" method=""post"" action=""admin_article.asp"" onSubmit=""return CheckArticle(this)"">"
Response.Write " <input type=""Hidden"" name=""action"" value='"
If isEdit Then
Response.Write "modify"
Else
Response.Write "save"
End If
Response.Write "'>"
If CInt(DownsysClass.Setting(19)) = 1 Then
Response.Write Chr(9) & Chr(9) & " <input type=""hidden"" name=""content1"" id=Body value="""
If isEdit Then
Response.Write Server.HTMLEncode(Rs("Content"))
End If
Response.Write """>"
Response.Write Chr(9) & Chr(9) & " "
End If
If isEdit Then
Response.Write " <input type=""Hidden"" name=""id"" value='"
Response.Write CStr(Request("id"))
Response.Write "'>"
End If
Response.Write " <tr>"
Response.Write " <th colspan=""2"">"
Response.Write ArticleTitle
Response.Write " 注意事项</th>"
Response.Write " </tr>"
Response.Write "<tr>"
Response.Write "<td colspan=""2"" class=""forumRowHighlight"">"
Response.Write "<p><B>注意</B>:<BR>①添加文章时请先选择分类,不能选择一级分类做为文章内容分类;<BR>"
Response.Write "②添加或者修改文章时需要HTML语法支持,请在基本设置开启HTML编辑器,文本编辑器会过滤所有的HTML标签;如果您以前添加的文章使用了HTML编辑器,请修改的时候一定要使用HTML编辑器;<BR>"
Response.Write "③HTML编辑器和文本编辑器都不支持UBB代码。"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write " <tr>"
Response.Write " <th colspan=""2"">"
Response.Write ArticleTitle
Response.Write "</th>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td width=""20%"" height=""22"" align=""right"" nowrap class=""forumRowHighlight"">文章分类:</td>"
Response.Write " <td width=""80%"" class=""forumRow"">"
srtClassList = DownsysClass.ClassJumpList
srtClassList = Replace(srtClassList, "{ClassID=" & Request("classid") & "}", "selected")
Response.Write srtClassList
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">文章标题:</td>"
Response.Write " <td class=""forumRow""><input name=""topic"" type=""text"" id=""topic"" size=""60"" value="""
If isEdit Then
Response.Write Rs("title")
End If
Response.Write """></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">文章类型:</td>"
Response.Write " <td class=""forumRow"">"
ArticleType = Split(DownsysClass.Setting(36), ",")
For i = 0 To UBound(ArticleType)
Response.Write "<input type=""radio"" name=""ArticleType"" value=""" & Trim(ArticleType(i)) & """ "
If isEdit Then
If ArticleType(i) = Rs("ArticleType") Then Response.Write " checked"
Else
If i = 0 Then Response.Write " checked"
End If
Response.Write ">" & Trim(ArticleType(i)) & " "
If i = 6 Then Response.Write "<br>"
Next
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td class=""forumHeaderBackgroundAlternate"" height=""22"" colspan=""2"" align=""center""><font color=#FFFFFF><B>"
If CInt(DownsysClass.Setting(19)) = 1 Then
Response.Write "HTML编辑器 (不支持UBB代码)"
Else
Response.Write "您现在使用的编辑器不支持HTML语法,如果需要HTML语法支持,请在基本设置开启HTML编辑器功能。"
End If
Response.Write " </B></fort></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td class=""forumRow"" colspan=""2"" align=""center"">"
If CInt(DownsysClass.Setting(19)) = 1 Then
Response.Write Chr(9)
NC_HtmlEdit.Init_HtmlEditor
Response.Write Chr(9)
Else
Response.Write Chr(9) & "<textarea name=content1 style=""width:100%;"" rows=18>"
If isEdit Then
Response.Write Rs("Content")
End If
Response.Write "</textarea>"
Response.Write Chr(9)
End If
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">文章推荐图片:</td>"
Response.Write " <td class=""forumRow""><input name=""images"" id=image1 type=""text"" size=""60"" value="""
If isEdit Then
Response.Write Rs("images")
End If
Response.Write """></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td colspan=2 class=""forumRow""><iframe name=""image"" frameborder=0 width=100% height=42 scrolling=no src=upfile.asp?type=image&upnum=1></iframe></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">文章作者:</td>"
Response.Write " <td class=""forumRow""><input name=""writer"" type=""text"" size=""35"" "
If isEdit Then
Response.Write "value="""
Response.Write Rs("writer")
Response.Write """"
End If
Response.Write "></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">文章来源:</td>"
Response.Write " <td class=""forumRow""><input name=""source"" type=""text"" size=""35"" "
If isEdit Then
Response.Write "value="""
Response.Write Rs("source")
Response.Write """"
Else
Response.Write "onblur=""if (value ==''){value='"
Response.Write DownsysClass.Setting(0)
Response.Write "'}"" onmouseover=this.focus() onfocus=this.select() onclick=""if(this.value=='"
Response.Write DownsysClass.Setting(0)
Response.Write "')this.value=''"" value="""
Response.Write DownsysClass.Setting(0)
Response.Write """"
End If
Response.Write "></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""21"" align=""right"" class=""forumRowHighlight"">是否置顶:</td>"
Response.Write " <td class=""forumRow""> <input name=""isTop"" type=""radio"" value=""0"" "
If isEdit Then
If CInt(Rs("isTop")) = 0 Then
Response.Write "checked"
End If
Else
Response.Write "checked"
End If
Response.Write ">"
Response.Write " 取消置顶 <input type=""radio"" name=""isTop"" value=""1"" "
If isEdit Then
If CInt(Rs("isTop")) = 1 Then
Response.Write "checked"
End If
End If
Response.Write ">"
Response.Write " 文章置顶</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""21"" align=""right"" class=""forumRowHighlight"">是否推荐:</td>"
Response.Write " <td class=""forumRow""> <input name=""isCommend"" type=""radio"" value=""0"" "
If isEdit Then
If CInt(Rs("isCommend")) = 0 Then
Response.Write "checked"
End If
Else
Response.Write "checked"
End If
Response.Write ">"
Response.Write " 不推荐 <input type=""radio"" name=""isCommend"" value=""1"" "
If isEdit Then
If CInt(Rs("isCommend")) = 1 Then
Response.Write "checked"
End If
End If
Response.Write ">"
Response.Write " 推荐 "
If isEdit Then
Response.Write "<input name=""upinfotime"" type=""checkbox"" value=""yes"">更新时间"
End If
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""21"" align=""right"" class=""forumRowHighlight"">是否图文:</td>"
Response.Write " <td class=""forumRow""> <input name=""isImg"" type=""radio"" value=""0"" "
If isEdit Then
If CInt(Rs("isImg")) = 0 Then
Response.Write "checked"
End If
Else
Response.Write "checked"
End If
Response.Write ">"
Response.Write " 不是 <input type=""radio"" name=""isImg"" value=""1"" "
If isEdit Then
If CInt(Rs("isImg")) = 1 Then
Response.Write "checked"
End If
End If
Response.Write ">"
Response.Write " 是 "
Response.Write Chr(9) & " "
If CInt(DownsysClass.Setting(5)) = 0 Then Response.Write "<input type=checkbox name='isCreateHtml' value='yes' checked> 同时生成(HTML)"
Response.Write Chr(9) & " </td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight""> </td>"
Response.Write " <td align=""center"" class=""forumRow"">"
Response.Write " <input type=button class=button value=""查看内容长度"" name=Button onclick=""checklength(document.myform);""> "
Response.Write " <input type=reset name=Submit2 class=button value=""清 除"" onclick=""ClearReset()""> "
Response.Write " <input type=Submit class=button value=""提 交"" name=Submit> "
Response.Write " </td>"
Response.Write " </tr></form>"
Response.Write "</table>"
Response.Write "</div>"
If CInt(DownsysClass.Setting(19)) = 0 Then
Response.Write "<Script language=javascript>" & vbCrLf
Response.Write "<!--//" & vbCrLf
Response.Write "document.myform.content1.value = ubbcode(document.myform.content1.value);" & vbCrLf
Response.Write "function ubbcode(temp) {" & vbCrLf
Response.Write "temp = temp.replace(/<br>/ig,""\n"");" & vbCrLf
Response.Write "temp = temp.replace(/<p>/ig,""\n"");" & vbCrLf
Response.Write "temp = temp.replace(/<\/p>/ig,""\n"");" & vbCrLf
Response.Write "return (temp);" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "function ClearReset()" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write " document.myform.content1.value = '';" & vbCrLf
Response.Write " focus();" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "function checklength(theform)" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write " alert(""您的内容目前有 ""+theform.content1.value.length+"" 字节。"");" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->" & vbCrLf
Response.Write "</Script>" & vbCrLf
End If
Set NC_HtmlEdit = Nothing
If isEdit Then
Rs.Close
Set Rs = Nothing
End If
End Sub
Private Sub checksave()
If Trim(Request.Form("topic")) = "" Then
Founderr = True
ErrMsg = ErrMsg + "<li>文章标题不能为空!</li>"
Exit Sub
End If
If Trim(Request.Form("classid")) = "" Then
Founderr = True
ErrMsg = ErrMsg + "<li>文章分类不能为空!</li>"
Exit Sub
Else
strClassid = Split(Trim(Request.Form("Classid")), ",")
End If
If Trim(Request.Form("source")) = "" Then
source = "不详"
Else
source = Trim(Request.Form("source"))
End If
If Trim(Request.Form("writer")) = "" Then
writer = "不详"
Else
writer = Trim(Request.Form("writer"))
End If
If Trim(Request.Form("content1")) = "" Then
Founderr = True
ErrMsg = ErrMsg + "<li>文章内容不能为空!</li>"
Exit Sub
End If
If CInt(DownsysClass.Setting(19)) = 1 Then
TxtContent = Request.Form("content1")
Else
TxtContent = DownsysClass.HTMLEncodes(Request.Form("content1"))
End If
End Sub
Private Sub saveAdd()
Call checksave
If Founderr = False Then
SQL = "select * from NC_Article where (id is null)"
Rs.Open SQL, Conn, 1, 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -