mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Support custom avatar in SMF1 importer
This commit is contained in:
@ -168,9 +168,17 @@ class ImportScripts::Smf1 < ImportScripts::Base
|
||||
end
|
||||
|
||||
# avatar
|
||||
avatar_url = if u["avatar"].present?
|
||||
u["avatar"]
|
||||
elsif u["attachmentType"] == 0 && u["id_attach"].present?
|
||||
avatar_url = nil
|
||||
|
||||
if u["avatar"].present?
|
||||
if u["avatar"].start_with?("http")
|
||||
avatar_url = u["avatar"]
|
||||
elsif u["avatar"].start_with?("avatar_")
|
||||
avatar_url = "#{FORUM_URL}/avatar-members/#{u["avatar"]}"
|
||||
end
|
||||
end
|
||||
|
||||
avatar_url ||= if u["attachmentType"] == 0 && u["id_attach"].present?
|
||||
"#{FORUM_URL}/index.php?action=dlattach;attach=#{u["id_attach"]};type=avatar"
|
||||
elsif u["attachmentType"] == 1 && u["filename"].present?
|
||||
"#{FORUM_URL}/avatar-members/#{u["filename"]}"
|
||||
|
Reference in New Issue
Block a user