Author |
Topic |
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 22 July 2003 : 12:49:15
|
Sorry if this has been asked before, but is there anyway to mass move a number of topics? I want to merge two forums together...but it's a bit long winded when you have to edit and move each individual topic
Cheers! |
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 22 July 2003 : 12:52:39
|
you could just write a simple page to do that. hard code in the forum numbers in an update statement. If the forums are in the same category, you would have to worry about changing the category number. Then you would do the same for the replies. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 22 July 2003 : 16:45:38
|
Any ideas on the code I'd use?
Thanks |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 22 July 2003 : 17:16:20
|
something along the lines of
UPDATE FORUM_TOPICS SET FORUM_ID = X WHERE FORUM_ID = Y
and
UPDATE FORUM_REPLIES SET FORUM_ID = X WHERE FORUM_ID = Y
where Y is the old forum id and X is the new forum id ... this would only be if the category is the same for the old and new forum.
Let someone comfirm this though before you try it. That's just off the top of my head. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 24 July 2003 : 02:26:29
|
Thanks, I'll just wait for a confirmation before going ahead with the code |
Edited by - mortioli on 24 July 2003 14:14:43 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 25 July 2003 : 13:34:30
|
Would anyone be able to confirm this please |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 27 July 2003 : 12:10:48
|
Sorry to keep bumping this, but I'm really trying to sort out my forums, so I need an easy way to merge forums together...
Could anyone please help me?
Thanks! |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 29 July 2003 : 13:24:41
|
Looks good to me. Obviously if you're moving categories you'd need a similar SQL statement for CAT_ID. Oh, and don't forget to do thesame for the archive tables.
Wasn't there a merge forums mod for a previous version? If someone has a copy, I'll take a look at updating it for 3.4.
|
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.” |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 29 July 2003 : 17:23:31
|
I made a file like this...
quote:
<% UPDATE FORUM_TOPICS SET FORUM_ID = X WHERE FORUM_ID = Y %>
...and replaced the X and Y with the correct forums, but no luck
Am I doing something wrong? |
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 29 July 2003 : 18:19:19
|
You would need something like this
<!-- #include file="config.asp" -->
<%
Dim OldForumID, NewForumID
' Replace the IDs with the appropriate numbers....
OldForumID = 1
NewForumID = 2
strSQL = "UPDATE FORUM_TOPICS SET FORUM_ID = " & NewForumID & " WHERE FORUM_ID = " & OldForumID
my_conn.execute strSQL
%>
|
Dave Maxwell Barbershop Harmony Freak |
Edited by - davemaxwell on 29 July 2003 18:20:14 |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 30 July 2003 : 04:19:50
|
It gives me this error
quote:
Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' /forum/mass_move.asp, line 9
I tried adding " ...
strSQL = "UPDATE FORUM_TOPICS SET FORUM_ID = " & NewForumID & " WHERE FORUM_ID = " & OldForumID "
and...
strSQL = "UPDATE FORUM_TOPICS SET FORUM_ID = " & NewForumID & " WHERE FORUM_ID = " & OldForumID ""
...but still errors |
Edited by - mortioli on 30 July 2003 04:24:54 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 30 July 2003 : 05:15:42
|
Do a response.write of the SQL string. I.E:
strSQL = "UPDATE FORUM_TOPICS SET FORUM_ID = " & NewForumID & " WHERE FORUM_ID = " & OldForumID Response.Write strSQL my_conn.execute strSQL
Again, don't forget to run the same code on the reply and archive tables.
|
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.” |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 30 July 2003 : 06:13:37
|
Still says the same thing |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 30 July 2003 : 06:38:36
|
But it should have written the SQL statement to screen before the error message. Post the output here 'til we see if there's any errors in 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.” |
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 30 July 2003 : 07:44:52
|
Change that line to: Response.Write strSQL : Response.End
That will give you the info and not try and execute the SQL statement. |
Dave Maxwell Barbershop Harmony Freak |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 30 July 2003 : 08:26:15
|
quote: Originally posted by davemaxwell
Change that line to: Response.Write strSQL : Response.End
That will give you the info and not try and execute the SQL statement.
That gives me...
UPDATE FORUM_TOPICS SET FORUM_ID = 7 WHERE FORUM_ID = 32 |
Edited by - mortioli on 30 July 2003 08:26:51 |
|
|
Topic |
|