Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Activity & Topics Started

  • I’m using this in BP under the user’s profile.

    <h3 id="useractivity"><?php _e('User Activity') ?></h3>

    <div id="user-replies" class="user-recent"><h4><?php _e('Recent Replies'); ?></h4>
    <?php if ( $posts ) : ?>
    <ol>
    <?php foreach ($posts as $bb_post) : $topic = get_topic( $bb_post->topic_id ) ?>
    <li<?php alt_class('replies'); ?>>
    <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a> -
    <?php if ( $user->ID == bb_get_current_user_info( $user->ID ) ) printf(__('You last replied: %s ago'), bb_get_post_time()); else printf(__('User last replied: %s ago'), bb_get_post_time()); ?> |

    <span class="freshness"><?php
    if ( bb_get_post_time( 'timestamp' ) < get_topic_time( 'timestamp' ) )
    printf(__('Most recent reply: %s ago'), get_topic_time());
    else
    _e('No replies since');
    ?></span>
    </li>
    <?php endforeach; ?>
    </ol>
    <?php else : if ( $page ) : ?>
    <p><?php _e('No more replies.') ?></p>
    <?php else : ?>
    <p><?php _e('No replies yet.') ?></p>
    <?php endif; endif; ?>
    </div>

    <div id="user-threads" class="user-recent">
    <h4><?php _e('Topics Started') ?></h4>
    <?php if ( $topics ) : ?>
    <ol>
    <?php foreach ($topics as $topic) : ?>
    <li<?php alt_class('topics'); ?>>
    <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a> -
    <?php printf(__('Started: %s ago'), get_topic_start_time()); ?> |

    <span class="freshness"><?php
    if ( get_topic_start_time( 'timestamp' ) < get_topic_time( 'timestamp' ) )
    printf(__('Most recent reply: %s ago'), get_topic_time());
    else
    _e('No replies.');
    ?></span>
    </li>
    <?php endforeach; ?>
    </ol>
    <?php else : if ( $page ) : ?>
    <p><?php _e('No more topics posted.') ?></p>
    <?php else : ?>
    <p><?php _e('No topics posted yet.') ?></p>
    <?php endif; endif;?>
    </div>

    but I get: No replies yet. & No topics posted yet.

    what am I missing?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Replace the code from the default theme in your code and then try.

    it doesn’t work in BP. I’m missing something..

    can someone help me with this? Just change the top into a call function that pulls from the db?

    using this method: https://bbpress.org/forums/topic/heres-how-to-show-bbpress-info-inside-wordpress-without-full-integration

    Sorry, don’t know much (anything?) about BuddyPress… maybe try their forums? I bet they have a lot of insight into deep integration over there…

    What if I say I want the User Activity & Topics Started to show on the side instead of the profile, would that make a difference?

    I saw this in my bbpress header, what does it do?

    <?php
    $_head_profile_attr = '';
    if ( bb_is_profile() ) {
    global $self;
    if ( !$self ) {
    $_head_profile_attr = ' profile="http://www.w3.org/2006/03/hcard"';
    }
    }
    ?>

    It might be something I need to pull the User Activity & Topics Started???

    I have deep integration but it’s not pulling the information. I’m thinking this function `<?php if ( $posts ) : ?>

    ` is returning blank.

    here’s another way of forming my question….

    this

    <h2>Latest Forum Discussions</h2>
    <ul>
    <?php
    global $wpdb;
    $query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
    $results=$wpdb->get_results($query);
    foreach ($results as $result) {
    echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
    }
    ?>
    </ul>

    gets the Latest Forum Discussions, how do I get a USER SPECIFIC Latest Forum Discussions?

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