Skip to:
Content
Pages
Categories
Search
Top
Bottom

BBpress sidebar widget to show latest topics in forums?


  • kwerri
    Participant

    @kwerri

    Hi,

    Is there a widget out there which allows me to show the latest topics in the forums in the sidebar of my WordPress installation?

    I would like people who visit the front page of my site to easily see the newest activity on the forums without needing to go to the forum page.

Viewing 25 replies - 1 through 25 (of 32 total)

  • kwerri
    Participant

    @kwerri

    I wanted to use this plugin:

    http://wordpress.org/extend/plugins/bbpress-latest-discussion/

    but it’s no longer supported, and I wasn’t able to get it to work when I did install it.


    kwerri
    Participant

    @kwerri

    I wanted to use this plugin:

    http://wordpress.org/extend/plugins/bbpress-latest-discussion/

    but it’s no longer supported, and I wasn’t able to get it to work when I did install it.


    jaapmarcus
    Member

    @jaapmarcus

    Just made a small plugin for it.

    You can download it on http://eris.nu/wordpress/bbpress.

    Please note that only if the database of your blog is not the same as the forum you need the data about the database information. The prefix, url are always required.

    Please try out for testing later on i will add some improvements so you can load directly data from the config of bbpress instead enter it in a form.

    Later on I will add it to the WP plugin database.


    jaapmarcus
    Member

    @jaapmarcus

    Just made a small plugin for it.

    You can download it on http://eris.nu/wordpress/bbpress.

    Please note that only if the database of your blog is not the same as the forum you need the data about the database information. The prefix, url are always required.

    Please try out for testing later on i will add some improvements so you can load directly data from the config of bbpress instead enter it in a form.

    Later on I will add it to the WP plugin database.


    csabamarosi
    Member

    @csabamarosi

    Hi jaapmarcus,

    Am I able to display latest forum posts with timestamps (freshness) in a WP sidebar with your plugin? I’m currently using another one (http://wordpress.org/extend/plugins/bbpress-latest-discussion) but it doesn’t support displaying any date information, so I’ll give your one a try if it does.

    Thanks in advance,

    Csaba


    csabamarosi
    Member

    @csabamarosi

    Hi jaapmarcus,

    Am I able to display latest forum posts with timestamps (freshness) in a WP sidebar with your plugin? I’m currently using another one (http://wordpress.org/extend/plugins/bbpress-latest-discussion) but it doesn’t support displaying any date information, so I’ll give your one a try if it does.

    Thanks in advance,

    Csaba


    jaapmarcus
    Member

    @jaapmarcus

    Hello csabamarosi,

    I just have made some small changes and it will now show as well the fressness. The last version is now on my website. Its slightly different from the plugin on the wordpress website because those features are missing at this moment.

    Later on this week i will also update the wordpress plugin with this functionality and and a few other options. Like time format instead of freshness and show / disable time format or author.


    jaapmarcus
    Member

    @jaapmarcus

    Hello csabamarosi,

    I just have made some small changes and it will now show as well the fressness. The last version is now on my website. Its slightly different from the plugin on the wordpress website because those features are missing at this moment.

    Later on this week i will also update the wordpress plugin with this functionality and and a few other options. Like time format instead of freshness and show / disable time format or author.


    csabamarosi
    Member

    @csabamarosi

    Thanks man, I’ll check it out as soon as I can!


    csabamarosi
    Member

    @csabamarosi

    Thanks man, I’ll check it out as soon as I can!


    lespionage
    Member

    @lespionage

    Great work jaapmarcus!

    Is there any way to control your plugin with template tags. I would like to be able to edit the way the topics are displayed.


    lespionage
    Member

    @lespionage

    Great work jaapmarcus!

    Is there any way to control your plugin with template tags. I would like to be able to edit the way the topics are displayed.


    lespionage
    Member

    @lespionage

    Ah never mind. I did my own script with old fashion PHP/MySQL. Here is what I did if someone else are interested.

    <?php

    $query = (‘SELECT * FROM bb_posts ORDER BY post_id DESC LIMIT 5′);

    $result = mysql_query($query) or die(mysql_error());

    while($row = mysql_fetch_array($result))

    {

    echo $row;

    $query2 = (‘SELECT * FROM bb_users WHERE ID=”‘ . $row . ‘”‘);

    $result2 = mysql_query($query2) or die(mysql_error());

    while($row2 = mysql_fetch_array($result2))

    {

    echo $row2;

    }

    }

    ?>

    Just put it in your widget area and your are good to go.


    lespionage
    Member

    @lespionage

    Ah never mind. I did my own script with old fashion PHP/MySQL. Here is what I did if someone else are interested.

    <?php

    $query = (‘SELECT * FROM bb_posts ORDER BY post_id DESC LIMIT 5′);

    $result = mysql_query($query) or die(mysql_error());

    while($row = mysql_fetch_array($result))

    {

    echo $row;

    $query2 = (‘SELECT * FROM bb_users WHERE ID=”‘ . $row . ‘”‘);

    $result2 = mysql_query($query2) or die(mysql_error());

    while($row2 = mysql_fetch_array($result2))

    {

    echo $row2;

    }

    }

    ?>

    Just put it in your widget area and your are good to go.


    jaapmarcus
    Member

    @jaapmarcus

    Just commited a new version to the SVN of wordpress plugin.

    Change log:

    + Added Support to show date or freshness.

    + Added Possible to change template

    + Added Possible to change widget title instead using translate function

    - Fixed a small bug in topics fetched from database when fetching with the WP database connection

    - Fixed bug that will show only non deleted topics.


    jaapmarcus
    Member

    @jaapmarcus

    Just commited a new version to the SVN of wordpress plugin.

    Change log:

    + Added Support to show date or freshness.

    + Added Possible to change template

    + Added Possible to change widget title instead using translate function

    - Fixed a small bug in topics fetched from database when fetching with the WP database connection

    - Fixed bug that will show only non deleted topics.


    csabamarosi
    Member

    @csabamarosi

    There is something wrong with your site, it says fatal error so the plugin is kinda unreachable. :)


    csabamarosi
    Member

    @csabamarosi

    There is something wrong with your site, it says fatal error so the plugin is kinda unreachable. :)


    thebreiflabb
    Member

    @thebreiflabb

    If your wordpress and bbpress share the same database you can simply edit sidebar.php

    On the top of the file add:

    <?php require_once(ABSPATH."/forum/bb-load.php"); ?>

    This will give you access to the bbpress functions. (Edit to the path of your bbpress installation)

    Then where you are going to output your latest posts add this:

    <?php
    global $wpdb;
    $query = "SELECT * FROM bbp_topics WHERE topic_status='0' ORDER BY topic_time DESC LIMIT 6";
    $topics = $wpdb->get_results($query);
    $counter = 0;
    ?>

    This will find the latest posts, I do it this way so it won’t show the same topic several times if many posts have been made in the same topic. Also edit bbp_ to your bbpress db prefix.

    Finally to output simply add something similar to this:

    <div id="latest-posts" class="border">
    <h2>Latest forum posts</h2>
    <?php foreach($topics as $topic) : ?>
    <div class="<?php echo $counter % 2 ? "gray" : "white"; ?>"><a href="<?php topic_last_post_link($topic->topic_id); ?>"><?php topic_title($post->topic_id); ?></a></div>
    <?php $counter++; ?>
    <?php endforeach; ?>
    </div>

    Edit to your preference on html and css.


    thebreiflabb
    Member

    @thebreiflabb

    If your wordpress and bbpress share the same database you can simply edit sidebar.php

    On the top of the file add:

    <?php require_once(ABSPATH."/forum/bb-load.php"); ?>

    This will give you access to the bbpress functions. (Edit to the path of your bbpress installation)

    Then where you are going to output your latest posts add this:

    <?php
    global $wpdb;
    $query = "SELECT * FROM bbp_topics WHERE topic_status='0' ORDER BY topic_time DESC LIMIT 6";
    $topics = $wpdb->get_results($query);
    $counter = 0;
    ?>

    This will find the latest posts, I do it this way so it won’t show the same topic several times if many posts have been made in the same topic. Also edit bbp_ to your bbpress db prefix.

    Finally to output simply add something similar to this:

    <div id="latest-posts" class="border">
    <h2>Latest forum posts</h2>
    <?php foreach($topics as $topic) : ?>
    <div class="<?php echo $counter % 2 ? "gray" : "white"; ?>"><a href="<?php topic_last_post_link($topic->topic_id); ?>"><?php topic_title($post->topic_id); ?></a></div>
    <?php $counter++; ?>
    <?php endforeach; ?>
    </div>

    Edit to your preference on html and css.


    csabamarosi
    Member

    @csabamarosi

    Well, at first I was trying to do something very similar, but including bb-load.php always gives me errors. Deep integration and all database/cookie connections are working fine, so I’m pretty confused.


    csabamarosi
    Member

    @csabamarosi

    Well, at first I was trying to do something very similar, but including bb-load.php always gives me errors. Deep integration and all database/cookie connections are working fine, so I’m pretty confused.


    thebreiflabb
    Member

    @thebreiflabb

    What errors does it give you?


    thebreiflabb
    Member

    @thebreiflabb

    What errors does it give you?


    csabamarosi
    Member

    @csabamarosi

    I’ve figured out that there were some PHP configuration issues with my XAMPP installation, so the error messages are gone now. Sad thing is, your code doesn’t output anything at all.

Viewing 25 replies - 1 through 25 (of 32 total)

You must be logged in to reply to this topic.