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

📄 item.asp

📁 一个ASP网站博克程序
💻 ASP
字号:
<%

	Class Items
	
		'编写日志界面
		Public Sub ItemInsert()
			Dim objCategory
			Set objCategory = New Category
			%><table width="580" cellpadding="0" cellspacing="0" border="0"><%
			%><form name="items" action="ItemInsertUpdate.asp" method="post"><%
			%><tr valign="middle"><%
			%><td align="right" width="80" class="guider">日志标题&nbsp;</td><%
			%><td align="left" class="guider">&nbsp;<% objCategory.CategorySelect 0 %>&nbsp; <input type="text" name="label" size="40" maxlength="50"></td><%
			%></tr><%
			%><tr align="center" valign="middle"><%
			%><td width="100%" colspan="2" height="360" class="guider"><iframe id="editor" src="../editor/ewebeditor.asp?id=value&style=standard" frameborder="0" scrolling="no" width="560" height="350"></iframe></td><%
			%></tr><%
			%><tr align="left" valign="middle"><%
			%><td width="100%" colspan="2" class="guider"><textarea name="value" style="display:none;"></textarea><% If Session("UsrLevel") = True Then %>&nbsp; <input type="checkbox" name="top" value="1" class="check">置顶<% End If %>&nbsp; <input type="checkbox" name="lock" value="1" class="check">禁止回复&nbsp; <input type="checkbox" name="hide" value="1" class="check">隐藏日志&nbsp; <input type="submit" value="保存日志" class="button" onclick="return (items.label.value!=''&&items.category.value!='0'&&editor.getHTML()!='');"></td><%
			%></tr><%
			%></form><%
			%></table><%
			Set objCategory = Nothing
		End Sub
		
		'编辑日志界面
		Public Sub ItemModify(intItem, intMember)
			Set objDBMS = New LarrixDBMS
			objDBMS.Open "SELECT * FROM [Items] WHERE [ItemID]=" & intItem & " AND [MemberID]=" & intMember, 1
			If Not (objDBMS.objRSET.BOF And objDBMS.objRSET.EOF) Then
				%><table width="580" cellpadding="0" cellspacing="0" border="0"><%
				%><form name="items" action="ItemModifyUpdate.asp" method="post"><%
				%><input type="hidden" name="id" value="<% = objDBMS.objRSET("ItemID") %>"><%
				%><tr valign="middle"><%
				%><td align="right" width="80" class="guider">日志标题&nbsp;</td><%
				%><td align="left" class="guider">&nbsp;<% objCategory.CategorySelect objDBMS.objRSET("CategoryID") %>&nbsp; <input type="text" name="label" size="40" maxlength="50" value="<% = objDBMS.objRSET("ItemLAB") %>"></td><%
				%></tr><%
				%><tr align="center" valign="middle"><%
				%><td width="100%" colspan="2" height="360"><iframe id="editor" src="../editor/ewebeditor.asp?id=value&style=standard" frameborder="0" scrolling="no" width="560" height="350"></iframe></td><%
				%></tr><%
				%><tr align="left" valign="middle"><%
				%><td width="100%" colspan="2" class="guider"><textarea name="value" style="display:none;"><% = objDBMS.objRSET("ItemVAL") %></textarea><% If Session("UsrLevel") = True Then %>&nbsp; <input type="checkbox" name="top" value="1" class="check"<% If objDBMS.objRSET("ItemTOP") Then %> checked<% End If %>>置顶<% End If %>&nbsp; <input type="checkbox" name="lock" value="1" class="check"<% If objDBMS.objRSET("ItemLOC") Then %> checked<% End If %>>禁止回复&nbsp; <input type="checkbox" name="hide" value="1" class="check"<% If objDBMS.objRSET("ItemHID") Then %> checked<% End If %>>隐藏日志&nbsp; <input type="submit" value="保存日志" class="button" onclick="return (items.label.value!=''&&items.category.value!='0'&&editor.getHTML()!='');"></td><%
				%></tr><%
				%></form><%
				%></table><%
			End If
			objDBMS.Close
			Set objDBMS = Nothing
		End Sub
	
		'日志管理列表
		Public Sub ItemExplor(strSQL, intPage)
			Dim objDBMS
			Dim objComment
			Dim intCount
			Set objDBMS = New LarrixDBMS
			objDBMS.Open strSQL, 1
			If objDBMS.objRSET.BOF And objDBMS.objRSET.EOF Then
				%><table width="580" cellpadding="0" cellspacing="0" border="0"><%
				%><tr align="left" valign="middle"><%
				%><td width="100%" class="ground">当前还没有任何日志!</td><%
				%></tr><%
				%></table><%
			Else
				objDBMS.objRSET.PageSize = 25
				If Trim(Request.QueryString("page")) = "" Or IsNumeric(Trim(Request.QueryString("page"))) = False Then
					intPage = 1
				Else
					intPage = CInt(Trim(Request.QueryString("page")))
					If intPage < 1 Then
						intPage = 1
					End If
					If intPage > objDBMS.objRSET.PageCount Then
						intPage = objDBMS.objRSET.PageCount
					End If
				End If
				objDBMS.objRSET.AbsolutePage = intPage
				For intCount = 1 To objDBMS.objRSET.PageSize
					If objDBMS.objRSET.EOF Then
						Exit For
					End If
					%><table width="580" cellpadding="0" cellspacing="0" border="0"><%
					%><tr align="left" valign="middle"><%
					%><td width="100%" class="weblog"><% = objDBMS.objRSET("ItemDTM") %>:<% = objDBMS.objRSET("ItemLAB") %></td><%
					%></tr><%
					%><tr align="left" valign="middle"><%
					%><td width="100%" class="ground">分类:<% = objDBMS.objRSET("CategoryLAB") %> &nbsp;|&nbsp; 作者:<% = objDBMS.objRSET("MemberUID") %> &nbsp;|&nbsp; 阅读:<% = objDBMS.objRSET("ItemNUM") %> &nbsp;|&nbsp; 评论:<% Set objComment = New Comment %><% = objComment.CommentCount(objDBMS.objRSET("ItemID")) %><% Set objComment = Nothing %> &nbsp;|&nbsp; <a href="ItemModify.asp?id=<% = objDBMS.objRSET("ItemID") %>">编辑</a> &nbsp;|&nbsp; <a href="ItemDelete.asp?id=<% = objDBMS.objRSET("ItemID") %>">删除</a></td><%
					%></tr><%
					%><tr align="left" valign="middle"><%
					%><td width="100%" class="ground"><% = Left(objDBMS.objRSET("ItemVAL"), 250) %><br>&nbsp;<br><a href="Item.asp?id=<% = objDBMS.objRSET("ItemID") %>">阅读全部内容...</a></td><%
					%></tr><%
					%></table><%
					%><br>&nbsp;<br><%
					objDBMS.objRSET.MoveNext
				Next
				If intPage > 1 Then
					%><a href="Default.asp?page=1">首页</a>&nbsp; <a href="Default.asp?page=<% = intPage - 1 %>">上一页</a>&nbsp; <%
				Else
					%>首页&nbsp; 上一页&nbsp; <%
				End If
				If intPage > 6 Then
					%>...&nbsp; <%
				End If
				For intCount = intPage - 5 To intPage + 5
					If intCount >= 1 And intCount <= objDBMS.objRSET.PageCount Then
						%><a href="Default.asp?page=<% = intCount %>"><% = intCount %></a>&nbsp; <%
					End If
				Next 
				If intPage < objDBMS.objRSET.PageCount - 5 Then
					%>...&nbsp; <%
				End If
				If intPage < objDBMS.objRSET.PageCount Then
					%><a href="Default.asp?page=<% = intPage + 1 %>">下一页</a>&nbsp; <a href="Default.asp?page=<% = objDBMS.objRSET.PageCount %>">尾页</a><%
				Else
					%>下一页&nbsp; 尾页<%
				End If
			End If
			objDBMS.Close
			Set objDBMS = Nothing
		End Sub
		
		'阅读日志
		Public Sub ItemSelect(intItem)
			Dim objDBMS
			Dim objComment
			Set objDBMS = New LarrixDBMS
			objDBMS.Open "SELECT [Items].*,[Members].[MemberUID],[Categories].[CategoryLAB] FROM [Items],[Members],[Categories] WHERE [Items].[MemberID]=[Members].[MemberID] AND [Items].[CategoryID]=[Categories].[CategoryID] AND [ItemID]=" & intItem & " AND [Members].[MemberID]=" & Session("Passport"), 1
			If Not (objDBMS.objRSET.BOF And objDBMS.objRSET.EOF) Then
				%><table width="580" cellpadding="0" cellspacing="0" border="0"><%
				%><tr align="left" valign="middle"><%
				%><td width="100%" class="weblog"><% = objDBMS.objRSET("ItemDTM") %>:<% = objDBMS.objRSET("ItemLAB") %></td><%
				%></tr><%
				%><tr align="left" valign="middle"><%
				%><td width="100%" class="ground">分类:<% = objDBMS.objRSET("CategoryLAB") %> &nbsp;|&nbsp; 作者:<% = objDBMS.objRSET("MemberUID") %> &nbsp;|&nbsp; 阅读:<% = objDBMS.objRSET("ItemNUM") %> &nbsp;|&nbsp; 评论:<% Set objComment = New Comment %><% = objComment.CommentCount(objDBMS.objRSET("ItemID")) %><% Set objComment = Nothing %> &nbsp;|&nbsp; <a href="ItemModify.asp?id=<% = objDBMS.objRSET("ItemID") %>">编辑</a> &nbsp;|&nbsp; <a href="ItemDelete.asp?id=<% = objDBMS.objRSET("ItemID") %>">删除</a></td><%
				%></tr><%
				%><tr align="left" valign="middle"><%
				%><td width="100%" class="ground"><% = objDBMS.objRSET("ItemVAL") %></td><%
				%></tr><%
				%></table><%
				If objDBMS.objRSET("ItemLOC") = False Then
					%><br>&nbsp;<br><%
					Set objComment = New Comment
					objComment.CommentExplor Trim(Request.QueryString("id"))
					Set objComment = Nothing
				End If
			End If
			objDBMS.Close
			Set objDBMS = Nothing
		End Sub
		
		'因删除会员导致的批量删除日志
		Public Sub MemberDelete(intMember)
			Dim objDBMS
			Dim objComment
			Set objDBMS = New LarrixDBMS
			objDBMS.Open "SELECT * FROM [Items] WHERE [MemberID]=" & intMember, 2
			If Not (objDBMS.objRSET.BOF And objDBMS.objRSET.EOF) Then
				While Not objDBMS.objRSET.EOF
					Set objComment = New Comment
					objComment.ItemDelete objDBMS.objRSET("ItemID")
					Set objComment = Nothing
					objDBMS.objRSET.Delete
					objDBMS.objRSET.MoveNext
				Wend
				objDBMS.objRSET.UpdateBatch
			End If
			objDBMS.Close
			Set objDBMS = Nothing
		End Sub
		
		'因删除分类导致的批量删除日志
		Public Sub CategoryDelete(intCategory)
			Dim objDBMS
			Dim objComment
			Set objDBMS = New LarrixDBMS
			objDBMS.Open "SELECT * FROM [Items] WHERE [CategoryID]=" & intCategory, 2
			If Not (objDBMS.objRSET.BOF And objDBMS.objRSET.EOF) Then
				While Not objDBMS.objRSET.EOF
					Set objComment = New Comment
					objComment.ItemDelete objDBMS.objRSET("ItemID")
					Set objComment = Nothing
					objDBMS.objRSET.Delete
					objDBMS.objRSET.MoveNext
				Wend
				objDBMS.objRSET.UpdateBatch
			End If
			objDBMS.Close
			Set objDBMS = Nothing
		End Sub
		
	End Class

%>

⌨️ 快捷键说明

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