Archive One Topic MOD 1.0a

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/63568?pagenum=1
05 November 2025, 00:50

Topic


Etymon
Archive One Topic MOD 1.0a
18 December 2006, 09:21


Edited: March 4, 2009
I'm not sure why the original message was gone when I checked up on this topic today.
Below is the download link for this MOD:

https://sourceforge.net/project/showfiles.php?group_id=184115&package_id=214028

 

Replies ...


bitwise2000
18 December 2006, 23:16


Other than the delete function, how is this different from cripto9t's archive/unarchive one topic mod?
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=55145
<
Etymon
18 December 2006, 23:30


I see that I commented on it when it was posted, but other than that, I haven't looked at it. I'll download it, try it out, and get back with you about it.<
Etymon
19 December 2006, 00:48


I'll took a look at it in more depth later to understand how he worked his code to get his results.
Below are some points I took into consideration while reviewing his work:

Why each MOD was created:
It appears that he designed his work to keep certain topics from being archived. Thus, the need to flag them.
Since I have never (so far) in the 5 years that I have been using Snitz have had a need to archive topics by batch, I wanted the ease of archiving them individually as well as unarchiving them individually (in the event that I archived something I wanted to bring back into a current status for discussion).
In that sense, the mindset for why the MODs were created is different.
His work deals with segregating individual topics from being batch processed as well as archiving/un-archiving single topics.
Mine doesn't deal with batch processing. It offers an alternative to it.
I do like the flagging approach. I see a need for it. I just don't do batch processing, so I had no need to include it in my work.

What db properties each MOD modified:
His work calls for an edit to the TOPICS table to drop the T_ARCHIVE_FLAG field and add it to the A_TOPICS table instead. He didn't include this as a dbs_ file in his download for some reason, but he did offer it in the link you provided.
I wanted to create a work that didn't alter any of the standard existing db fields, since that could mess up other MODs as well as exising code. Instead, mine has a new table that stores the old TOPIC_ID and the new un-archived TOPIC_ID.

What each MOD produces:
As far as getting to the topic information, the results are the same.
However, his work is able to restore the original TOPIC_ID. My work gives a new TOPIC_ID.
Personally, I like restoring the original TOPIC_ID better. If I had known at the time how to do it, I would have saved myself some time and done it that way. But I am happy with the workaround that I found. I don't see a need to change it since it still gets the user to the correct information. smile

Where each MOD is accessed from:
On the adminstrative side of things. His work focuses on archiving while browsing the forums and the topics, while my work focuses on working from the admin section (currently).
In admin_forums.asp his work functions like the current admin_forums.asp, so I don't see a difference there from what Snitz already offers, unless I am missing something.
In my admin_topics.asp, I incorporate each forum almost exactly as it is displayed in forum.asp (this is true for current and archived topics). This is something admin_forums.asp doesn't allow you to do.

General Summary:
The main differences I see currently are:

1) Mine doesn't work from forum.asp and topics.asp (yet)
2) His flags topics from being batch archived. 3) Mine wasn't intended for batch archiving. 4) His doesn't give you the individual topic selection from admin_forums.asp
5) Mine is gives individual topic selection from admin_forums.asp. 6) His restores the original TOPIC_ID. 7) Mine gives a new TOPIC_ID.

Where each MOD is in development:
It seems cripto9t's MOD hasn't been updated for nearly two years. I did a search for "Archive Flag" in both the Subject and the Message of the current and archived topics and found little about it. It would be cool if he would update it and package that dbs_ file with his download! wink It looks like his was a really nice work!
My work is just in the alpha phase, and comments are welcome.
In the beta I plan on adding functionality like cripto9t did in forum.asp and topic.asp so that a person can access admin_topics.asp from the Admin Options on those pages.
I'll try to contact cripto9t about incorporating the flagging of current topics part of his work into my work. It appears that no change is necessary to the T_ARCHIVE_FLAG in the TOPICS table for this to work.
Thank you for your input!
Etymon
<
Etymon
20 December 2006, 08:02


