Search

bbPress Showcase » bbPress Chat

  1. Ennesus
    User has not uploaded an avatar

    junior member
    Joined: Dec '10
    Posts: 9

    offline

    Hi,

    I hope someone can help me out with this issue,
    I want to get a list of the latest topics by tag

    as example, I have topics in my forum where you can download mixtapes.
    check here

    I want a list of the recent 10 topics from this tag,
    wich I want to show at the homepage.

    Can someone help me out?

    Thanks a lot

    Posted 1 year ago #
  2. Ennesus
    User has not uploaded an avatar

    junior member
    Joined: Dec '10
    Posts: 9

    offline

    Does nobody have the answer?

    Posted 1 year ago #
  3. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    You'd need a custom mysql query to do that.

    Also bbPress 1.x stopped storing the "tagged on" date for some stupid reason (vs bbPress 0.9) to match how WordPress does it, so there is no easy historical trail.

    So if you are running 0.9, this is possible but very difficult under 1.x

    My Tag History plugin does this but it's for administrators from the admin menu.

    http://bbpress.org/plugins/topic/tag-history/

    If you know how to code you can look at the source for ideas.

    This is a demo of the bbPress Signatures plugin!
    If you use my plugins, please considering donating to help continue their development.
    Posted 1 year ago #
  4. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Oh wait, I am over thinking this.

    Very simple, just "borrow" what bbpress does internally.

    <table>
    <?php
    $tagged_topics = get_tagged_topics(bb_get_tag_id('mixtape'),1,10);
    foreach ($tagged_topics as $topic) {
    ?>
    <tr<?php topic_class(); ?>>
    	<td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a><?php topic_page_links(); ?></td>
    	<td class="num"><?php topic_posts(); ?></td>
    	<td class="num"><?php topic_last_poster(); ?></td>
    	<td class="num"><a href="<?php topic_last_post_link(); ?>" title="<?php topic_time(array('format'=>'datetime')); ?>"><?php topic_time(); ?></a></td>
    </tr>
    <?php } ?>
    </table>

    Note that bbPress goes by "freshness" by default, meaning when a topic was last replied to. If you want when the topic was created, it will be more tricky.

    Posted 1 year ago #
  5. Ennesus
    User has not uploaded an avatar

    junior member
    Joined: Dec '10
    Posts: 9

    offline

    Thanks a lot, I let you know when my new frontpage design is ready

    Posted 1 year ago #
  6. Ennesus
    User has not uploaded an avatar

    junior member
    Joined: Dec '10
    Posts: 9

    offline

    I just finished working on a footer with this technique
    check it out at Tapelifters

    Posted 1 year ago #
  7. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Nice work, just watch your query count because I bet it's very high on that page.

    You'd have to put this in your footer.php and then view the source.

    <!--
    <?php bb_timer_stop(1); echo ' - '.$bbdb->num_queries.' queries'; ?>
    -->
    Posted 1 year ago #
  8. Ennesus
    User has not uploaded an avatar

    junior member
    Joined: Dec '10
    Posts: 9

    offline

    I edited the footer, now it's displaying only the last 10 topics + the <h2> element at the top is clickable

    Posted 1 year ago #

RSS feed for this topic

Post a reply to “Get latest topics by tag”

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
39 users online from in the past 30 minutes. 17 bots 22 guests
3,611 views today 8,638 yesterday 16,043 peak. Most at once 47 today 60 yesterday 131 peak. Visited today: qamilon, pandoracam, lvgalliera
2,288 posts in 394 topics over 66 months by 430 of 2,165 members. Latest: qwe12345100, Janvelden, watchessaleus