@baris Thank you very much it worked !!
hentai22
Posts
-
Put a forum to top of the index when latest thread is made in there. -
Put a forum to top of the index when latest thread is made in there.About this plugin... https://github.com/julianlam/nodebb-plugin-subcategory-reordering#readme
When a new topic has been posted in subcategory, the current problem is that it orders that subcategory to top of parent category if and only if I restart the forum, so is working only first time after the forum is rebooted. It was supposed to order the subcategory to top of parent category whenever a new topic/reply is made in that subcategory. Here is code that does it:
plugin.onNewTopicOrReply = function(data) { var cid = data.topic ? data.topic.cid : data.post.topic.cid; categories.getCategoryField(cid, 'parentCid', function(err, parentCid) { if (parseInt(parentCid, 10) !== 0 && plugin._settings['cid:' + parentCid + ':enabled'] === 'on') { floatToTop(cid, parentCid); } }); }; function floatToTop(cid, parentCid) { db.sortedSetAdd('cid:' + parentCid + ':children', -Date.now(), cid, function(err) { if (!err) { winston.verbose('[plugins/subcategory-reordering] Floating cid ' + cid + ' to the top of cid ' + parentCid + '.'); } else { winston.error(err.message); } }); }
So it calls floatToTop and db.sortedSetAdd sorts category by date I guess. But the problem is it does not apply real-time but works only after each time the forum is rebooted.
How can I fix it so that it works real-time?
-
Put a forum to top of the index when latest thread is made in there.just latest version of nodebb then installed it (https://github.com/julianlam/nodebb-plugin-subcategory-reordering#readme). it worked only in the case that I restarted the forum, but not automatially order the forums whenenver any new post is made.
Help please~
-
Put a forum to top of the index when latest thread is made in there.then why it didnt work? I said it only worked.after i restarts the forum each time.
-
Put a forum to top of the index when latest thread is made in there.Hi thanks!
I tried but it didn't work (it only works when I restart the forum but not real time as soon as I post) ! it gives me following error:2019-07-01T20:39:54.868Z [4567/22748] - warn: [deprecated] requiring core modules with `module.parent.require('./categories')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead. 2019-07-01T20:39:54.869Z [4567/22748] - warn: [deprecated] requiring core modules with `module.parent.require('./database')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead. 2019-07-01T20:39:54.869Z [4567/22748] - warn: [deprecated] requiring core modules with `module.parent.require('./database')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead. 2019-07-01T20:39:54.869Z [4567/22748] - warn: [deprecated] requiring core modules with `module.parent.require('./database')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead. 2019-07-01T20:39:54.869Z [4567/22748] - warn: [deprecated] requiring core modules with `module.parent.require('./database')` is deprecated. Please use `require.main.require("./src/<module_name>")` instead.
Looks like I need some modifications in actual source codes. What should I replace?
I use latest nodebb version. -
Put a forum to top of the index when latest thread is made in there.Hi I need a feature that puts a forum in a top of index when latest thread is made. Is there such plugin? if not, is it posssible to develop by myself?
-
Can I use nodebb for adult community?Like many discord server has adult contents with nsfw marked, can I use nodebb for such purpose?