Changeset 2147
- Timestamp:
- 11/27/2009 03:58:51 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
bp-activity/bp-activity-classes.php (modified) (1 diff)
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-activity/bp-activity-widgets.php (modified) (3 diffs)
-
bp-groups.php (modified) (2 diffs)
-
bp-themes/bp-default/_inc/css/screen.css (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r2138 r2147 460 460 global $wpdb; 461 461 462 if ( !empty( $filter_array['user_id'] ) ) { 463 $user_filter = explode( ',', $filter_array['user_id'] ); 464 $user_sql = ' ( '; 465 466 $counter = 1; 467 foreach( (array) $user_filter as $user ) { 468 $user_sql .= $wpdb->prepare( "user_id = %d", trim( $user ) ); 469 470 if ( $counter != count( $user_filter ) ) 471 $user_sql .= ' || '; 472 473 $counter++; 474 } 475 476 $user_sql .= ' )'; 477 $filter_sql[] = $user_sql; 478 } 479 462 480 if ( !empty( $filter_array['object'] ) ) { 463 481 $object_filter = explode( ',', $filter_array['object'] ); -
trunk/bp-activity/bp-activity-templatetags.php
r2138 r2147 156 156 $filter = array( 'object' => $_GET['afilter'] ); 157 157 else 158 $filter = array( ' object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id );158 $filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id ); 159 159 160 160 $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden ); -
trunk/bp-activity/bp-activity-widgets.php
r2128 r2147 10 10 function bp_activity_widget() { 11 11 parent::WP_Widget( false, $name = __( 'Site Wide Activity', 'buddypress' ) ); 12 13 if ( is_active_widget( false, false, $this->id_base ) ) 14 wp_enqueue_script( 'activity_widget_js', BP_PLUGIN_URL . '/bp-activity/js/widget-activity.js' ); 12 15 } 13 16 … … 20 23 echo $before_title 21 24 . $widget_name . 22 ' <a class="rss-image" href="' . bp_get_sitewide_activity_feed_link() . '" title="' . __( 'Site Wide Activity RSS Feed', 'buddypress' ) . '">' . __( '[RSS]', 'buddypress' ) . '</a>' 25 ' <span class="ajax-loader"></span> 26 <a class="rss-image" href="' . bp_get_sitewide_activity_feed_link() . '" title="' . __( 'Site Wide Activity RSS Feed', 'buddypress' ) . '">' . __( '[RSS]', 'buddypress' ) . '</a>' 23 27 . $after_title; ?> 24 28 25 <?php if ( bp_has_activities( 'type=sitewide&max=' . $instance['max_items'] . '&per_page=' . $instance['per_page'] . '&display_comments=threaded' ) ) : ?> 29 <?php if ( is_user_logged_in() ) : ?> 30 <div class="item-list-tabs"> 31 <ul> 32 <li class="selected" id="activity-all"><a href="<?php bp_root_domain() ?>"><?php _e( 'All Members', 'buddypress' ) ?></a></li> 33 <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-friends/' ?>"><?php _e( 'My Friends', 'buddypress') ?></a></li> 34 <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-groups/' ?>"><?php _e( 'My Groups', 'buddypress') ?></a></li> 26 35 27 <?php if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) : ?> 28 <div class="pagination"> 29 <div class="pag-count" id="activity-count"> 30 <?php bp_activity_pagination_count() ?> 31 </div> 36 <?php do_action( 'bp_activity_types' ) ?> 32 37 33 <div class="pagination-links" id="activity-pag"> 34 <?php bp_activity_pagination_links() ?> 35 </div> 36 </div> 38 <li id="activity-filter-select"> 39 <select> 40 <option value="-1"><?php _e( 'No Filter', 'buddypress' ) ?></option> 41 <option value="new_wire_post"><?php _e( 'Updates Only', 'buddypress' ) ?></option> 42 <option value="new_forum_post,new_forum_topic"><?php _e( 'Group Forum Activity Only', 'buddypress' ) ?></option> 43 <option value="new_blog_post,new_blog_comment"><?php _e( 'Blog Activity Only', 'buddypress' ) ?></option> 37 44 38 <ul id="activity-filter-links"> 39 <?php bp_activity_filter_links() ?> 40 </ul> 41 <?php endif; ?> 45 <?php do_action( 'bp_activity_filter_options' ) ?> 46 </select> 47 </li> 48 </ul> 49 </div> 50 <?php endif; ?> 42 51 52 <div class="astream"> 53 <?php // The loop will be loaded here via AJAX on page load to retain settings. ?> 54 </div> 55 56 <?php echo $after_widget; ?> 57 <?php 58 } 59 60 function update( $new_instance, $old_instance ) { 61 $instance = $old_instance; 62 $instance['max_items'] = strip_tags( $new_instance['max_items'] ); 63 $instance['per_page'] = strip_tags( $new_instance['per_page'] ); 64 65 return $instance; 66 } 67 68 function form( $instance ) { 69 $instance = wp_parse_args( (array) $instance, array( 'max_items' => 200, 'per_page' => 25 ) ); 70 $per_page = strip_tags( $instance['per_page'] ); 71 $max_items = strip_tags( $instance['max_items'] ); 72 ?> 73 74 <p><label for="bp-activity-widget-sitewide-per-page"><?php _e('Number of Items Per Page:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'per_page' ); ?>" name="<?php echo $this->get_field_name( 'per_page' ); ?>" type="text" value="<?php echo attribute_escape( $per_page ); ?>" style="width: 30%" /></label></p> 75 <p><label for="bp-core-widget-members-max"><?php _e('Max items to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_items' ); ?>" name="<?php echo $this->get_field_name( 'max_items' ); ?>" type="text" value="<?php echo attribute_escape( $max_items ); ?>" style="width: 30%" /></label></p> 76 <?php 77 } 78 } 79 80 function bp_activity_widget_loop( $type = 'all', $filter = false, $per_page = 20 ) { 81 global $bp; 82 83 /* Set a valid type */ 84 if ( !$type || ( 'all' != $type && 'friends' != $type && 'groups' != $type ) ) 85 $type = 'all'; 86 87 if ( ( 'friends' == $type || 'groups' == $type ) && !is_user_logged_in() ) 88 $type = 'all'; 89 90 switch( $type ) { 91 case 'friends': 92 $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) ); 93 $query_string = 'user_id=' . $friend_ids; 94 break; 95 case 'groups': 96 $groups = groups_get_user_groups( $bp->loggedin_user->id ); 97 $group_ids = implode( ',', $groups['groups'] ); 98 $query_string = 'object=groups&primary_id=' . $group_ids; 99 break; 100 } 101 102 /* Build the filter */ 103 if ( $filter && $filter != '-1' ) 104 $query_string .= '&action=' . $filter; 105 106 /* Add the per_page param */ 107 $query_string .= '&per_page=' . $per_page; 108 109 if ( bp_has_activities( $query_string . '&display_comments=threaded' ) ) : ?> 43 110 <ul id="site-wide-stream" class="activity-list"> 44 111 <?php while ( bp_activities() ) : bp_the_activity(); ?> … … 78 145 79 146 <?php else: ?> 147 <?php echo "-1<div id='message' class='info'><p>" . __( 'No activity found', 'buddypress' ) . '</p></div>'; ?> 148 <?php endif; 149 } 80 150 81 <div class="widget-error"> 82 <?php _e('There has been no recent site activity.', 'buddypress') ?> 83 </div> 84 <?php endif;?> 151 /* The ajax function to reload the activity widget. In here because this is a self contained widget. */ 152 function bp_activity_ajax_widget_filter() { 153 bp_activity_widget_loop( $_POST['type'], $_POST['filter'] ); 154 } 155 add_action( 'wp_ajax_activity_widget_filter', 'bp_activity_ajax_widget_filter' ); 85 156 86 <?php echo $after_widget; ?>87 <?php88 }89 157 90 function update( $new_instance, $old_instance ) {91 $instance = $old_instance;92 $instance['max_items'] = strip_tags( $new_instance['max_items'] );93 $instance['per_page'] = strip_tags( $new_instance['per_page'] );94 158 95 return $instance;96 }97 98 function form( $instance ) {99 $instance = wp_parse_args( (array) $instance, array( 'max_items' => 200, 'per_page' => 25 ) );100 $per_page = strip_tags( $instance['per_page'] );101 $max_items = strip_tags( $instance['max_items'] );102 ?>103 104 <p><label for="bp-activity-widget-sitewide-per-page"><?php _e('Number of Items Per Page:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'per_page' ); ?>" name="<?php echo $this->get_field_name( 'per_page' ); ?>" type="text" value="<?php echo attribute_escape( $per_page ); ?>" style="width: 30%" /></label></p>105 <p><label for="bp-core-widget-members-max"><?php _e('Max items to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_items' ); ?>" name="<?php echo $this->get_field_name( 'max_items' ); ?>" type="text" value="<?php echo attribute_escape( $max_items ); ?>" style="width: 30%" /></label></p>106 <?php107 }108 }109 159 ?> -
trunk/bp-groups.php
r2128 r2147 1918 1918 } 1919 1919 1920 /* TODO: These user group functions could be merged with the above with an optional user ID param */ 1921 1920 1922 function groups_get_user_groups( $user_id = false, $pag_num = false, $pag_page = false ) { 1921 1923 global $bp; … … 1926 1928 return BP_Groups_Member::get_group_ids( $user_id, $pag_num, $pag_page ); 1927 1929 } 1928 1929 /* TODO: These user group functions could be merged with the above with an optional user ID param */1930 1930 1931 1931 function groups_get_recently_joined_for_user( $user_id = false, $pag_num = false, $pag_page = false, $filter = false ) { -
trunk/bp-themes/bp-default/_inc/css/screen.css
r2145 r2147 1263 1263 border-bottom: 1px solid #eee; 1264 1264 } 1265 ul#activity-filter-links li#afilter-blogs a {1266 background: url(../images/blog_bullet.gif) 20px 4px no-repeat;1267 }1268 1269 ul#activity-filter-links li#afilter-profile a {1270 background: url(../images/profile_bullet.gif) 0 4px no-repeat;1271 }1272 1273 ul#activity-filter-links li#afilter-friends a {1274 background: url(../images/friends_bullet.gif) 0 4px no-repeat;1275 }1276 1277 ul#activity-filter-links li#afilter-groups a {1278 background: url(../images/groups_bullet.gif) 0 4px no-repeat;1279 }1280 1281 ul#activity-filter-links li#afilter-wire a {1282 background: url(../images/wire_bullet.gif) 0 4px no-repeat;1283 }1284 1285 ul#activity-filter-links li#afilter-status a {1286 background: url(../images/status_bullet.gif) 0 4px no-repeat;1287 }1288 1289 1265 .activity-list li.mini { 1290 1266 font-size: 0.9em; … … 1391 1367 } 1392 1368 1393 ul#activity-filter-links{1369 div.item-list-tabs ul { 1394 1370 margin: 0; 1395 1371 padding: 0; … … 1397 1373 background: url(../images/item_list_back.gif) top left repeat-x; 1398 1374 padding: 15px; 1399 min-height: 22px;1400 1375 overflow: hidden; 1401 1376 } 1402 .activity ul#activity-filter-links { 1403 margin-top: 35px; 1404 } 1405 1406 ul#activity-filter-links li { 1377 1378 div.item-list-tabs ul li { 1407 1379 float: left; 1408 margin-bottom: 5px; 1409 } 1410 ul#activity-filter-links li a { 1380 } 1381 div.item-list-tabs ul li a { 1411 1382 display: block; 1412 padding: 2px 8px 2px 30px;1383 padding: 2px 8px; 1413 1384 background-color: #fff !important; 1414 1385 background-position: 8px 6px !important; … … 1420 1391 text-decoration: none; 1421 1392 } 1422 ul#activity-filter-linksli.selected a {1393 div.item-list-tabs ul li.selected a { 1423 1394 border: 1px solid #ccc; 1395 color: #555; 1424 1396 font-weight: bold; 1425 1397 } 1426 1398 1427 ul#activity-filter-links li#afilter-clear a {1399 div.item-list-tabs ul li.afilter-clear a { 1428 1400 background: url(../images/error_icon.gif) 0 4px no-repeat; 1429 1401 border-color: #ffa6ac; 1430 1402 color: #ff5560; 1431 1403 } 1404 1405 div.item-list-tabs li#activity-filter-select { 1406 float: right; 1407 } 1408 div.item-list-tabs li#activity-filter-select select { 1409 max-width: 120px; 1410 } 1432 1411 1433 1412 a.rss-image {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)