Author |
Topic |
Lon2
Junior Member
USA
151 Posts |
Posted - 01 April 2016 : 22:01:58
|
Hello, I have a database as well as several backups from a current version of Snitz that's no longer on a web server. The databases are on my desktop SQL Server. I need to create a basic script that will output each topic in the database as a simple html or text file, similarly to what the Snitz "Printer Friendly" feature does but auto generate the files. Where do I start?
Thanks for any help! |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 01 April 2016 : 23:34:53
|
Easiest way would be to create an IIS on your desktop, install basic Sitz, and link to those databases. Then you could use an existing Snitz mod for the purpose. |
Edited by - Carefree on 01 April 2016 23:41:29 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 04 April 2016 : 18:49:49
|
Thanks Carefree. I'm getting the following error: quote: Microsoft SQL Server Native Client 10.0 error '80040e37'
Invalid object name 'FORUM_TOPICS'.
/forums/admin_topic_maker.asp, line 76
Code:
58. <%
59. if AdminAllowed = 1 then
60. set countrs = my_conn.execute("SELECT CAT_ID FROM " & strTablePrefix & "TOPICS")
61. ListTopic = 0
62. do until countrs.eof
63. ListTopic = ListTopic + 1
64. countrs.movenext
65. Loop
66. set countrs = nothing
67. strTotalTopics = ListTopic
68. 'strSql = strSql & "SELECT T_COUNT FROM FORUM_TOTALS" & Topics
69. 'write_this = Request.QueryString("TOPIC_ID")
70. 'for write_this = 1 to ListTopic
71. for write_this = 1 to ListTopic
72. strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE "
73. strSql = strSql & " FROM FORUM_TOPICS "
74. strSql = strSql & " WHERE TOPIC_ID = " & write_this
75. 'response.write strSql
76. set rsWrite = my_Conn.Execute (strSql) |
Edited by - Lon2 on 05 April 2016 03:17:48 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 05 April 2016 : 03:08:23
|
I also tried another version of Topic Maker and got the following error: quote: Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/forums/admin_topic_maker.asp, line 173
And its code:
170. Set ObjTopicFile = Server.CreateObject("Scripting.FileSystemObject")
171. TopicFile = Server.MapPath (strTopicPath & write_this & ".htm")
172. Set WriteTopicFile = ObjTopicFile.CreateTextFile (TopicFile, True)
173. WriteTopicFile.WriteLine(strWrite)
174. WriteTopicFile.Close
175. Set WriteTopicFile = Nothing
176. Set ObjTopicFile = Nothing |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 05 April 2016 : 03:21:05
|
quote: Originally posted by Carefree
Easiest way would be to create an IIS on your desktop, install basic Sitz, and link to those databases. Then you could use an existing Snitz mod for the purpose.
Since I'm not having any luck with Topic Maker mods, are you aware of any other mods, tools or scripts that could possibly do what I'm looking for? I'd be willing to pay someone to write a new script providing it did everything I need. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 05 April 2016 : 11:22:53
|
quote: Originally posted by Lon2
Thanks Carefree. I'm getting the following error: quote: Microsoft SQL Server Native Client 10.0 error '80040e37'
Invalid object name 'FORUM_TOPICS'.
/forums/admin_topic_maker.asp, line 76
Code:
58. <%
59. if AdminAllowed = 1 then
60. set countrs = my_conn.execute("SELECT CAT_ID FROM " & strTablePrefix & "TOPICS")
61. ListTopic = 0
62. do until countrs.eof
63. ListTopic = ListTopic + 1
64. countrs.movenext
65. Loop
66. set countrs = nothing
67. strTotalTopics = ListTopic
68. 'strSql = strSql & "SELECT T_COUNT FROM FORUM_TOTALS" & Topics
69. 'write_this = Request.QueryString("TOPIC_ID")
70. 'for write_this = 1 to ListTopic
71. for write_this = 1 to ListTopic
72. strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE "
73. strSql = strSql & " FROM FORUM_TOPICS "
74. strSql = strSql & " WHERE TOPIC_ID = " & write_this
75. 'response.write strSql
76. set rsWrite = my_Conn.Execute (strSql)
That error means that you called your forum tables something other than "FORUM" when you created it. The solution is to replace "FORUM_" with the variable "strTablePrefix". Line 68 should read something like this:
68. strSql = strSql & "SELECT T_COUNT FROM " & strTablePrefix & "TOPICS"
If you want me to write you a program especially to extract your topics, I can. Send me Email and I'll help you out.
|
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 05 April 2016 : 18:01:14
|
quote: Originally posted by Carefree
That error means that you called your forum tables something other than "FORUM" when you created it. The solution is to replace "FORUM_" with the variable "strTablePrefix". Line 68 should read something like this:
68. strSql = strSql & "SELECT T_COUNT FROM " & strTablePrefix & "TOPICS"
If you want me to write you a program especially to extract your topics, I can. Send me Email and I'll help you out.
Should be line 73 from:
73. strSql = strSql & " FROM FORUM_TOPICS "
Change it to this:
73. strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
|
Cheers, David Greening |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 05 April 2016 : 19:49:42
|
Thanks so much, Carefree and ClassicMC!
It seems it starting working but wrote only one empty topic in the "../topics/" folder. It ran through 3,290 topics, all with "Done processing topic number XXXX. - No such topic found." ("...topic number 3290" was last one). So I'm guessing I'll need to change all instances of "FORUM_" to "& strTablePrefix & "?
I believer there are about 15,000 topics total with archives. Will the script also write the archives? Do you think I'll need to increase "<%Server.ScriptTimeout = 10000%>" for it to write all of the topics? If so, what do you think would be a good number? |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 05 April 2016 : 22:18:52
|
Try this:
|
Edited by - Carefree on 05 April 2016 22:25:35 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 06 April 2016 : 17:42:37
|
Thanks again Carefree! I had a problem with the buffers so I just removed those lines for now. I had to add the "inc_function_secure.asp" include because I was getting a "GetMemberName" error. I found the reason the original script stopped on the one topic.. it's because there are no topics before it, ha.
The script looks like it's running to the end now but getting the following error: quote: Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument
/forums/admin_topic_maker.asp, line 95
Line 95 looks like write file:
92. Set ObjTopicFile = Server.CreateObject("Scripting.FileSystemObject")
93. TopicFile = Server.MapPath ("../topics/" & Write_this & ".asp")
94. Set WriteTopicFile = ObjTopicFile.CreateTextFile (TopicFile, True)
95. WriteTopicFile.WriteLine(strWrite)
96. WriteTopicFile.Close |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 April 2016 : 22:55:10
|
Try removing the parentheses on line 95. If that doesn't work, here's another approach. The Buffering lines are there, you may need to remove them again; unsure what buffering error you had received.
|
Edited by - Carefree on 06 April 2016 22:55:57 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 12 April 2016 : 20:28:55
|
Alright! I was able to get this one to work after removing the periods from all instances of "rs.WriteReply." Thanks again for that!
If I knew the topic number sequence of a Category and wanted to write just those Topics, is there a way to do that? E.g. Write TOPIC_ID=3500 thru TOPIC_ID=5000. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 13 April 2016 : 07:45:52
|
Sure. Modify line 62 to something like this:
|
Edited by - Carefree on 30 April 2016 18:42:25 |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 14 April 2016 : 11:55:34
|
Hmm that doesn't write any files but a few archives and then says, "You don't have permission to do this." I'm lookin online to see if I can find other commands.. found BETWEEN but it's not working either.. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 14 April 2016 : 23:05:44
|
If you want all topics from a particular category, why not simply specify the category? Change the two pieces of red below.
|
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 15 April 2016 : 20:21:57
|
That's not working right... it's writing 1 post 1 file, then the same 1 post with several more posts, and keeps going.. every page with the same post plus more and more. The last file looks like almost every topic and post in the category, lol! That was strange... I think this is beginning to be more trouble than it's worth... |
|
|
Topic |
|
|
|