Add Permalink to phpbb3 import script.
This commit is contained in:
parent
5dd746d61f
commit
9e46690086
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue