Dev: Invision v4 converter, SQL -> field_map
I’ve been working on a converter to import our Invision v4 forum to bbPress. I’ve got the users, forums and topics all importing reasonably well.
I’m having trouble with the titles which are stored in a language table:
| word_id | ... | word_app | ... | word_key | word_default | word_custom | ... | 8379 | ... | forums | ... | forums_forum_2 | Generic Discussion | Generic Discussion | ...
To retrieve a single forum title, I can use:
SELECT word_default as forum_name FROM ipbforum.core_sys_lang_words WHERE word_key = CONCAT('forums_forum_', 2)
or to retrieve them all, something like:
SELECT word_default FROM ipbforum.core_sys_lang_words WHERE word_app = 'forums' AND word_key IN (SELECT CONCAT(prefix, id) FROM (SELECT 'forums_forum_' as prefix, ipbforum.forums_forums.id FROM ipbforum.forums_forums) AS t)
Or all with the forum ids:
SELECT ipbforum.core_sys_lang_words.word_default as forum_name, word_key_table.forum_id as forum_id FROM ipbforum.core_sys_lang_words, (SELECT CONCAT(prefix, id) AS word_key, id AS forum_id FROM (SELECT 'forums_forum_' AS prefix, ipbforum.forums_forums.id FROM ipbforum.forums_forums) AS temp) AS word_key_table WHERE ipbforum.core_sys_lang_words.word_key = word_key_table.word_key
but I’m struggling to figure out how to write that in the
I’ve looked at some other converters and don’t see anything similarly complicated so I’m assuming there’s a more straightforward way.
Any pointers appreciated! Once this is figured, the converter should be good enough for most people’s use.
- You must be logged in to reply to this topic.