Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Need script to output Snitz topics
 New Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 April 2016 :  03:28:03  Show Profile
Sorry about that. Change lines 72 and 123 to say:
			strWrite = "<html><head><title>" & strForumTitle & " (© 2016) - " & rsWrite("T_SUBJECT") & "</title>"

Edited by - Carefree on 30 April 2016 18:43:14
Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 17 April 2016 :  22:21:00  Show Profile
Thanks for that!

New task: On top of the output htm file, I tried to write Category Name and Forum Name before Topic Subject, code as follows:

strWrite = strWrite & " & rsWrite("FORUM_ID") & " > " & rsWrite("CAT_ID") & " > " & rsWrite("T_SUBJECT") & "

Although it worked, it only displayed ID numbers and the Topic Name: 107 > 20 > Topic Subject

How can I write the actual names? e.g. Category Name > Forum Name > Topic Subject
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 20 April 2016 :  04:26:23  Show Profile
You'll want something like this. Again, change the sections colored red to the cat id.


<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-16 Michael Anderson, Pierre Gorissen,
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute and/or modify it under the 
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; version 2 or later of the License.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in the 
'## scripts and in the HTML output.  The "powered by" text/logo with a link back 
'## to http://forum.snitz.com in the footer of the pages MUST remain visible when 
'## the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful, but WITHOUT ANY 
'## WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A 
'## PARTICULAR PURPOSE.  See the GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License with this 
'## program; if not, Write to:
'## Free Software Foundation, Inc.
'## 59 Temple Place - Suite 330
'## Boston, MA  02111-1307, USA
'##
'## Support can be obtained from our support forums at:  http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:  manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<%
Response.Buffer = True
Const FSOForReading = 1
Const FSOForWriting = 2
Dim strFPath, TopicFile, strWrite
Response.Write	"			<table border=""0"" width=""100%"">" & vbNewLine & _
	"				<tr>" & vbNewLine & _
	"					<td width=""33%"" align=""left"" nowrap><font family=""" & strDefaultFontFamily & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"					" & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolder,"","align=""absmiddle""") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " Topic Maker</font></td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine & _
	"			<br />" & vbNewLine & _
	"			<table width=""800px;"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
	"				<tr>" & vbNewLine & _
	"					<td bgcolor=""" & strForumCellColor & """>" & vbNewLine
If mLev > 3 Then
	Set	ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	strFPath=Server.MapPath("topics")
	If not objFSO.FolderExists(strFPath) Then
		strErr = "Path: " & strFPath & " does not exist."
		Go_Result strErr
	End If
	strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE FROM " & strTablePrefix & "TOPICS WHERE CAT_ID = (SPECIFY CAT_ID HERE)"
	Set rsWrite = my_Conn.Execute (strSql)
	If Not (rsWrite.BOF Or rsWrite.EOF) Then
		rsWrite.MoveFirst
		strSqlC = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & rsWrite("CAT_ID")
		Set rsCat = my_Conn.Execute(strSqlC)
		If Not rsCat.EOF Then
			strCatName = rsCat("CAT_NAME")
			rsCat.Close
		End If
		Set rsCat = Nothing
		strSqlS = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & rsWrite("FORUM_ID")
		Set rsGetForum = my_Conn.Execute(strSqlS)
		If Not rsGetForum.EOF Then
			rsGetForum.MoveFirst
			forum_name = rsGetForum("F_SUBJECT")
			themessage = rsWrite("T_MESSAGE")
			strWrite = strWrite & "<html><head><title>" & strForumTitle & " (© 2016) - " & strCatName & " " & forum_name & " " & rsWrite("T_SUBJECT") & "</title>"
			strWrite = strWrite & "<meta http-equiv=""Refresh"" content=""10; URL=" & strForumURL & "topic.asp?TOPIC_ID=" & Write_this & """>"
			strWrite = strWrite & "<meta name=""Description"" CONTENT=""" & strForumTitle & " (© 2016) - " & rsWrite("T_SUBJECT") & """>"
			strWrite = strWrite & "<meta name=""Keywords"" CONTENT=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """>"
			strWrite = strWrite & "</head><body>"
			strWrite = strWrite & "<table width=""100%"" border=""1"" cellpadding=""2"" cellspacing=""1"" bordercolor=""#3366CC""><tr><td align=""center"" colspan=""2""><b>" & rsWrite("T_SUBJECT") & "</b></td></tr>"
			strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWrite("T_AUTHOR")) & "</b></td>"
			strWrite = strWrite & "<td>" & themessage & "</td></tr>"
			strSql2 = "SELECT R_AUTHOR, R_MESSAGE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & Write_this
			Set rsWriteReply = my_Conn.Execute(strSql2)
			If Not rsWriteReply.EOF Then
				rsWriteReply.MoveFirst
				Do Until rsWriteReply.EOF
					strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & "</b></td>"
					strWrite = strWrite & "<td>" & FormatStr(rsWriteReply("R_MESSAGE")) & "</td></tr>"
					rsWriteReply.MoveNext
				Loop
				rsWriteReply.Close
			End If
			Set rsWriteReply = Nothing
			strWrite = strWrite & "</table></body></html>"
			TopicFile = strFPath & "/" & write_this	& ".htm"
			If objFSO.FileExists(TopicFile) Then 
				objFSO.DeleteFile(TopicFile)
			End If
			Set	WriteTopicFile = ObjFSO.CreateTextFile(TopicFile, FSOForWriting, True)
			WriteTopicFile.WriteLine strWrite
			WriteTopicFile.Close
			Set WriteTopicFile = Nothing
			Set ObjTopicFile = Nothing
			Response.Write "<b>Topic number	</b>"	&	write_this & ":<b> complete.</b><br />"
		End If
	End If
	Set rsWrite = Nothing
	Set ObjFSO = Nothing
	Set	ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	strFPath=Server.MapPath("topics")
	If not objFSO.FolderExists(strFPath) Then
		strErr = "Path: " & strFPath & " does not exist."
		Go_Result strErr
	End If
	strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE FROM " & strTablePrefix & "A_TOPICS WHERE CAT_ID = (SPECIFY CAT_ID HERE)"
	Set rsWrite = my_Conn.Execute (strSql)
	If Not (rsWrite.BOF Or rsWrite.EOF) Then
		rsWrite.MoveFirst
		strSqlC = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & rsWrite("CAT_ID")
		Set rsCat = my_Conn.Execute(strSqlC)
		If Not rsCat.EOF Then
			strCatName = rsCat("CAT_NAME")
			rsCat.Close
		End If
		Set rsCat = Nothing
		strSqlS = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & rsWrite("FORUM_ID")
		Set rsGetForum = my_Conn.Execute(strSqlS)
		If Not rsGetForum.EOF Then
			rsGetForum.MoveFirst
			forum_name = rsGetForum("F_SUBJECT")
			themessage = rsWrite("T_MESSAGE")
			strWrite = strWrite & "<html><head><title>" & strForumTitle & " (© 2016) - " & strCatName & " " & forum_name & " " & rsWrite("T_SUBJECT") & "</title>"
			strWrite = strWrite & "<meta http-equiv=""Refresh"" content=""10; URL=" & strForumURL & "topic.asp?TOPIC_ID=" & Write_this & """>"
			strWrite = strWrite & "<meta name=""Description"" CONTENT=""" & strForumTitle & " (© 2016) - " & rsWrite("T_SUBJECT") & """>"
			strWrite = strWrite & "<meta name=""Keywords"" CONTENT=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """>"
			strWrite = strWrite & "</head><body>"
			strWrite = strWrite & "<table width=""100%"" border=""1"" cellpadding=""2"" cellspacing=""1"" bordercolor=""#3366CC""><tr><td align=""center"" colspan=""2""><b>" & rsWrite("T_SUBJECT") & "</b></td></tr>"
			strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWrite("T_AUTHOR")) & "</b></td>"
			strWrite = strWrite & "<td>" & themessage & "</td></tr>"
			strSql2 = "SELECT R_AUTHOR, R_MESSAGE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & Write_this
			Set rsWriteReply = my_Conn.Execute(strSql2)
			If Not rsWriteReply.EOF Then
				rsWriteReply.MoveFirst
				Do Until rsWriteReply.EOF
					strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & "</b></td>"
					strWrite = strWrite & "<td>" & FormatStr(rsWriteReply("R_MESSAGE")) & "</td></tr>"
					rsWriteReply.MoveNext
				Loop
				rsWriteReply.Close
			End If
			Set rsWriteReply = Nothing
			strWrite = strWrite & "</table></body></html>"
			TopicFile = strFPath & "/" & write_this	& ".htm"
			If objFSO.FileExists(TopicFile) Then 
				objFSO.DeleteFile(TopicFile)
			End If
			Set	WriteTopicFile = ObjFSO.CreateTextFile(TopicFile, FSOForWriting, True)
			WriteTopicFile.WriteLine strWrite
			WriteTopicFile.Close
			Set WriteTopicFile = Nothing
			Set ObjTopicFile = Nothing
			Response.Write "<b>Topic number	</b>"	&	write_this & ":<b> complete.</b><br />"
		End If
	End If
	Set rsWrite = Nothing
	Set ObjFSO = Nothing
