• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

I need to remove the bump topic of the recent page

Scheduled Pinned Locked Moved General Discussion
topic
7 Posts 2 Posters 2.6k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    When write in the topic, it rises to the top.
    It is necessary to disable.

    Please, help.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by baris
    #2

    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

    ? 1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    replied to <baris> on last edited by
    #3

    @baris Now it is impossible to post messages/topics.

    Perhaps a bit unclear:

    My home page - recent.
    And I need to completely disable the raising of the topics.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #4

    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()

    https://github.com/NodeBB/NodeBB/blob/master/src/topics/create.js#L64-L68

    to

    db.sortedSetsAdd([
    	'topics:tid',
    	'topics:recent',
    	'cid:' + topicData.cid + ':tids',
    	'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids'
    ], timestamp, topicData.tid, next);
    
    ? 2 Replies Last reply
    1
  • ? Offline
    ? Offline
    A Former User
    replied to <baris> on last edited by
    #5

    @baris Absolutely no changes. Unfortunately.

    Topics also rise when writing messages...

    1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #6

    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.

    1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    replied to <baris> on last edited by
    #7

    @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()

    https://github.com/NodeBB/NodeBB/blob/master/src/topics/create.js#L64-L68

    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.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development