Generic message import

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Suggested Hosts
al4141
Registered User
Posts: 2
Joined: Mon Dec 01, 2014 4:02 pm

Re: Generic message import

Post by al4141 »

I've bitten the bullet and imported the posts to the live forum and have decided to not risk running the STK Reparse BBCode now that people are using it. The imported posts are still readable even if the quotes don't display properly and odd ones can be fixed by editing the post (with no changes). I'm going to leave it like that.

The incorrect post count is an odd one and it seems to be caused by the import MOD, not the STK but again, it's no big deal and it doesn't affect new posts so I'm happy to leave it like that rather than risk breaking the forum!
usju
Registered User
Posts: 13
Joined: Sun Nov 30, 2014 8:12 pm

Re: Generic message import

Post by usju »

I did a few tests and also the STK mod developer confirms that the topic author problem and the post count problem are not issues with the BBcode re-parse function of the STK but rather are issues with the message import tool.
-the post count issue is already there before running the re-parse tool
-the topic author problems also appears as soon as you edit one of the posts in a topic (without running the re-parse tool). The BBcode re-parse function just mass processes all posts and therefore brings out this issue on all topcis

If you are using this tool to import messages into a clean board you can try the SQL statements I posted earlier, after running the BBcode re-parse function, to fix the issues. But only on a clean board with no previous normal posts!
No doubt the SQL statements can be changed to only make the changes where needed but I am a complete SQL noob unfortunately.


Hopefully someone can take a look at the php code of this XML import tool again and make the necessary modifications to prevent these issues.

I suspect the issues are in this part of the code:

Code: Select all

// Store last post data in topic
		$post_count = sizeof($topic_elm);

		$sql_data = array(
			'topic_first_post_id'		=> $first_msg_id,
			'topic_last_post_id'		=> $msg_id,
			'topic_last_post_time'		=> $msg_date,
			'topic_last_view_time'      => $msg_date,
			'topic_last_poster_id'		=> $poster_data['user_id'],
			'topic_last_poster_name'	=> $poster_name,
			'topic_last_poster_colour'	=> (string)$poster_data['colour'],
			'topic_last_post_subject'	=> (string)$msg_data['title'],
			'topic_replies'             => $post_count,
			'topic_replies_real'        => $post_count,
			);
		$sql = 'UPDATE ' . TOPICS_TABLE . '
			SET ' . $db->sql_build_array('UPDATE', $sql_data) . '
			WHERE topic_id = ' . $topic_id;
		$db->sql_query($sql);

I've attached an updated version of the tool that incorporates the fixes from:
viewtopic.php?f=65&t=2115251&start=30#p13357471
and
viewtopic.php?f=65&t=2115251&start=30#p13375852
Although that last change doesn't seem to work (I imported a lot of topics with Danish characters and the topic titles still got truncated below 60 characters).

Install the 1.0.2 version from here:
viewtopic.php?f=65&t=2115251&start=15#p13267042
and copy my attached version over the existing apc_import_messages.php in phpbb3/www/includes/acp

Let's call it version 1.0.4 ;)
Attachments
acp_import_messages.php
(27.09 KiB) Downloaded 449 times
Locked

Return to “[3.0.x] Convertors”