Store the values in a database hash. Call it topic:{tid}:yourplugin
, where {tid} is the topic id.
The hash is a key-value store, so you would do,
db.setObjectField('topic:{tid}:yourplugin', 'priority', 'low')
to set a value. You do not need to define the object ahead of time.
Now you probably want to add that data to the template vars so it can be displayed to the user, so hook into filter:topic.build
and add the values.
plugin.topicBuild = function(data, next) {
db.getObject('topic:' + data.templateData.tid + ':yourplugin', function (err, yourdata){
if (err) console.log(err)
if (err || !yourdata) return next(null, data)
// Add your key-values to the template data.
data.templateData.yourplugin = yourdata
next(null, data)
})
}
Now you will be able to see the data in your template using, e.g.
{yourplugin.priority}