I need to remove the bump topic of the recent page
-
When write in the topic, it rises to the top.
It is necessary to disable.Please, help.
-
You can modify core to do it.
Change this code https://github.com/NodeBB/NodeBB/blob/master/src/topics/posts.js#L19-L31
to
Topics.onNewPostMade = function(postData, callback) { async.parallel([ function(next) { Topics.increasePostCount(postData.tid, next); }, function(next) { Topics.setTopicField(postData.tid, 'lastposttime', postData.timestamp, next); }, function(next) { Topics.addPostToTopic(postData.tid, postData.pid, postData.timestamp, 0, next); } ], callback); };
Then new replies wont bump the topic in /recent
-
Right you would need to add a
Topics.updateRecent(tid, timestamp, callback);
call into Topics.create() function so that topics are initialy added to /recent.Change the following code in Topics.create()
NodeBB/src/topics/create.js at master · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/src/topics/create.js at master · NodeBB/NodeBB
GitHub (github.com)
to
db.sortedSetsAdd([ 'topics:tid', 'topics:recent', 'cid:' + topicData.cid + ':tids', 'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids' ], timestamp, topicData.tid, next);
-
I found a partial solution.
I replaced (src/topics/recent.js):
Topics.updateRecent = function(tid, timestamp, callback) { callback = callback || function() {}; db.sortedSetAdd('topics:recent', timestamp, tid, callback); };
on -
Topics.updateRecent = function(tid, timestamp, callback) { callback = callback || function() {}; db.sortedSetAdd('topics:tid', timestamp, tid, callback); };
Now, posts do not raise the topics. BUT... when creating new topics they do not appear in the list.
-
@baris said:
Right you would need to add a
Topics.updateRecent(tid, timestamp, callback);
call into Topics.create() function so that topics are initialy added to /recent.Change the following code in Topics.create()
NodeBB/src/topics/create.js at master · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/src/topics/create.js at master · NodeBB/NodeBB
GitHub (github.com)
to
db.sortedSetsAdd([ 'topics:tid', 'topics:recent', 'cid:' + topicData.cid + ':tids', 'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids' ], timestamp, topicData.tid, next);
lol, everything was working when I replaced:
'topics:tid', 'topics:recent',
on
'topics:recent', 'topics:tid',
Thank you.