News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Developer documentation on writing converters?

Started by Angelastic, October 17, 2015, 08:37:20 AM

Previous topic - Next topic

Angelastic

Hi,

I'd like to write a converter for some forum software a friend of mine wrote ages ago, which I'm sure nobody else would be interested in a converter for. I've been trying to find some documentation on how to write a converter, but the Converting to SMF page on the wiki essentially just tells me how to either run an existing converter or ask someone else to write a converter for me, and many of these forum threads seem to be about how to run converters rather than how to write them. Meanwhile, the developer documentation I've found seems to be about altering SMF itself or writing mods. I'm sure I'm just looking in the wrong places. Can anyone point me to the documentation I need?

Also, the existing converters I looked at have xxxx_to_smf.sql files that seem to select various data from the source database, but the forum software I want to convert from stored everything in text files (it's very old!) so I wonder if I can even write a converter in the standard way (I did find a thread here where someone was wondering if they could convert html files and told they couldn't.) I have already written some php code which parses the text files, so all I need to know is the proper way to get that data into the SMF database. It doesn't have to be a full conversion (it probably can't be; the forum I'm converting from doesn't even have proper users.) I'd just like to add archive threads with the text and human-readable metadata of the messages in them in some format, so that people can read the old discussions. And obviously I'd like to do it through some kind of library rather than messing with the SMF database directly.

Any hints? :)

Alternatively, I guess I could process the text files into something I could simply paste into some long posts using the regular forum interface, but I'd like to try writing a converter if that's possible.

Oldiesmann

Take a look at the converters for either eBlah or YaBB, as both systems use text files for storage.
Michael Eshom
Christian Metal Fans

Angelastic

Thanks; I will have a look at those. :) But is there any actual documentation on it or do I just have to figure it out from reading the code?

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Angelastic

Okay, what about documentation on the database schema? The tables I'd probably have to update look mostly self-explanatory, but there might be other ones that I don't realise need to be changed. :)

margarett

Unless you'll be trying to create a super duper complete converter, the obvious are what you need ;)

Members, categories, boards, topics, messages.
Then, still doable, polls, poll_options, log_polls, personal messages

From here on, it heavily depends on which data you have available and how much effort you're willing to invest. Attachments are possible, avatars, smiles, etc, depends. Member groups, permissions, various settings are usually left for manual tuning
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: