I promised to look if the problem can be solved via SQL. That's what I archieved right now:
select att.id_msg, att.id_attach, msg.body
from elkarte_messages msg, elkarte_attachments att
where att.id_msg=msg.id_msg
and att.attachment_type=0
order by 1,2;
...selects all messages with attachments that are not thumbnails (because we only want the real images, not the from Elk created thumbnails), sorted by message and attachment id. That's a list we can work with. Now we create a help table to work with:
create table help_msg_attachments
(
msg_id int(11),
attachment_id int(11),
body longtext,
body_new longtext,
ordinal int(11)
)
CHARSET=UTF8;
Now we can fill the table, first with only one message to play with:
insert into help_msg_attachments (msg_id, attachment_id, body)
select att.id_msg, att.id_attach, msg.body
from elkarte_messages msg, elkarte_attachments att
where msg.id_msg=91684
and att.id_msg=msg.id_msg
and att.attachment_type=0
order by 1,2;
Next step: We must find out how we handle different alignments and different types of old ILA codes (for example thumbnail or image). Maybe we have to skip this and only use thumbnails without alignment for the converted codes? Don't know the best solution right now as I used both with the old addon. Alignment for my car reviews, no alignment in other threads.