==README for addon_movepost2.php==
Release date: December 6, 2004.
Latest update: June 27, 2018.
miniBB version: 3.3 or later
Author: Paul Puzyrev (minibb.com).

addon_movepost2.php is an add-on to miniBB (http://www.minibb.com), which allows forums administrator to move POSTS between different topics, also as create new topics based on some messages. Moving of multiple posts at once is possible.

==INSTALLATION==

**** Copy addon_movepost2.php to your forums directory.

**** Copy /lang/movepost_eng.php to your forums' /lang/ directory (translate if necessary)

**** Paste the code provided in bb_plugins.code.txt, into bb_plugins.php

**** Paste the code provided in bb_plugins_parseMessage.code.txt, into bb_plugins.php, function parseMessage(). This code displays direct "Move" link near each message. If the function parseMessage() is used for the other plugins already, the code for the Moving Replies add-on should be pasted before the 'return' statement, *not declaring the function twice*. Search in your current bb_plugins.php by 'parseMessage' for making sure this function does or not exist; if you create two functions of the same name, it will lead to the critical error in PHP ("Cannot redeclare parsemessage()...") and so your forum script would stop from being executed. 

**** Edit templates/main_posts_cell.html and right after {$allowed} paste: {$moveLink}


**** If you would like to enable group moving of posts (many posts at once):

		a) Enable $enableGroupMsgDelete option in setup_options.php file (it's available from v.2.0 RC5)

		b) Paste {$massMoveJs} in the JavaScript section of templates/main_posts.html file template (it will generate JavaScript code for submitting multiple messages to move).
		
		c) Paste {$massMoveLink} into templates/main_posts.html file, most preferrably between {$deleteAllMsgs} and {$stickyTopic} (this var will indicate "Move messages" link)
		
**** If you'd like to set up the quick list of pre-defined topics under the "Moving Reply" screen (so it's possible to paste some topic's ID quickly), modify $predefinedMovedTopics of bb_plugins.php and set up the array of pre-defined topics for that purpose, listed by comma.

**** If you'd like to add a feature, when clicking the Topic Title brings up an alert indicating the Topic ID (which could be then easily copied and pasted on the Moving Replies form and which will be available to admin/moderators only), paste {$onClickTopicTitle} to the <h1> tag of templates/main_posts.html (or some other tag which supposes onclick event on the Topic's Title). Example:

<h1 class="headingTitle"{$onClickTopicTitle}>{$topic_reverse}{$topicName}</h1>


==USAGE==

Moving posts is very rare operation, but it may be necessary if user has posted something which is not considered to be in some topic because discussion about that subject exists already. Only administrator of the forums (or rarely moderator, if you specify forum ID for him) can move posts.

"Movepost" interface contains 2 important fields (each needs to be filled in): post ID and topic ID, where post is considered to move to. Post ID is most likely filled in automatically and can not be changed. How to know about topic ID?

Find the topic, where you want to move that post to. Go the topic, and look at the URL field. It should look like this:

http://localhost/index.php?action=vthread&forum=4&topic=503

Look at the fragment "topic=some_digits". "Some_digits" will be your topic ID (in our case, it is 503).

In a case of mod_rewrite enabled, your URL may look like:

http://localhost/4_503_0.html

Topic ID will be the 2nd number in this "filename". 503 in this case.

NOTE: `$predefinedMovedTopics` array of bb_plugins.php may contain the list of some most-often used topics' IDs, such as "garbage can" or "off-topic" or "flood", if it's set up properly, you may skip the manual pasting of topic's ID (read above of how to set it up).

After proceeding don't forget to check out that post has been moved successfully, and both old topic and moved-to topic are showing correctly in topics listing and Recent discussions.

Add-on contains possibility to move some post to the NEW topic. You need to enter topic title and specify forum for that. DO NOT ENTER topic title, if you are just moving post from one topic to another! Just leave it empty. All post attributes (poster name, user ID, time etc.) will be copied to the new topic.

If you have $enableGroupMsgDelete option, it's possible to move many messages at once, checking the boxes under each message, and clicking "Move Messages" link at the bottom of page. Any information you need to specify, is the same as if you would move the separate message.

If you are using a premium File upload add-on for miniBB, don't worry about also moving posts containing file attachments - they should be moved amongst the messages automatically.

Attached are two files - how_it_looks_1.gif and how_it_looks_2.gif - from which you may understand how it must look after installation.

==NOTES==

Using this plugin, be careful!

1) If post is the first and the only one in the topic, topic WILL BE DELETED AUTOMATICALLY after post has been moved!

2) When moving posts original post ID is kept unchanged! That's why try to avoing moving older posts to the newest topics - topics are sorted by their ID or creation time, and if the topic creation time will be newer than the moved post's time, you can reach undesirable results (for example, in "Latest discussions" table). If you're moving a message with the earlier ID to the topic which has been created later, topic's author name will remain unchanged.

==FINALLY==

Hope, you'll enjoy. Please, post bugs and suggestions on our forums:
http://www.minibb.com/forums/11_4966_0.html
