Is it possibile create a topic in the future?

  • GNU/Linux

    Is it possibile create a topic automatically in the future with a timestamp ? Anyone can help me?

  • Admin

    Yes, you can pass a timestamp in the future to the method.

  • GNU/Linux

    @baris I suppose that I'm wroing something because the topic is not created in the future. In my plugin.json I use this hook:

    { "hook": "", "method": "modificaPost" }

    In my library.js I do this:

    converter.modificaPost = function(data, callback) {
    	console.log("DATA " + JSON.stringify(data));
    	//I Take the timestamp from database and you can suppose that it is correct because I check ten times.
    		function(next) {
    //take the timestamp relative to user
    		db.getObject(hash + ":uid:" + data.uid, next);
    		function(timestamp, next) {
    		var timestamp_nuovo = timestamp.timestamp;
    			data.timestamp = timestamp.timestamp;, next);
    	], function(err) {
    		if (err) {
    			//return callback(err);
    	console.log("DATA NUOVA " + JSON.stringify(data));
    		return callback(null, data);

    Anyone can help me?

  • Plugin & Theme Dev

    @Doppy is triggered after the topic is created. You will want to listen to filter:topic.create and change the timestamp in the data passed to the hook.

Log in to reply


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.