Importing and exporting in Custom Fields [Guide] [Deleted]

Jon W

Well-known member
Jon - this is a phenomenal must have addon for extra metadata fields for threads. I was wondering how one might be able to import data from an existing table, e.g. a simple flat file of values corresponding to thread ID numbers, e.g. a color for every thread, e.g. 1 is blue, 2 is red, 4 is green, etc. I noticed that data is stored is serialized, probably because of the various types of different custom fields you can store. While you can import and export the field parameters, is it easy to import values? I didn't recall seeing a tool - but I wonder whether it can be done manually. The blob I see entered in several places"

xf_thread The values of the variable chosen and to be linked to a thread ID
xf_thread_field (values in custom field for the variables for storage)
xf_thread_field_value (the values of the array of data to be linked to a thread ID)

xf_thread
a:1:{s:12:"Color";s:7:"Blue";}
a:1:{s:12:"Color";s:12:"Purple";}

a:1 - probably the ID of custom field
s:12 - this stays consistent for the name of the custom field
s:7 - I see the list here in the blog in xf_thread_field, which contains all the values.

xf_thread_field
This has the entire list of different values and an identifier

When I look at storage, I can see the following and can create a dummy table in Excel to populate the thread to correspond to the xf_thread_field_value that seems to be imported:
thread_id, field_id, field_value -- I have this exact list.

So in theory, this can be imported but there may be other moving parts.

NOTE for what would be a nice addition:
  • Required field
  • Editing threads. I tried to edit a custom thread's data and, even going to more choices, the dropdown that appears on create thread doesn't appear for editing.

This is an incredibly powerful addon, as well as the other modules. Thanks so much for this amazing tool.
 
In theory, yes, although is not easy with serialised data. Do drop me a PM if this is something you'd be interested in contributing to have developed properly.
 
Top Bottom