Else
	Response.Write "You are not authorized to do this action."
End If
Response.Write	"					</td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine
WriteFooter
Function Go_Result(message)
	Response.Write 	"      <br /><div align=""center""><font family=""" & strDefaultFontFamily & """ size=""" & strDefaultFontSize & """ color=""" & strHiliteFontColor & """>" & message & "</font></div>"
	WriteFooter
	Response.End
End Function
%>
Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 25 April 2016 :  15:03:48  Show Profile
Produces the following error:
quote:
Microsoft SQL Server Native Client 10.0 error '80040e14'

Incorrect syntax near '='.

/forums/admin_topic_maker.asp, line 89



Are you sure? Elsewhere in the forum code it shows Response.Write:

- chkString(ForumSubject,"display") to write the Forum Name
- chkString(CatName,"display") to write out the Category Name


UPDATE: I'm looking to write a line with just the Forum Name and Topic Name. For example, using this Topic on Snitz:

"Help: General / Current Version (v3.4.xx) >> Need script to output Snitz topics"

I'm currently using this code:
strWrite = strWrite & "<p><b>" & rsWrite("FORUM_ID") & " >> " & rsWrite("T_SUBJECT") & "</b></p>"
But it writes the the Forum ID Number and then Topic Name:

"111 >> Need script to output Snitz topics"

Edited by - Lon2 on 25 April 2016 20:16:35
Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 25 April 2016 :  22:04:51  Show Profile
Never mind, I got it! It was much simplier than I thought.

" & forum_name & "
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 April 2016 :  10:29:22  Show Profile
quote:
Originally posted by Lon2

Never mind, I got it! It was much simplier than I thought.

" & forum_name & "



Isn't that what I wrote?

			strWrite = strWrite & "<html><head><title>" & strForumTitle & " (© 2016) - " & strCatName & " " & forum_name & " " & rsWrite("T_SUBJECT") & "</title>"

Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 29 April 2016 :  18:02:49  Show Profile
Sorry I must've missed it because I couldn't get your last script to work so I was working with a previous.

I just noticed Topic Replies are not writing for Archived Topics. It could be something I did. All works great except no Archived Topic Replies. Can you see what I missed?

<%Server.ScriptTimeout = 10000%>

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->

<%if (mLev = 4) then
AdminAllowed = 1
else 
AdminAllowed = 0
end if
%>

<%
Const FSOForReading = 1
Const FSOForWriting = 2
Dim strFPath, TopicFile, strWrite
If mLev > 3 Then
	Set	ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	strFPath=Server.MapPath("topics")
	If not objFSO.FolderExists(strFPath) Then
		strErr = "Path: " & strFPath & " does not exist."
		Go_Result strErr
	End If
	strSql = "SELECT CAT_ID FROM " & strTablePrefix & "TOPICS"
	Set countrs = my_Conn.Execute(strSql)
	strTotalTopics = 0
	If Not countrs.EOF Then
		countrs.MoveFirst
		Do Until countrs.EOF
			strTotalTopics = strTotalTopics + 1
			countrs.MoveNext
		Loop
		countrs.Close
	End If
	Set countrs = Nothing
	For Write_this = 1 To strTotalTopics
		strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & Write_this
		Set rsWrite = my_Conn.Execute (strSql)
		If Not (rsWrite.BOF Or rsWrite.EOF) Then
			rsWrite.MoveFirst
			strSqlS = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & rsWrite("FORUM_ID")
			Set rsGetForum = my_Conn.Execute(strSqlS)
			If Not rsGetForum.EOF Then
				rsGetForum.MoveFirst
				forum_name = rsGetForum("F_SUBJECT")
				themessage = rsWrite("T_MESSAGE")
				strWrite = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
				strWrite = strWrite & "<html>"
				strWrite = strWrite & "<head>"
				strWrite = strWrite & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"" />"
				strWrite = strWrite & "<meta name=""description"" content=""" & rsWrite("T_SUBJECT") & " on the Forums"" />"
				strWrite = strWrite & "<meta name=""keywords"" content=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """ />"
				strWrite = strWrite & "<title>" & rsWrite("T_SUBJECT") & " on the Forums</title>"
				strWrite = strWrite & "</head>"
				strWrite = strWrite & "<body>"
				strWrite = strWrite & "<p><b>" & forum_name & " - " & rsWrite("T_SUBJECT") & "</b></p>"
				strWrite = strWrite & "<p><b>" & getMemberName(rsWrite("T_AUTHOR")) & ": </b>" & themessage & "</p>"
				strWrite = strWrite & "<hr>"
				strSql2 = "SELECT R_AUTHOR, R_MESSAGE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & Write_this
				Set rsWriteReply = my_Conn.Execute(strSql2)
				If Not rsWriteReply.EOF Then
					rsWriteReply.MoveFirst
					Do Until rsWriteReply.EOF
						strWrite = strWrite & "<p><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & ": </b>"
						strWrite = strWrite & FormatStr(rsWriteReply("R_MESSAGE")) & "</p>"
						rsWriteReply.MoveNext
					Loop
					rsWriteReply.Close
				End If
				Set rsWriteReply = Nothing
				strWrite = strWrite & "</body>"
				strWrite = strWrite & "</html>"
				TopicFile = strFPath & "/" & write_this & ".htm"
				If objFSO.FileExists(TopicFile) Then 
					objFSO.DeleteFile(TopicFile)
				End If
				Set	WriteTopicFile = ObjFSO.CreateTextFile(TopicFile, FSOForWriting, True)
				WriteTopicFile.WriteLine strWrite
				WriteTopicFile.Close
				Set WriteTopicFile = Nothing
				Set ObjTopicFile = Nothing
			End If
		End If
		Set rsWrite = Nothing
	Next
	Set ObjFSO = Nothing
	Set	ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	strFPath=Server.MapPath("topics")
	If not objFSO.FolderExists(strFPath) Then
		strErr = "Path: " & strFPath & " does not exist."
		Go_Result strErr
	End If
	strSql = "SELECT CAT_ID FROM " & strTablePrefix & "A_TOPICS"
	Set countrs = my_Conn.Execute(strSql)
	strTotalTopics = 0
	If Not countrs.EOF Then
		countrs.MoveFirst
		Do Until countrs.EOF
			strTotalTopics = strTotalTopics + 1
			countrs.MoveNext
		Loop
		countrs.Close
	End If
	Set countrs = Nothing
	For Write_this = 1 To strTotalTopics
		strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE FROM " & strTablePrefix & "A_TOPICS WHERE TOPIC_ID = " & Write_this
		Set rsWrite = my_Conn.Execute (strSql)
		If Not (rsWrite.BOF Or rsWrite.EOF) Then
			rsWrite.MoveFirst
			strSqlS = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & rsWrite("FORUM_ID")
			Set rsGetForum = my_Conn.Execute(strSqlS)
			If Not rsGetForum.EOF Then
				rsGetForum.MoveFirst
				forum_name = rsGetForum("F_SUBJECT")
				themessage = rsWrite("T_MESSAGE")
				strWrite = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
				strWrite = strWrite & "<html>"
				strWrite = strWrite & "<head>"
				strWrite = strWrite & "<meta name=""description"" content=""" & rsWrite("T_SUBJECT") & " on the Forums"" />"
				strWrite = strWrite & "<meta name=""keywords"" content=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """ />"
				strWrite = strWrite & "<title>" & rsWrite("T_SUBJECT") & " from the Forums</title>"
				strWrite = strWrite & "</head>"
				strWrite = strWrite & "<body>"
				strWrite = strWrite & "<p><b>" & forum_name & " - " & rsWrite("T_SUBJECT") & "</b></p>"
				strWrite = strWrite & "<p><b>" & getMemberName(rsWrite("T_AUTHOR")) & ": </b>" & themessage & "</p>"
				strWrite = strWrite & "<hr>"
				strSql2 = "SELECT R_AUTHOR, R_MESSAGE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & Write_this
				Set rsWriteReply = my_Conn.Execute(strSql2)
				If Not rsWriteReply.EOF Then
					rsWriteReply.MoveFirst
					Do Until rsWriteReply.EOF
						strWrite = strWrite & "<p><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & ": </b>" & FormatStr(rsWriteReply("R_MESSAGE")) & "</p><br />"
						strWrite = strWrite & "<hr>"
						rsWriteReply.MoveNext
					Loop
					rsWriteReply.Close
				End If
				Set rsWriteReply = Nothing
				strWrite = strWrite & "</body>"
				strWrite = strWrite & "</html>"
				TopicFile = strFPath & "/" & write_this & ".htm"
				If objFSO.FileExists(TopicFile) Then 
					objFSO.DeleteFile(TopicFile)
				End If
				Set	WriteTopicFile = ObjFSO.CreateTextFile(TopicFile, FSOForWriting, True)
				WriteTopicFile.WriteLine strWrite
				WriteTopicFile.Close
				Set WriteTopicFile = Nothing
				Set ObjTopicFile = Nothing
			End If
		End If
		Set rsWrite = Nothing
	Next
	Set ObjFSO = Nothing
