Skip to:
Content
Pages
Categories
Search
Top
Bottom

Freshness Link


  • CC-Cailin
    Participant

    @cc-cailin

    Hi. I noticed that the title of last post is only displayed when you hover over the freshness link. I’d like to display the title of the last post and the time in brackets. Can anyone help me?

Viewing 15 replies - 1 through 15 (of 15 total)

  • FreeWPress
    Participant

    @freewpress

    Hi, using this function: <?php bbp_forum_last_topic_title(); ?> in loop-single-forum.php it show a title of last topic with no “reply-to” label…


    CC-Cailin
    Participant

    @cc-cailin

    Awesome… great, thank you
    How do I display the time next to it? The <?php bbp_forum_freshness_link (); ?> displays it in link form… and I just want it next to the title in brackets (not linked)


    FreeWPress
    Participant

    @freewpress

    Hi, this is my solution:

    <div class="bbp-forum-last-topic-name"><a href="<?php bbp_forum_last_topic_permalink(); ?>" title="<?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a></div>

    Create a class in your bbpress css named bbp-forum-last-topic-name and give your personal style…

    Put all code into <li class="bbp-forum-freshness"> </li>


    CC-Cailin
    Participant

    @cc-cailin

    Awesome! Thank you… One more question though.
    After using your code, if there has been no posts made in a forum, it shows a random time (which seems to be the time I created the forum) and the topic title appears blank. How can I do this:

    if the forum has posts, show the latest post title and time (the code you gave me), otherwise show “No topics posted yet”.


    FreeWPress
    Participant

    @freewpress

    In strange, because i use this with no problems, are you sure u have add the code after freshenss in forum loop?? I have opened a new thread here because this metod of Freshness in forum do not work fine, it id discordant from topic Freshness..

    Please write here a link of your forum…


    CC-Cailin
    Participant

    @cc-cailin

    Hey, I modified it a little to fit the needs of my forum…
    I can’t show you the link as I’m working on localhost at the moment, but here is what I did.

    Inside loop-single-forum.php, I removed this:

    <?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    <?php bbp_forum_freshness_link(); ?>
    <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>

    And placed this in it’s place:

    <a class="bbp-forum-freshness" href="<?php bbp_forum_permalink(); ?>">
    <?php bbp_forum_last_topic_title(); ?></a> 
    (<?php bbp_forum_last_active_time(); ?>) by <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>

    Now the last step I need help with is…
    Right now if a forum doesn’t have posts in it yet, it shows the time I created the forum. Which is very weird. So what I i need is a php if/else code that would check if there is a forum_last_topic if there is, it must show my code… if there isn’t, it must show the text “No topics yet”. How do I do this? I have very basic php knowledge


    CC-Cailin
    Participant

    @cc-cailin

    Oh goodness! I get what you meant now!!! The link isn’t going to the topic… it is going to the forum 🙁


    niuserre
    Participant

    @niuserre

    You have <?php bbp_forum_permalink(); ?> in your code, which I guess should be <?php bbp_last_topic_permalink(); ?> if you want to link to the topic.


    FreeWPress
    Participant

    @freewpress

    Yes, @niuserre is ok!!


    Fuskeduske
    Participant

    @fuskeren

    Hi,

    I am using the code

    <div class=”bbp-forum-last-topic-name”>” title=”<?php bbp_forum_last_topic_title(); ?>”>

    <?php bbp_forum_last_topic_title(); ?></div>

    <p></p><?php bbp_forum_last_active_time(); ?>

    But i would like to replace the last topic link, with a link to the reply, i have tried bbp_forum_last_Reply_permalink but it just links to the reply only, and not inside the topic.


    Fuskeduske
    Participant

    @fuskeren

    I know it’s not good style to bump a topic, but does anyone have a “fix” 🙂


    Fuskeduske
    Participant

    @fuskeren

    I know see i missed some code

    <div class=”bbp-forum-last-topic-name”>” title=”<?php bbp_forum_last_topic_title(); ?>”>

    <?php bbp_forum_last_topic_title(); ?></div>

    <p></p><?php bbp_forum_last_active_time(); ?>


    Fuskeduske
    Participant

    @fuskeren

    Noone? 🙂

    I have tried the following

    bbp_forum_last_reply_permalinkinstead of bbp_forum_last_topic_permalink but that links to the reply only.

    I have too tried using bbp_reply_url, but that does not seem to work either.

    Is it true that there are no function for this yet, and it therefore have to be created? If so, where is bbp_reply_url – bbp_forum_last_reply_permalink – bbp_forum_last_topic_permalink located? Because then i might be able to figure the rest out myself.


    Fuskeduske
    Participant

    @fuskeren

    Found a solution, if anyone is looking for the same i found the following in /includes/forums/template.php

    bbp_forum_last_reply_url which seems to have resolved my issue.


    brent0r
    Participant

    @brent0r

    Is it possible to post your final, working code used?

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.
Skip to toolbar