Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/23/2009 11:46:50 PM (16 years ago)
Author:
apeatling
Message:

Converting the sitewide activity stream widget to use the correct activity stream template loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-widgets.php

    r1520 r1575  
    3131        $options['max_items'] = 20;
    3232    ?>
    33    
    34     <?php
    35     if ( !$activity = wp_cache_get( 'sitewide_activity', 'bp' ) ) {
    36         $activity = bp_activity_get_sitewide_activity( $options['max_items'] );
    37         wp_cache_set( 'sitewide_activity', $activity, 'bp' );
    38     }
    39     ?>
    4033
    41     <?php if ( $activity['activities'] ) : ?>
     34    <?php if ( bp_has_activities( 'type=sitewide&max=' . $options['max_items'] ) ) : ?>
     35
    4236        <div class="item-options" id="activity-list-options">
    4337            <img src="<?php echo $bp->activity->image_base; ?>/rss.png" alt="<?php _e( 'RSS Feed', 'buddypress' ) ?>" /> <a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a>
    4438        </div>
     39
    4540        <ul id="site-wide-stream" class="activity-list">
    46         <?php foreach( $activity['activities'] as $item ) : ?>
    47             <li class="<?php echo $item['component_name'] ?>">
    48                 <?php echo apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true ) ); ?>
     41        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     42            <li class="<?php bp_activity_css_class() ?>">
     43                <?php bp_activity_content() ?>
    4944            </li>
    50         <?php endforeach; ?>
     45        <?php endwhile; ?>
    5146        </ul>
     47
    5248    <?php else: ?>
     49
    5350        <div class="widget-error">
    5451            <?php _e('There has been no recent site activity.', 'buddypress') ?>
    5552        </div>
    56     <?php endif; ?>
     53
     54    <?php endif;?>
    5755
    5856    <?php echo $after_widget; ?>
Note: See TracChangeset for help on using the changeset viewer.