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

📄 printer.asp

📁 电子商务网络购物系统
💻 ASP
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<!--#include file="functions/datetime.asp" -->
<!--#include file="includes/emoticons.asp" -->
<!--#include file="functions/formatpost.asp" -->
<!--#include file="functions/editpost.asp" -->
<%
Response.Buffer = True

Function formatTextQuote(ByVal strMessage)

	Dim strQuotedAuthor 
	Dim strQuotedMessage
	Dim lngStartPos
	Dim lngEndPos
	Dim strBuildQuote
	Dim strOriginalQuote
	Do While InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0
		lngStartPos = InStr(1, strMessage, "[QUOTE=", 1) + 7
		lngEndPos = InStr(lngStartPos, strMessage, "]", 1)
		If lngEndPos - lngStartPos =< 6 Then lngEndPos = lngStartPos + 6
		If lngStartPos > 6 AND lngEndPos > 0 Then
			strQuotedAuthor = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
		End If
		lngStartPos = lngStartPos + Len(strQuotedAuthor) + 1
		lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1)
		If lngEndPos - lngStartPos =< 0 Then lngEndPos = lngStartPos + Len(strQuotedAuthor)
		If lngEndPos > lngStartPos Then
			strQuotedMessage = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
			strQuotedAuthor = Replace(strQuotedAuthor, """", "", 1, -1, 1)
			strBuildQuote = "<blockquote><strong>" & strQuotedAuthor & " 原著:</strong><br />"
			strBuildQuote = strBuildQuote & vbCrLf & "<hr />" & strQuotedMessage & "<hr />"
			strBuildQuote = strBuildQuote & vbCrLf & "</blockquote>"
		End If
		lngStartPos = InStr(1, strMessage, "[QUOTE=", 1)
		lngEndPos = InStr(lngStartPos, strMessage, "[/QUOTE]", 1) + 8
		If lngEndPos - lngStartPos =< 7 Then lngEndPos = lngStartPos + Len(strQuotedAuthor) + 8
		strOriginalQuote = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
		If strBuildQuote <> "" Then
			strMessage = Replace(strMessage, strOriginalQuote, strBuildQuote, 1, -1, 1)
		Else
			strMessage = Replace(strMessage, strOriginalQuote, Replace(strOriginalQuote, "[", "&#91;", 1, -1, 1), 1, -1, 1)
		End If
	Loop
	formatTextQuote = strMessage
End Function

Dim strForumName
Dim strForumDescription
Dim lngTopicID	
Dim strSubject	
Dim strUsername 
Dim dtmTopicDate
Dim strMessage	

lngTopicID = 0	
lngTopicID = CLng(Request.QueryString("tid"))
If lngTopicID = 0 Then
	Set rsConn = Nothing
	adoCon.Close
	Set adoCon = Nothing
	Response.Redirect "index.asp"
End If

strSQL = "SELECT timespost.Message, timespost.msgdtm, timespost.dissign, timesbbs.bbsname, timesbbs.bbsdescrip, timesuser.Username, timesuser.Signature, timestopic.Subject "
strSQL = strSQL & "FROM (timesbbs INNER JOIN timestopic ON timesbbs.bbsid = timestopic.bbsid) INNER JOIN (timesuser INNER JOIN timespost ON timesuser.userid = timespost.userid) ON timestopic.topicid = timespost.topicid "
strSQL = strSQL & "WHERE (((timespost.topicid)=" & lngTopicID & ")) "
strSQL = strSQL & "ORDER by timespost.msgdtm ASC;"
rsConn.Open strSQL, adoCon
If rsConn.EOF Then
	strSubject = strNoThreads
Else
	strSubject = rsConn("Subject")
End If
%>

<html>
<head>


<title>可打印的版本</title>
<!--#include file="includes/skin.asp" -->
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#0000CC" alink="#FF0000">
<table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td align="center"><a href="javascript:onClick=window.print()">打印页面</a> | <a href="JavaScript:onClick=window.close()">关闭窗口</a></td>
  </tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td> <br />
      <%
If rsConn.EOF Then
%>
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
          <td align="center" height="66"><font size="4"><% = strNoThreads %></font></td>
        </tr>
      </table><%
Else
	strMessage = rsConn("Message")
	strUsername = rsConn("Username")
	dtmTopicDate = CDate(rsConn("msgdtm"))
	strForumName = rsConn("bbsname")
	strForumDescription = rsConn("bbsdescrip")
	If InStr(1, strMessage, "<edited>", 1) Then strMessage = removeEditorAuthor(strMessage)
	If rsConn("dissign") Then
		strMessage = strMessage & "<!-- Signature --><br /><br />-------------<br />" & rsConn("Signature")
	End If
	strMessage = ConvertToText(strMessage)
	If InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatTextQuote(strMessage)
    %>
      <font size="4"><strong><% = strSubject %></strong></font> <br />
      <br />
      <strong>打印: </strong><% = strWebsiteName %>
      <br /><strong>论坛名字: </strong> <% = strForumName %>
      <br /><strong>论坛描述: </strong> <% = strForumDescription %>
      <br /><strong>URL: </strong><% = strForumPath %>/post.asp?tid=<% = lngTopicID %>
      <br /><strong>打印日期: </strong><% = DateFormat(Now(), saryDateTimeData) & "  " & TimeFormat(Now(), saryDateTimeData) %>
      <br /><br /><br />
      <font size="4"><strong>主题:</strong> <% = strSubject %></font>
      <hr /><br />
      <strong>发表人:</strong> <% = strUsername %>
      <br /><strong>主题:</strong> <% = strSubject %>
      <br /><strong>发表日期:</strong> <% = DateFormat(dtmTopicDate, saryDateTimeData) %>&nbsp;<% = TimeFormat(dtmTopicDate, saryDateTimeData) %>
      <br /><br />
      <% = strMessage %>
      <br /><br /><br /><%
	rsConn.MoveNext

      	If NOT rsConn.EOF Then Response.Write "<strong><font size=""4"">回复: </font></strong>"
      	%>
      <hr /><%
	Do While NOT rsConn.EOF
		strMessage = rsConn("Message")
		strUsername = rsConn("Username")
		dtmTopicDate = CDate(rsConn("msgdtm"))
		If InStr(1, strMessage, "<edited>", 1) Then strMessage = removeEditorAuthor(strMessage)
		If rsConn("dissign") Then
			strMessage = strMessage & "<!-- Signature --><br /><br />-------------<br />" & rsConn("Signature")
		End If
		strMessage = ConvertToText(strMessage)
		If InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatTextQuote(strMessage)
	      %>
      <br /><% = strMessage %><br/>
      <strong>发表人:</strong> <% = strUsername %>
      <br />
      <strong>发表日期:</strong> <% = DateFormat(dtmTopicDate, saryDateTimeData) %>&nbsp;<% = TimeFormat(dtmTopicDate, saryDateTimeData) %>
      <br /><br />
      <hr />
      <%
		rsConn.MoveNext
	Loop
%>
    </td>
  </tr>
</table>
<br />
<%
End If
rsConn.Close
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
%>
<br />
<table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td align="center"><a href="javascript:onClick=window.print()">打印页面</a> | <a href="JavaScript:onClick=window.close()">关闭窗口</a></td>
  </tr>
</table>
<br/><br/>
<!-- #include file="includes/footer.asp" -->

⌨️ 快捷键说明

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