Forums

Join
bbPress Support ForumsTroubleshootingControlling the Number of Latest Discussions

Info

Controlling the Number of Latest Discussions

  1. Hi,

    How can I control the number of latest discussions shown on the frontpage?

    I know I can edit the "topics shown on each page" in the config file but I just want a few topics on the frontpage and a different amount for the forums themselves.

    TIA
    Phillip

    UPDATE FROM MODERATOR (Feb 12, 2007):
    There is now a plugin for this which allows you to specify the number of topics that show up on many of bbPress' pages:

    http://bbpress.org/plugins/topic/3

  2. How about this plugin?

    function front_page_topics() {
    $bb->page_topics = 10;
    }
    add_action( 'bb_index.php_pre_db', 'front_page_topics' );

  3. I am not sure what you mean by that, as I have never created a plug-in before. Anways, I gave it a try as follows:

    Created a blank file with the following content:

    <?php

    function front_page_topics() {
    $bb->page_topics = 2;
    }
    add_action( 'bb_index.php_pre_db', 'front_page_topics' );

    ?>

    Then saved it as "latest-posts.php" and stored it in my newly created "my-plugins" folder.

    But it did not seem to have any effect as the front page of the forum would still display more that 2 latest posts (I selected to limit the topics to 2 so it would be asier to test).

    The only other thing I can think of is that this code needs to instead be added to one of the regular scripts, but I have no idea which one.

    thanks,

    thomas

  4. Oops, my fault. Do exactly what you did but put

    global $bb;

    directly under the function line.

    <?php

    function front_page_topics() {
    global $bb;
    $bb->page_topics = 2;
    }
    add_action( 'bb_index.php_pre_db', 'front_page_topics' );

    ?>

  5. That works perfectly. Thanks!

  6. Works for me too. Thanks to both of you!

    NO, wait when I try to open the tags.php I recieve this message:
    Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/forum/my-plugins/latest-topics.php:9) in /home/username/public_html/forum/bb-includes/functions.php on line 1304

    TIA

  7. Make sure there is no whitespace (spaces, extra lines, tabs, etc.) before the <?php in your plugin nor after the ?>

  8. Thanks, you were right on the money!

  9. Would anyone happen to know if this still applies to version 0.8? I have a new forum I'd like to try this in but I thought I'd check to make sure it wouldn't break anything first. Or is there another method that would work better?

    thanks!

  10. Looking it over, I can't see any reason why this won't work. I guess test it out and if you get and error, just delete the plugin and report back here!

    Trent

  11. That version of the plugin should work fine, but the most recent version (Front Page Topics 0.8) is a bit more configurable.

    http://bbpress.org/plugins/topic/3

  12. I tried it and everything seems to be running smoothly, thanks again for the quick response!

  13. Hey, thanks for the tip, mdawaffe. That was a breeze!

  14. mdawaffe's plugin isn't as cool as mine

    http://bbpress.org/plugins/topic/21?replies=1

    j/k about mine being cooler, but it may work in a way that you like better ;)

  15. You must log in to post.