Skip to:
Content
Pages
Categories
Search
Top
Bottom

Friends-Activity on Mainpage

  • Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    I once started a topic to this one and a friend of mine found a solution to put the friends activity on the mainpage.

    Now – since trunk 1303 that doesn\’t work anymore (and my friend is in vacation…). Does anyone have a nice solution for that? Maybe it\’s easier now with the newer trunk :-)

    Thanks for your help (I want to go live today :-))

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks :-)

    I found out. change in \plugins\buddypress\bp-activity\bp-activity-templatetags.php line 20-21 to

    function bp_activity_template( $type, $user_id, $per_page, $max, $timeframe ) {

    global $bp, $SHOWFRIENDS, $user_ID;

    if ($SHOWFRIENDS == ’1′) {$user_id=$user_ID;$type=’friends’;}

    Don’t edit the main files, it’s a bad idea. Use the template tags:

    <?php if ( bp_has_activities( 'type=friends&amp;user_id=' . bp_loggedin_user_id() . '&amp;max=30' ) ) : ?>
    <ul id="activity-list">
    <?php while ( bp_activities() ) : bp_the_activity(); ?>
    <li class="<?php bp_activity_css_class() ?>">
    <?php bp_activity_content() ?>
    </li>
    <?php endwhile; ?>
    </ul>
    <?php endif;?>

    Thanks Andy,

    but does that code above show my friends activity? I tried, but it’s nothing but empty…

    Do I have to modify it somehow?

    Avatar of jschires
    jschires
    Participant

    @jschires

    <?php if ( bp_has_activities( ‘type=friends&user_id=’ . bp_loggedin_user_id() . ‘&max=30′ ) ) : ?>

    <ul id=”activity-list”>

    <?php while ( bp_activities() ) : bp_the_activity(); ?>

    <li class=”<?php bp_activity_css_class() ?>”>

    <?php bp_activity_content() ?>

    <?php endwhile; ?>

    <?php endif;?>

    You just needed to remove the amp; from the above. This should work for you, Im sure it was just a copy paste error :-)

    Avatar of abcde666
    abcde666
    Participant

    @erich73

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

You must be logged in to reply to this topic.