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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Archive Flag - Archive/UnArchive Topic 3.4 beta
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 4

skogizz
Starting Member

Sweden
25 Posts

Posted - 19 March 2005 :  15:30:19  Show Profile
I have now managed to get a backup copy of my db.

When I add the db-code you posted to me I got this

Dropping Column...
ALTER TABLE FORUM_TOPICS DROP COLUMN T_ARCHIVE_FLAG
ALTER TABLE FORUM_TOPICS DROP COLUMN T_ARCHIVE_FLAG
-2147217900 | [Microsoft][ODBC SQL Server Driver][SQL Server]The object 'FORUM_SnitzC82' is dependent on column 'T_ARCHIVE_FLAG'.

--------------------------------------------------------------------------------

adding Column T_ARCHIVE_FLAG...
ALTER TABLE FORUM_TOPICS ADD T_ARCHIVE_FLAG smallint NULL DEFAULT 0
ALTER TABLE FORUM_TOPICS ADD T_ARCHIVE_FLAG smallint NULL DEFAULT 0
-2147217900 | [Microsoft][ODBC SQL Server Driver][SQL Server]Column names in each table must be unique. Column name 'T_ARCHIVE_FLAG' in table 'FORUM_TOPICS' is specified more than once.

--------------------------------------------------------------------------------

Dropping Column...
ALTER TABLE FORUM_A_TOPICS DROP COLUMN T_ARCHIVE_FLAG
ALTER TABLE FORUM_A_TOPICS DROP COLUMN T_ARCHIVE_FLAG
-2147217900 | [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE DROP COLUMN failed because column 'T_ARCHIVE_FLAG' does not exist in table 'FORUM_A_TOPICS'.

--------------------------------------------------------------------------------

adding Column T_ARCHIVE_FLAG...
ALTER TABLE FORUM_A_TOPICS ADD T_ARCHIVE_FLAG smallint NULL DEFAULT 0
Column added successfully
UPDATE FORUM_A_TOPICS SET T_ARCHIVE_FLAG=0
Populating Current Records with new Default value
Table(s) updated


But then when I try to un-archive a topic I get a message that it been moved. When I look in the forum the moved thread is there and can be read so my guess it's working!!! :)

Is it possible you could expand your mod to unarchive all threads att once in a forum?

Great mod!

/Fredrik
Go to Top of Page

skogizz
Starting Member

Sweden
25 Posts

Posted - 19 March 2005 :  15:34:40  Show Profile
Strange!

In some of my forums it works and some it don't!

I get this when it don't work

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 72: Incorrect syntax near ','.
/sss/pop_flag.asp, line 212
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 20 March 2005 :  08:22:59  Show Profile
skogizz,
Thanks for trying this out .
If you could, find this code in pop_flag.asp
strSql = strSql & " INSERT INTO " & strReversePrefix & "TOPICS (CAT_ID" & _
                                                          ", FORUM_ID" & _
                                                          ", TOPIC_ID" & _
                                                          ", T_STATUS" & _
                                                          ", T_ARCHIVE_FLAG" & _
                                                          ", T_SUBJECT" & _
                                                          ", T_MESSAGE" & _
                                                          ", T_AUTHOR" & _
                                                          ", T_REPLIES" & _
                                                          ", T_UREPLIES" & _
                                                          ", T_VIEW_COUNT" & _
                                                          ", T_LAST_POST" & _
                                                          ", T_DATE" & _
                                                          ", T_LAST_POSTER" & _
                                                          ", T_IP" & _
                                                          ", T_LAST_POST_AUTHOR" & _
                                                          ", T_LAST_POST_REPLY_ID" & _
                                                          ", T_LAST_EDIT" & _
                                                          ", T_LAST_EDITBY" & _
                                                          ", T_STICKY" & _
                                                          ", T_SIG)" & _
		                                          " VALUES (" & strTValues & ")"
                                        if (Mode_Type = "UnArchive") and (strDBType = "sqlserver") then
                                                strSql = strSql & " SET IDENTITY_INSERT " & strTablePrefix & "TOPICS OFF"
                                        end if

                                        'Response.Write strSql
                                        'Response.End

This is the code right before line 212
Remove the comments from last 2 lines, so they look like this
Response.Write strSql
Response.End

Then try to unarchieve a topic that doesn't work and copy what comes up in the pop-up and post it here.
Then put the comments back in.

quote:
Is it possible you could expand your mod to unarchive all threads att once in a forum?


There is a mod for doing this and I have linked to it near the top of this topic.
I'm not sure what Snitz version it's for.
You might want to ask around and see if anyone has tested it out

    _-/Cripto9t\-_
Go to Top of Page

skogizz
Starting Member

Sweden
25 Posts

Posted - 20 March 2005 :  17:41:58  Show Profile
Here is what I got. I changed the subject and the text in the post to the text below (here_comes....) All other text are unchanged.



SET IDENTITY_INSERT FORUM_TOPICS ON INSERT INTO FORUM_TOPICS (CAT_ID, FORUM_ID, TOPIC_ID, T_STATUS, T_ARCHIVE_FLAG, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, T_SIG) VALUES (2, 2, 3315, 1, 0, 'here_comes_the_subject_of_the_thread', 'here_comes_the_text_in-the_post', 354, 2, , 197, '20020911123829', '20020911115043', 0, '213.64.168.161', 3, , NULL, NULL, 0, 0) SET IDENTITY_INSERT FORUM_TOPICS OFF

Edited by - skogizz on 21 March 2005 02:22:39
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 21 March 2005 :  09:05:55  Show Profile
I think the unmoderated replies are being set to null in your forums.
The base code checks for null when it archives. So I modified it a little to unarchive .

skogizz, if you would, make the changes below and uncomment those 2 Response lines again and unarchive the same topic. Then post the results here again.
Then put the comments back in and see if it will unarchive.

Hope this fixes it ;^)
Just 2 changes.
Find this code in pop_flag.asp
if isnull(tLasteditby) then
				        tLasteditby = "NULL"
			        else
				        tLasteditby = tLasteditby
			        end if

