Info
- 11 posts
- 4 voices
- Started 2 years ago by blah
- Latest reply from blah
- This topic is not resolved
prevent bump to top when new replies are submitted?
-
- Posted 2 years ago #
How can I prevent the topic not to shoot to the top whenever new replies are submitted?
-
- Posted 2 years ago #
When do you get bumped to the top? After posting a reply, or when you go to view a topic, you always start at the top?
Also, what version bbPress are you using?
-
- Posted 2 years ago #
After posting a reply. I know it's normal for the topic to be bumped to the top along w/ the "Freshness" but I would like the Freshness to be replaced by the exact date when topic was created and for it not to bump to the top when someone replies.
I'm using the latest 1.0.1.
-
- Posted 2 years ago #
I do this on one of my forums (a classified forum that I didn't want users 'bumping' on constantly.) Just add
<?php if ($forum_id == 3) { $limit = bb_get_option('page_topics'); $offset = ($page-1)*$limit; $forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id AND topic_status = 0 AND topic_sticky = 0 ORDER BY topic_id DESC LIMIT $limit OFFSET $offset"); $forum_one_topic_posts = get_thread( $topic->topic_id); $topics = $forum_one_topics; } ?>to the top of the forum.php file in your template. Take out the
if ($forum_id == 3) {and trailing}if you want to apply it to all your forums.To show topic creation date instead of freshness replace
topic_time();withget_topic_start_time();in the forum.php, and front-page.php template files - though I haven't tested that bit. -
- Posted 2 years ago #
Oh, you don't mean you (the browser) gets bumped to the top but that the topic gets bumped because it has a new reply. Got it now. Will tomdebruin's solution work for you?
-
- Posted 2 years ago #
I think
get_topic_start_time();will not echo it. You need to puttopic_start_time(); -
- Posted 2 years ago #
tomdebruin - thanks for helping but unfortunately your solution didn't work for me. my topics are still getting bumped to the top.
gautam - thanks, your solution worked!
now i just have this one problem left w/ the topic bumping thing and i'll be set. any other ideas i should try?
-
- Posted 2 years ago #
This code won't work on front-page.php but did you try it in forum.php? I'm running v1.0.1 and it's working fine there.
For the front page you need to find the SQL query that gets called and replace it with your own, and
ORDER BY topic_id. Let me know how you get on. I'll have a closer look tomorrow when I'm working from home. -
- Posted 2 years ago #
Tom,
I need it to be working on front-page.php. Can you further elaborate on the instructions? I'm not quite sure I'm following.
-
- Posted 2 years ago #
I think, for the front page, where all topics are shown, you should put this:
<?php $limit = bb_get_option('page_topics'); $offset = ($page-1)*$limit; $all_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE topic_status = 0 AND topic_sticky = 0 ORDER BY topic_id DESC LIMIT $limit OFFSET $offset"); $all_topic_posts = get_thread( $topic->topic_id); $topics = $all_topics; ?>Haven't tested it, but should work.
-
- Posted 2 years ago #
It worked! Thank you!
-
You must log in to post.