End If
%>

Edited by - Lon2 on 29 April 2016 21:07:14
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 30 April 2016 :  18:23:57  Show Profile
Here's all you should need, starting with the archived topics. I eliminated redundant (using FSO to delete a file which is later told to overwrite anyway) and useless code (e.g., AdminAllowed comparison which has no further purpose and is already satisfied by the mLev check above it, duplicated routine checking for folder existence that we already know is there from topic check, and lines setting Constant variables which can both be replaced with a single word).


<%Server.ScriptTimeout = 10000%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<%
Dim strFPath, TopicFile, strWrite
If mLev > 3 Then
	Set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	strFPath = Server.MapPath("topics")
	strSql = "SELECT CAT_ID FROM " & strTablePrefix & A_"TOPICS"
	countrs = my_Conn.Execute(strSql)
	Set strTotalTopics = 0
	If Not countrs.EOF Then
		countrs.MoveFirst
		Do Until countrs.EOF
			strTotalTopics = strTotalTopics + 1
			countrs.MoveNext
		Loop
		countrs.Close
	End If
	Set countrs = Nothing
	For Write_this = 1 To strTotalTopics
		strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE FROM " & strTablePrefix & "A_TOPICS WHERE TOPIC_ID = " & Write_this
		Set rsWrite = my_Conn.Execute (strSql)
		If Not (rsWrite.BOF Or rsWrite.EOF) Then
			rsWrite.MoveFirst
			strSqlS = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & rsWrite("FORUM_ID")
			Set rsGetForum = my_Conn.Execute(strSqlS)
			If Not rsGetForum.EOF Then
				rsGetForum.MoveFirst
				forum_name = rsGetForum("F_SUBJECT")
				themessage = rsWrite("T_MESSAGE")
				strWrite = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
				strWrite = strWrite & "<html>"
				strWrite = strWrite & "<head>"
				strWrite = strWrite & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"" />"
				strWrite = strWrite & "<meta name=""description"" content=""" & rsWrite("T_SUBJECT") & " on the Forums"" />"
				strWrite = strWrite & "<meta name=""keywords"" content=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """ />"
				strWrite = strWrite & "<title>" & rsWrite("T_SUBJECT") & " on the Forums</title>"
				strWrite = strWrite & "</head>"
				strWrite = strWrite & "<body>"
				strWrite = strWrite & "<p><b>" & forum_name & " - " & rsWrite("T_SUBJECT") & "</b></p>"
				strWrite = strWrite & "<p><b>" & getMemberName(rsWrite("T_AUTHOR")) & ": </b>" & themessage & "</p>"
				strWrite = strWrite & "<hr>"
				strSql2 = "SELECT R_AUTHOR, R_MESSAGE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & Write_this
				Set rsWriteReply = my_Conn.Execute(strSql2)
				If Not rsWriteReply.EOF Then
					rsWriteReply.MoveFirst
					Do Until rsWriteReply.EOF
						strWrite = strWrite & "<p><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & ": </b>"
						strWrite = strWrite & FormatStr(rsWriteReply("R_MESSAGE")) & "</p>"
						rsWriteReply.MoveNext
					Loop
					rsWriteReply.Close
				End If
				Set rsWriteReply = Nothing
				strWrite = strWrite & "</body>"
				strWrite = strWrite & "</html>"
				TopicFile = strFPath & "/" & write_this & ".htm"
				Set WriteTopicFile = ObjFSO.CreateTextFile(TopicFile, True, True)
				WriteTopicFile.WriteLine strWrite
				WriteTopicFile.Close
				Set WriteTopicFile = Nothing
				Set ObjTopicFile = Nothing
			End If
		End If
		Set rsWrite = Nothing
	Next
	Set objFSO = Nothing
End If
%>

Edited by - Carefree on 30 April 2016 18:39:49
Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 01 May 2016 :  18:56:57  Show Profile
Thanks again for that, Carefree!

The script is still not writing Replies to Archived Topics.

My original had both both current and Archived Topics. Would I just remove the 2 instances of "A_" to write the current Topics? I going to try that too and see if Replies show up there...

Update:

Removing the "A_" made the script work 100% for current Topics WITH Replies but with the "A_" the script does NOT write Replies with the Archived Topics. Any ideas?

Edited by - Lon2 on 01 May 2016 19:31:09
Go to Top of Page

Lon2
Junior Member

USA
151 Posts

Posted - 01 May 2016 :  19:57:16  Show Profile
Think I just got it!

Changed: "REPLY" to "A_REPLY"

Thanks a lot for all your help on this! It's very much appreciated!
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07