diff --git a/script/import_scripts/phpbb3/importer.rb b/script/import_scripts/phpbb3/importer.rb index f2c1dc9de1..ffcccae7bd 100644 --- a/script/import_scripts/phpbb3/importer.rb +++ b/script/import_scripts/phpbb3/importer.rb @@ -108,6 +108,26 @@ module ImportScripts::PhpBB3 end end + # uncomment below lines to create permalink for categories + # def create_category(opts, import_id) + # new_category = super + # Permalink.create(url: "viewforum.php?f=#{import_id}", category_id: new_category.id) + # new_category + # end + + # uncomment below lines to create permalink for topics + # def create_post(opts, import_id) + # post = super + # if post && (topic = post.topic) && (category = topic.category) + # url = "viewtopic.php?f=#{category.custom_fields["import_id"]}&t=#{opts[:import_topic_id]}" + + # if !Permalink.find_by(url: url) + # Permalink.create(url: url, topic_id: topic.id) + # end + # end + # post + # end + def import_private_messages if @settings.fix_private_messages puts '', 'fixing private messages' diff --git a/script/import_scripts/phpbb3/importers/post_importer.rb b/script/import_scripts/phpbb3/importers/post_importer.rb index b6de98622f..a00335232c 100644 --- a/script/import_scripts/phpbb3/importers/post_importer.rb +++ b/script/import_scripts/phpbb3/importers/post_importer.rb @@ -28,7 +28,8 @@ module ImportScripts::PhpBB3 id: row[:post_id], user_id: user_id, created_at: Time.zone.at(row[:post_time]), - raw: @text_processor.process_post(row[:post_text], attachments) + raw: @text_processor.process_post(row[:post_text], attachments), + import_topic_id: row[:topic_id] } if is_first_post