No word from cripto9t as of yet ... I didn't see anything different in his code from what I had tried before. So I must have missed something when I was coding.
I'll rework that for version 1.0b

Etymon
<
Etymon
20 December 2006, 09:22


The demo has been updated.<
skellyx
20 December 2006, 10:26


I have a problem ( sob )

Choose a Forum from which to Archive a Topic
I choose a forum but:

Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'T.FORUM_ID = AND T.T_STATUS > 1'.

/scripts/cforum/inc_moderation.asp, line 72


Help me? blush
Thank and kiss for Italy<
Etymon
20 December 2006, 14:31


The .zip has been updated:

https://sourceforge.net/project/showfiles.php?group_id=184115&package_id=214028

I had to change Forum_ID to strForumIDN in two of the include files.
I suspect that that was the problem.
Let me know.<
cripto9t
20 December 2006, 15:30


Etymon feel free to use whatever you want from my mod. One thing about keeping the original id though. If you read through the post that Bitwise linked to, you will see that there were issues with preserving the original id. Ms sql needed some specific code to get around auto id. Also I read there is a slight chance of getting duplicate ids when bypassing auto id. I think your workaround with a new table is a better idea for an all around mod. Anyway thats my 2 cents smile.
<
skellyx
20 December 2006, 15:32


Thank Etymon the first problem is resolved
archive topic is perfect smile
Un-Archive One Topic:
There are no replies to Un-Archive. (same error if there reply )
No replies were archived: None were found
Microsoft JET Database Engine error '80004005'
The field 'FORUM_TOPICS.T_ARCHIVE_FLAG' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.
forum/admin_topics.asp, line 1065

I would want so much power to help but as woman I am better with the crotchet hook bigsmile I can help only test the mod

Thank Etymon for the whole job that you do wink
Lory<
Etymon
21 December 2006, 01:30


.zip file has been updated. smile
Thank you cripto9t. I'll go on with those things in mind. Thank you for letting me know about the potential problems.
Cheers,

Etyon
<
skellyx
21 December 2006, 06:04


update but
Only un-archive
Microsoft JET Database Engine error '80004005'

The field 'FORUM_REPLY.R_STATUS' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.

cforum/admin_topics.asp, line 958

Sorry Etymon

if you can be useful I copy my screen :...........

Case "unarchivetopic"
Forum_SQL - SELECT a specific TOPIC_ID to Un-Archive from the FORUM_A_TOPICS (archives) table. TOPIC_ID = 14549
strSql = SELECT A.FORUM_ID, A.TOPIC_ID, A.T_SUBJECT from FORUM_A_TOPICS A WHERE A.FORUM_ID = 57 ORDER BY T_SUBJECT ASC;



Sub subUnArchiveStuff()
Forum_SQL - SELECT each REPLY_ID to Un-Archive from FORUM_A_REPLY table according to its matching TOPIC_ID in the FORUM_A_TOPICS table. Existing TOPIC_ID = 14549
strSql = SELECT FORUM_A_REPLY.* FROM FORUM_A_REPLY LEFT OUTER JOIN FORUM_A_TOPICS ON FORUM_A_REPLY.TOPIC_ID = FORUM_A_TOPICS.TOPIC_ID WHERE FORUM_A_REPLY.TOPIC_ID = 14549



Sub subUnArchiveStuff()
Total Replies to Un-Archive ...
There is 1 reply to Un-Archive.
- The next step is to INSERT a new REPLY_ID into the FORUM_REPLY table to take the place of each existing REPLY_ID in the FORUM_A_REPLY table.




Sub subUnArchiveStuff()
Forum_SQL - INSERT (create) a new REPLY_ID into the FORUM_REPLY table with only the R_DATE field populated for each original REPLY_ID from the FORUM_A_REPLY table. Existing REPLY_ID = 295622
strSql = INSERT INTO FORUM_REPLY (R_DATE) VALUES ('20061221121200')




Microsoft JET Database Engine error '80004005'

The field 'FORUM_REPLY.R_STATUS' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.

cforum/admin_topics.asp, line 958


<
Etymon
21 December 2006, 09:27


Hi Lory,

On my test site I took a clean database from Snitz 3.4.06 and then installed the dbs_archive_one_topic_mod_1.0a.asp file. I posted a reply to the welcome message (that comes with Snitz). Then I archived the topic. It went well. Next, I un-archived the same topic. It went well.
The admin_topics.asp in the .zip file should be time stamped as 12/20/06 10:49 PM

What version of Snitz did your forum start from?<
Etymon
21 December 2006, 11:58


Hi Lory,

I did some research.
It looks like Snitz databases from 3.4 to now use a default value of 0 for the R_STATUS field. The databases from before 3.4 don't use default value in the R_STATUS field.
I suspect that is the issue.
I'll work on the MOD later today with an Access database from before 3.4 and see what I can do for you to make it backwards compatible.
<
Etymon
21 December 2006, 12:00


Thank you serritzlev! smile<
skellyx
21 December 2006, 12:51


Ohhh Thankkkkkkkkkkblushsmile
Etymon you are so much indeed kind

Hi

Lory<
Etymon
21 December 2006, 15:09


Lory,

What version of Snitz did you start with?
What version of Snitz are you using now?

smile
Etymon<
skellyx
21 December 2006, 17:00


Hi Etymon
I have looked for until now :) in the control panel I have found

[Snitz Forums 2000 Version 3.4.03]
excuse for the whole trouble that I give you

Kiss

Lory<
Etymon
22 December 2006, 09:38


Hi Lory,

I haven't forgotten about you. smile
I am having to chase down an odd error for the one of the sites I am modifying. The error is unrelated to my fixes since I haven't uploaded anything yet. LOL! So, give me a little bit to get this taken care of, and then I'll get back to the MOD.
Thank you for understanding. smile
Etymon
<
skellyx
22 December 2006, 10:14


No problem Etymon you already make me a big gift the whole time that serves take ( but it is understood what I write with the translator ah ah :) )

I make you best wishes ...Marry Christmas and happy new year

Hi .Lory *** =^.^=
<
Etymon
22 December 2006, 23:38


Hi Lory,

I fixed the problem. I can take a look at the MOD now.
I'll try to write in simple English from now on since you are puting my words through a translator. smile
Etymon
<
Etymon
23 December 2006, 01:42


Hi Lory,

