Help - Search - Members - Calendar
Full Version: Moving topics after a search
Invision Power Services > Community Forums > Community General Chat
SecondSight
Hello !

It's easy to move topics from a forum to another in a forum topics list.

But can I do it after a search ? On the search results page, I don't have the little boxes used to mass move topics...

Thank you for your help !

Regards,
bridgeaddict
You may find this thread helpful. original.gif
SecondSight
QUOTE(bridgeaddict @ May 3 2005, 02:51 AM) *
OK, first I'd run the following select query:

SQL
SELECT tid, title, forum_id FROM ibf_topics where title like '%DMX%'


just to make sure you had the right topics. Then, to move the topics to the new forum, you could run the following update query:

SQL
UPDATE ibf_topics SET forum_id = 'XX' where title like '%DMX%'


XX is the forum ID to which you want to move those topics.

This is untested, so no guarantees, but it *should* work. original.gif


Thank you very much. original.gif

I don't understand '%DMX%'. What does it mean ?

Thank you ! original.gif
bridgeaddict
Oh, in that particular case he was looking for topics which had the word (or rather letters) DMX in the title. % is used before and after the word you're looking for, hence %DMX%. HTH original.gif
SecondSight
Thank you very much ! original.gif

If my topics come from a forum A (id = YY) and not all the board. I want them to go in forum B (id = XX) if they have DMX in their title, will that do ?

CODE
SELECT tid, title, forum_id FROM ibf_topics where title like '%DMX%' AND forum_id= YY


CODE
UPDATE ibf_topics SET forum_id = 'XX' where title like '%DMX%' AND forum_id = YY


If not, how should I write it ?
bridgeaddict
Yes, that's exactly it. If that fits what you're looking for, then fine, but if you are actually using different search criteria, there may still be a way to bulk move the topics. original.gif
SecondSight
Yes I also wanted to move topics with :

- word1 and word2 :

QUOTE
SELECT tid, title, forum_id FROM ibf_topics where title like '%word1%' and title like '%word2%' and forum_id=YY

QUOTE
UPDATE ibf_topics SET forum_id=YY where title like '%word1%' and title like '%word2%' AND forum_id=41


- word1 and not word 2 :

QUOTE
SELECT tid, title, forum_id FROM ibf_topics where title like '%word1%' and title not like '%word2%' and forum_id=YY


QUOTE
UPDATE ibf_topics SET forum_id=YY where title like '%word1%' and title not like '%word2%' AND forum_id=YY


I hope it's correct...

This also helped me to translate my blog's block names biggrin.gif original.gif
http://forums.invisionpower.com/index.php?...5&#entry1181905

So thank you very much ! original.gif
bridgeaddict
OK, this is the correct syntax for complex queries:

SQL
SELECT tid, title, forum_id FROM ibf_topics where ((title like '%word1%') AND title like ('%word2%'))


and

SQL
SELECT tid, title, forum_id FROM ibf_topics where ((title like '%word1%') OR title like ('%word2%'))


I'm not sure that you can combine "like" and "not like" though - at least I've not been able to find a reference to that.

Hopefully that will give you a start. original.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.