Support Forum

Moving posts to another (existing) topic, splitting topics

30 Answers

New Answer

MP Mr Papa
Mr Papa
Member

single topic to existing topic?? you mean single post?

UN
Unknown
Member

My apologies.

 

I just want to move a single post to an existing topic.

 

Thanks.

MP Mr Papa
Mr Papa
Member

you can already do that… in the admin tools… but it has to be to a new topic…

UN
Unknown
Member

Right moving a single post to a new topic option I know.

 

But our admins want to move a single post to an existing topic because many users post in wrong topics.

 

Thanks.

MP Mr Papa
Mr Papa
Member

now that is problematic… and is in the list too, but it is going to confuse folks… because posts are not sorted by date order.. they are sorted by post id… this is a GREAT time and resource savings in forum execution… and for within a topic, they are the same thing really…

however, when we start moving posts from one topic to another existing topic, the sort order may appear to look odd to people and may appear out of order…

so, back to your hook idea… you will have to update the post and both topics…

UN
Unknown
Member

Thanks again for your quick reply.

 

Exactly my thoughts because I also realized that sort order after moving might look odd in the posts display. But I thnk for my admins it is more important to have a post at right topic rather than having this issue.

 

I will update wp_sfposts and wp_sftopics (post_count field needs to be updated and post_id field I believe represents the very last post_id within a topic – so that might also need to be updated depending upon the post selected to move).

 

Thanks.

YS Yellow Swordfish
Yellow Swordfish
Member

You will also need to rebuild the indexes in both topics (old and new). Look in the sf-support.php file for the two ‘build_index’ functions. You will need to call them both.

MP Mr Papa
Mr Papa
Member

sf_build_forum_index

and

sf_build_post_index

for each affected one…  and yes, in sf-database.php

UN
Unknown
Member

Thanks that’s what I thought. I will copy sf_move_post() function to a new one and make my changes there. That way I can piggyback most of its calls.

 

Many thanks for your help. You guys are awesome.

 

UN
Unknown
Member

Hi SPF Dev Team,

I didn’t get much time after posting my previous post but today I got little bit of time to work on it. And I am happy to report that it went very smoothly. My Forum now has this feature of mve post to an existing topic working like a charm. Here is the UI :

 

  1. Admins will now see a new option in Edit Tools (shown as wrench icon

    on top of every post to Admins) called “Move This Post to a Topic”.

  2. Once you click on this menu option a small pop-up will open with a

    drop-down list of all the forums.

  3. Select the destination forum and click”Next>”
  4. A new small pop-up will open with a drop-down list of all the

    existing topics within your chosen forum in previous

    step.

  5. If you selected wrong forum in step 3 you can always go back by

    clicking: “<Back”

     

  6. Select the destination topic where you want this post to move and

    click: “Move Poist”

     

  7. A confirmation (or failure if any) message will come up on top of

    the page with the yellow background and whola your post has moved.

PS: Earlier option has been renamed appropriately as “Move This Post

to a New Topic”

 

Thanks for all the help guys to point me to the right direction to build this feature.

cheers.

YS Yellow Swordfish
Yellow Swordfish
Member

So do you re-index both from and to forums and topics because you will need to.
And you must also realise that the post being moved will slot itself into it’s new topic sorted on its post id – so sequentially that could end up anywhere…

UN
Unknown
Member

Yes I do re-index it as suggested by you in previous posts. And yes I do realize that “sort by post it” syndrome but for us it was much more critical to have a post in right topic than a few incorrect post order display issues here & there.

 

Thanks.

MP Mr Papa
Mr Papa
Member

nice work. we have a ticket to consider this in future version too…