Advertisement:

Author Topic: Developer documentation on writing converters?  (Read 2636 times)

Offline Angelastic

  • Newbie
  • *
  • Posts: 3
Developer documentation on writing converters?
« on: October 17, 2015, 08:37:20 AM »
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.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,925
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Developer documentation on writing converters?
« Reply #1 on: October 17, 2015, 11:47:57 AM »
Take a look at the converters for either eBlah or YaBB, as both systems use text files for storage.
Michael Eshom
Cincy Space - now open!

Offline Angelastic

  • Newbie
  • *
  • Posts: 3
Re: Developer documentation on writing converters?
« Reply #2 on: October 17, 2015, 07:21:41 PM »
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?

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,759
  • Gender: Male
Re: Developer documentation on writing converters?
« Reply #3 on: October 17, 2015, 07:39:24 PM »
There isn't, no :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

Offline Angelastic

  • Newbie
  • *
  • Posts: 3
Re: Developer documentation on writing converters?
« Reply #4 on: October 17, 2015, 10:27:23 PM »
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. :)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,759
  • Gender: Male
Re: Developer documentation on writing converters?
« Reply #5 on: October 18, 2015, 05:27:14 AM »
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

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