Author |
Topic |
skwayb
Starting Member
17 Posts |
Posted - 01 February 2005 : 17:17:52
|
Ok added those statments to the SQL strings for the pop_flag.asp and everything works. I will do some more testing for mySql and Access to see if I need to add any if statements. I'll post the code changes once I test those cases out. |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 02 February 2005 : 09:27:27
|
Thanks skwayb for testing this. IDENTITIY_INSERT is new to me so I did a search in the archives for it and found this thread.
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=33703&SearchTerms=un-archive
See workmules solution about midway down. I think that new IDs would be the way to go after reading that post, just in case the ID gets reused. It doesn't look like it will be to hard to do. I'll give it a try and post my results .
|
_-/Cripto9t\-_ |
|
|
skwayb
Starting Member
17 Posts |
Posted - 02 February 2005 : 12:46:17
|
Makes sense for safety. Wouldn't want the topics to get off or duplicate keys. That would definitely break things.
Is there anyway you can add it so you can archive a single topic. Like you are reading one and don't want to delete it but want it in the archive section. Right now with your mod you have to flag all your topics you don't want archived and then archive the forum. I think it would be handy if you could just archive the one topic right then and there. Just a thought. |
Edited by - skwayb on 02 February 2005 12:48:32 |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 02 February 2005 : 15:20:18
|
I updated the download. Just replace pop_flag.asp with new version, I didn't mark the code changes. Let me know if you have problems.
The unarchived topic and replies get new IDs to avoid duplicates.
quote: skwayb Is there anyway you can add it so you can archive a single topic. Like you are reading one and don't want to delete it but want it in the archive section. Right now with your mod you have to flag all your topics you don't want archived and then archive the forum. I think it would be handy if you could just archive the one topic right then and there. Just a thought.
I've seen this asked for a few times and there might be a mod for it already. I'll search, but I always seem to find the answers after I do the work . If I can't find one I'll see if I can incorperate it into this mod or maybe make a seperate mod. |
_-/Cripto9t\-_ |
|
|
bitwise2000
Starting Member
38 Posts |
Posted - 03 February 2005 : 09:38:59
|
quote: Originally posted by cripto9t quote: skwayb Is there anyway you can add it so you can archive a single topic. Like you are reading one and don't want to delete it but want it in the archive section. Right now with your mod you have to flag all your topics you don't want archived and then archive the forum. I think it would be handy if you could just archive the one topic right then and there. Just a thought.
I've seen this asked for a few times and there might be a mod for it already. I'll search, but I always seem to find the answers after I do the work . If I can't find one I'll see if I can incorperate it into this mod or maybe make a seperate mod.
I suggested it in this forum a few weeks ago. I think it would fit very well with Cripto's archive mod. I did a search and there are no mods like it. I started working on it, but I got sidetracked by other things. Most of the code is in admin_forums.asp. Just an icon in the mod/admin icon area for each topic and maybe a confirm. Would be very handy.
Cripto - thanks for your good work. |
Edited by - bitwise2000 on 03 February 2005 09:42:01 |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 03 February 2005 : 16:58:44
|
I started working on the single topic archive last night. So far all I have are the image links done. The weather is warm here and I have outdoor things that need to be done to get ready for spring (I live on a farm). So I'm not going to have alot of screen time. I think I can have it ready by sometime next week. So if your interested, keep checking this post.
Bitwise, I was just going to add another select case to pop_flag but admin_forums is probably a better way to go. Your right, all the code should be there.
I have one question for now. Should there be a time limit (preferably the one for forum archiveing) or no time limit? |
_-/Cripto9t\-_ |
|
|
bitwise2000
Starting Member
38 Posts |
Posted - 05 February 2005 : 12:42:54
|
I say no time limit. Just a simple push of one topic and all replies to the archive. The code in admin_forums just take a single date as an argument. You just need to lift that code into your existing mod (or maybe pop_push ??) for a confirm and feed it a topic ID instead. Then all replies and then the topic should be copied to their archive tables and the originals deleted. I was going to do a javascript confirm, then run the push script, then reload the topics page. Let me know if you need help testing. This would make a good simple standalone mode too if you don't want to mess with yours. |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 17 February 2005 : 12:26:34
|
I'm still working on this . I've got the single topic archive working in mySql. I've settled on archiving/unarchiving the way its done in "admin_forums.asp", which I hadn't noticed before, by checking the topic id. If it exists, upgrade. If not, insert. Which works fine for mySql, but as skwayb pointed out msSql needs "SET IDENTITY_INSERT FORUM_TOPICS ON". I'm not sure how to execute this and I can't find any examples when I search. So if anyone can help me out with this, I'd appreciate it. |
_-/Cripto9t\-_ |
|
|
skwayb
Starting Member
17 Posts |
Posted - 08 March 2005 : 13:09:17
|
quote: Originally posted by cripto9t
I'm still working on this . I've got the single topic archive working in mySql. I've settled on archiving/unarchiving the way its done in "admin_forums.asp", which I hadn't noticed before, by checking the topic id. If it exists, upgrade. If not, insert. Which works fine for mySql, but as skwayb pointed out msSql needs "SET IDENTITY_INSERT FORUM_TOPICS ON". I'm not sure how to execute this and I can't find any examples when I search. So if anyone can help me out with this, I'd appreciate it.
Cripto, you still stuck on how to do the "SET IDENTITY_INSERT FORUM_TOPICS ON". You just add that statement as part of the SQLStr before the insert and then once the insert is done, put the "SET IDENTITY_INSERT FORUM_TOPICS OFF" at the end of your SQLStr. If you need help, post your new code and I will help you add it. I need to test it with Access and see if we need to put a case in there for just MSSQL to use that statement.
|
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 09 March 2005 : 09:58:59
|
OK, I updated the download. Individual topics can now be "archived". I added a new archiving icon to "topic.asp" and "forum.asp" and completely redone "pop_flag.asp", so it will need replaced with the new file.
I added "identity insert" for mssql, hopfully skwayb can test it out. I also tried testing with free "access 2000" site but I believe the field "T_ARCHIVE_FLAG" is missing from the "A_TOPICS" table. I'll check it later when I get more time.
skwayb, It needs a check for db. I get an error in mysql for "identity insert". Here's what I got. I did the same for replies.
strSql = ""
if (Mode_Type = "UnArchive") and (strDBType = "sqlserver") then
strSql = strSql & " SET IDENTITY_INSERT " & strTablePrefix & "TOPICS ON"
end if
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 |
_-/Cripto9t\-_ |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 09 March 2005 : 10:43:45
|
It's working with "Access 2000", doesn't need "identity insert". "T_ARCHIVE_FLAG" was missing from the "A_TOPICS" table, in my version 3.4.04. This will be a problem for some folks who got this particular download. I think I should add a dbs file.
I also hope this mod is getting close to done . |
_-/Cripto9t\-_ |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 09 March 2005 : 12:17:17
|
I found a couple of small bugs in the latest download 3/9/05. You need to make these changes if you downloaded it before this post time. Download has been updated with these changes.
In Topic.asp these lines
Response.Write " " & getCurrentIcon(strIcon,strTitle,"hspace=""0""") & "" & vbNewLine
if ArchiveView <> "true" and Topic_ArchiveFlag = 1 then Response.Write " " & getCurrentIcon(strIconFolderArchive,"Archive Topic","hspace=""0""") & "" & vbNewLine
Need to changed to this
Response.Write " <a href=""JavaScript:openWindow('pop_flag.asp?" & ArchiveLink & "mode=" & strMode & "&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIcon,strTitle,"hspace=""0""") & "</a>" & vbNewLine
if ArchiveView <> "true" and Topic_ArchiveFlag = 1 then Response.Write " <a href=""JavaScript:openWindow('pop_flag.asp?" & ArchiveLink & "mode=TopicArchive&TOPIC_ID=" & Topic_ID & "&FORUM_ID=" & Forum_ID & "&CAT_ID=" & Cat_ID & "')"">" & getCurrentIcon(strIconFolderArchive,"Archive Topic","hspace=""0""") & "</a>" & vbNewLine
And in pop_flag.asp Mtxt needs to be changed to Mtype (in red)
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><font color=""" & strHiLiteFontColor & """>NOTE: </font></b>Only Moderators and Administrators can " & Mtype & " a topic.</font></p>" & vbNewLine & _
|
_-/Cripto9t\-_ |
|
|
skogizz
Starting Member
Sweden
25 Posts |
Posted - 14 March 2005 : 09:39:48
|
I'm using Snitz 3.4.04 with MSSQL. Is it safe to use this mod or should I do a complete backup of my db before I start to unarchive topics?
Thanks
/Fredrik |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 14 March 2005 : 09:50:29
|
Always best to take a backup copy of your database before running a mod for the first time, Fredrik, just in case it's incompatible with your version/db or you made any errors when installing it.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 14 March 2005 : 19:23:25
|
quote: Originally posted by skogizz
I'm using Snitz 3.4.04 with MSSQL. Is it safe to use this mod or should I do a complete backup of my db before I start to unarchive topics?
Thanks
/Fredrik
I would make one. I still don't know if the sql is right for MSSql, because I'm unable to test. Like I pointed out above I would also check if "T_ARCHIVE_FLAG" is in the "TOPICS" and "A_TOPICS" tables. I haven't put a dbs file in the zip file yet.
You can paste this in "admin options" > "optional db setup" and make sure the fields are there.
[ALTER]
TOPICS
DROP#T_ARCHIVE_FLAG###
[END]
[ALTER]
TOPICS
ADD#T_ARCHIVE_FLAG#smallint#NULL#0
[END]
[ALTER]
A_TOPICS
DROP#T_ARCHIVE_FLAG###
[END]
[ALTER]
A_TOPICS
ADD#T_ARCHIVE_FLAG#smallint#NULL#0
[END]
ps If you try this let me know how it goes . |
_-/Cripto9t\-_ |
Edited by - cripto9t on 14 March 2005 19:28:46 |
|
|
Topic |
|