Try using the admin_topics.asp from this download (http://carolina.kiwi73.kiwihosting.net/forum/test/Achive_One_Topic_1.0a_Lory.zip) Link no longer available.
When we get it working for you, then I'll upload it to SourceForge.net.
Etymon
<
skellyx
23 December 2006, 05:16


Hi Etymon tested error is

Microsoft JET Database Engine error '80004005'
You cannot add or change a record because a related record is required in table 'FORUM_FORUM'.
cforum/admin_topics.asp, line 1098

if you must work so much only for me it is not important you are very kind but I am sorry it.
Hi and kiss<
Etymon
23 December 2006, 11:04


Originally posted by skellyx
Hi Etymon tested error is

Microsoft JET Database Engine error '80004005'
You cannot add or change a record because a related record is required in table 'FORUM_FORUM'.
cforum/admin_topics.asp, line 1098

if you must work so much only for me it is not important you are very kind but I am sorry it.
Hi and kiss

Hi Lory,

I did some research

Try this file ... (http://carolina.kiwi73.kiwihosting.net/forum/test/Achive_One_Topic_1.0a_Lory_admin_topics_01.zip Link no longer available)

If that doesn't work, it could be a relationship problem in your database. This topic (http://forum.snitz.com/forum/topic.asp?TOPIC_ID=62672&SearchTerms=You+cannot+add+or+change+a+record+because+a+related+record+is+required) may be what you are experiencing.
Sincerely,

Etymon


<
skellyx
23 December 2006, 12:55


Ok I try to eliminate the relationships in the database. I try on a copy of the forum so I don't make damages :):)
if I succeed I write what I have done. Thank Etymon

Sincerely ..Lory ***<
Etymon
23 December 2006, 18:56


Sounds good.
And, if you don't succeed, still post your results. smile
Etymon
<
thermal_seeker
24 February 2007, 18:31


everything appears goes well and the topic appears to archive ok but at the last screen I get this error...


All replies to the topic ...
testing

were successfully archived!



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


Microsoft OLE DB Provider for SQL Server error '80040e14'

The name '0' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

/Forum/admin_topics.asp, line 808

line 808 being:

my_conn.execute(strsql),,adCmdText + adExecuteNoRecords

when I look the replies have gone but the original topic is still there in the forum and shows replies are there but the replies have gone.
trying to un-archive what was archived I do not see what I have archived listed.

any ideas??
EDIT: I have just done a search of the forum and what appears to have happened is that the replies have been deleted!! I have just tried again on a test topic with 5 replies and the same thing happens.. replies deleted and main topic still in the forum showing that there are 5 replies to the topic when in fact they have been deleted.
EDIT 2: If I try and re archive the topic (the one that the replies were deleted from) I get this error...
No replies were archived: None were found


Microsoft OLE DB Provider for SQL Server error '80040e14'

The name '0' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

/Forum/admin_topics.asp, line 808

so does this mean your MOD only archives replies and not the topic??
Dave

<
Etymon
24 February 2007, 22:49


The way the standard archive process works with a clean install of Snitz is that the reply ids are first copied over to the FORUM_A_REPLY table (the table containing archived reply ids) and then deleted from the FORUM_REPLY table (the table containing non-archived reply ids).
Next, the originating post (the topic id) that is associated with those replies is copied over to the FORUM_A_TOPICS table (the table containing archived topic ids), and then deleted from the FORUM_TOPICS table (the table containing non-archived topic ids).
The topic id is the pivoting factor in determining where the replies are located. This is true for both the topic.asp and the search.asp pages. The topic id is tracked to determine which table it is in. The logic is this: If the topic is in the FORUM_A_TOPICS table, then the replies are also in the FORUM_A_REPLY table, and that is where the replies are retrieved from ... and vice versa ... if the topic is in the FORUM_TOPICS table, then the replies are in the FORUM_REPLY table and retrieved from there.
In the FORUM_TOPICS table, for each topic id, there are fields associated with it, such as category id, forum id, etc. There are also another two fields that record the number of replies associated with that topic id. Those are the counts that you are seeing and the counts are carried with the topic id not the reply ids.
If you are able to download the database and look into the FORUM_A_REPLY table, you should see that the replies are all there. I believe that your replies are intact. However, the reference to them is absent only in that the process to associate the topic id to them was ended due to the content of the topic id. What you probably have is a topic id that is not archived and reply ids that are archived.
I included a SQL check using the variable RevealSQL on line 116. Make sure it is set to equal 1. Can you post the SQL that RevealSQL reveals previous to line 808? <
thermal_seeker
25 February 2007, 05:43


ahhh now that makes sense..
As I got errors last night I put my backup files back in place as today is a tad busy and I will not have time for the forum stuff, I will however do this at the start of next week. presumably when I did a search for a word that I know was in the archived topic reply, it didn't find it because the topic wasn't archived??
also I did comment line 116 out so as not to reveal the SQL statements.
Dave<
ReAX222
15 November 2007, 11:49


I too am having trouble with table relationships. I was getting
Microsoft JET Database Engine error '80004005'
You cannot add or change a record because a related record is required in table 'FORUM_MEMBERS'.
cforum/admin_topics.asp, line 958

I uploaded the file you made for Lory and I downloaded my database and deleted the relationship to forum_members. Do I need to bring it back down and delete all of the relationships?<
Etymon
15 November 2007, 23:29


What version of Snitz are you running? What MODs do you have installed? What database are you using?
I may have to rework the MOD. It's about time for an update on it anyway.
Thank you for the report. I am sure it will help someone else out as well.
Etymon
<
ReAX222
16 November 2007, 10:56


3.4.05

Archive one topic, Atomic's BGimage cell, Avatar mod for 3.4, Gatekeeper Anti-spam, and private messages mod

It's an Access, but I had to convert it up to 2002-3 to work on it. Yes that was the site, and the world always seems to get smaller doesn't it?<
Etymon
16 November 2007, 14:29


Originally posted by ReAX222 It's an Access, but I had to convert it up to 2002-3 to work on it. Yes that was the site, and the world always seems to get smaller doesn't it?

OK. That helps out a lot.
Did you install the MOD (run the dbs_ file) before you converted the database or after converting it?<
Lon2
03 March 2009, 15:02


Implimented this mod and got the following error:

Sub subUnArchiveStuff()
Forum_SQL - INSERT both the old TOPIC_ID (from the FORUM_A_TOPICS table) and the new TOPIC_ID (UA_TOPIC_ID) to the Un-Archived Topics (FORUM_UA_TOPICS) table. Archived TOPIC_ID = 9359
Un-Archived TOPIC_ID = 60791
strSql
= INSERT INTO FORUM_UA_TOPICS (UA_TOPIC_ID,TOPIC_ID) VALUES (60791,9359)
It looks like it almost got to the end. It went through many routines, then the message "All replies to the topic ... were successfully un-archived!" then a few more routines, and then the error.
HuwR
03 March 2009, 16:03


was there a setup script to run for the database ? looks like you don't have the required tables in your db
Lon2
03 March 2009, 16:12


There is one file "dbs_archive_one_topic_mod_1.0a.asp" that looks like it might create a table:

Code:
Archive One Topic MOD 1.0a
[CREATE] UA_TOPICS

UA_TOPIC_ID#int#NOT NULL#
TOPIC_ID#int#NOT NULL#
[END]
Does this have to be run in Alernate Mod setup in Admin Options?
texanman
03 March 2009, 18:37


I think either way should work.
Lon2
03 March 2009, 20:11


You thunk right, texanman. bigsmile
I used Alternate Mod setup in Admin Options to create the tables. And now the mod works!
Thank you Etymon, texanman and Huwr! [^]
Lon2
03 March 2009, 20:24


I am left with one small problem from when I got the error above. The replies to the topic that I was trying to unarchive got unarchived but not the topic. Is there any way to fix this? I copied the results page from when I got the error so I have the Topic and Reply IDs.
Etymon
03 March 2009, 21:22


i am still around, but just got out surgery today. i'm out of town for a bit. i might be able to you more when i get back. depends on how long i can sit up and all. sorry i can't help sooner.
etymon
Lon2
04 March 2009, 11:06


Sorry to hear that, Etymon. No problem. Get well soon!
Etymon
06 March 2009, 17:32


Thanks Lon2! blush
OK, I am doing really good on this recovery things so far. It's been about 72 hours, and I am not using crutches or a walker. I am limping and grimacing. My head is still in a fog though. So, if I can work effectively on this tonight I'll give it a shot.
From what I think you said last was is that you successfully un-archived the replies for a topic, but then topic for those replies was left still archived. Then you asked about it in this topic, the other members told you to install the dbs code, then after that all was well. But, I think that means that the MOD worked as expected for other topics you have un-archived since installing the code. It sounds like the topic that was left unfinished before the dbs code installation is still unfinished (or archived). Is that right? If so that means you have replies un-archived and the referring topic archived.
When I get settled tonight I'll look at this some more.

Cheers,

Etymon

Lon2
07 March 2009, 14:17


You hit the nail right on the head, Etymon!
Glad you're doing better!
Etymon
07 March 2009, 15:47


Great!
Now, since this is testing, could you e-mail me from my Snitz profile? I'll need to work through it with you offline. Then we can post the answer in this topic. The reason is that the testing could be lengthy which would make this topic a roller coaster to read for someone else looking for the same answer.
If you use MSN Messenger, then send me your contact info so that I can invite you to my contact list. If you use something other, then post that.
Etymon
Lon2
10 March 2009, 16:25


Emailed.
© 2000-2021 Snitz™ Communications