UNDER that ADD this
if isnull(tUReplies) then
				        tUReplies = "NULL"
				        tURepliescnt = 0
			        else
				        tURepliescnt = tUReplies
			        end if

A little bit below that, find this line of code
					        ", T_UREPLIES = T_UREPLIES + " & tUReplies & _

Replace that line with this
					        ", T_UREPLIES = T_UREPLIES + " & tURepliescnt & _


    _-/Cripto9t\-_
Go to Top of Page

skogizz
Starting Member

Sweden
25 Posts

Posted - 21 March 2005 :  13:28:39  Show Profile
Now after the change I got this (subject and post text replaced with "here_comes..." again)

SET IDENTITY_INSERT FORUM_TOPICS ON INSERT INTO FORUM_TOPICS (CAT_ID, FORUM_ID, TOPIC_ID, T_STATUS, T_ARCHIVE_FLAG, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_LAST_EDIT, T_LAST_EDITBY, T_STICKY, T_SIG) VALUES (2, 2, 3315, 1, 0, 'Here_comes_the_subject', 'Here_comes_the_posts_text', 354, 2, NULL, 198, '20020911123829', '20020911115043', 0, '213.64.168.161', 3, , NULL, NULL, 0, 0) SET IDENTITY_INSERT FORUM_TOPICS OFF

Then put the comments back but still got error message (pop_flag.asp, line 218 it complains at)

Is it easy to move all archived topics back using DTS? The other MOD you told me about did'nt work at all and I have about 5000 archived topics that I need to move back...

Your mod is the only way so far I found out working (but as I posted not all topics works)

/Fredrik
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 23 March 2005 :  07:43:12  Show Profile
Fredrik, I missed one.
Last post reply id is missing, it's strange because it shows 2 replies.

Anyway, add this code right below that last little block you added.
if isnull(tLastpostreplyid) then
				        tLastpostreplyid = 0
			        end if

Also, it might be better to set unmoderated replies to 0 instead of null.
In that code you added last time replace the "NULL" with 0. So it looks like this.
if isnull(tUReplies) then
				        tUReplies = 0
				        tURepliescnt = 0
			        else
				        tURepliescnt = tUReplies
			        end if


I'm not familiar with DTS and I'm sorry the other mod didn't work for you. I looked at the code and it's more than I want to mess with.
As for this mod, it would take alot of work to get it work on an entire archive.
I'm having a tough enough time just getting it to work for a single topic .

Anyway that's all the null checks + 1 that the base code checks for, so hopefully this will get it .
Let me know if it works.

    _-/Cripto9t\-_
Go to Top of Page

ajhvdb
Junior Member

Netherlands
392 Posts

Posted - 14 April 2005 :  05:30:23  Show Profile
Thank you for this Mod. Very good work. The only thing i didn't like was the dropping and creation of the standard snitz field T_ARCHIVE_FLAG. With a few iffies in pop_flag.asp this could have been prevented. But I still like your work ;)
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07