Skip to:
Content

BuddyPress.org

Changeset 1180


Ignore:
Timestamp:
03/09/2009 05:34:01 PM (15 years ago)
Author:
apeatling
Message:

Added new user link functions
Added ability to specify a forum ID as the parent forum.
Other minor cleanups

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r1176 r1180  
    286286}
    287287
     288function bp_get_loggedin_user_link() {
     289    global $bp;
     290   
     291    return $bp->loggedin_user->domain;
     292}
     293
     294function bp_get_displayed_user_link() {
     295    global $bp;
     296   
     297    return $bp->displayed_user->domain;
     298}
     299
    288300function bp_core_get_wp_profile() {
    289301   
  • trunk/bp-forums.php

    r1162 r1180  
    1919
    2020define ( 'BP_FORUMS_VERSION', '1.0-RC1' );
     21define ( 'BP_FORUMS_PARENT_FORUM_ID', apply_filters( 'bp_forums_parent_forum_id', 0 ) );
    2122
    2223include_once( 'bp-forums/bp-forums-admin.php' );
     
    130131}
    131132
    132 function bp_forums_new_forum( $name = '', $desc = '', $parent = 0, $order = 0, $is_category = false ) {
     133function bp_forums_new_forum( $name = '', $desc = '', $parent = BP_FORUMS_PARENT_FORUM_ID, $order = 0, $is_category = false ) {
    133134    global $bbpress_live;
    134135   
  • trunk/bp-groups.php

    r1167 r1180  
    18251825}
    18261826
    1827 function groups_get_group_users( $group_id, $limit = false, $page = false ) {
     1827function groups_get_group_members( $group_id, $limit = false, $page = false ) {
    18281828    return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page );
    18291829}
     1830    function groups_get_group_users( $group_id, $limit = false, $page = false, $deprecated_function = true ) {
     1831        return groups_get_group_members( $group_id, $limit, $page );
     1832    }
    18301833
    18311834function groups_is_group_admin( $user_id, $group_id ) {
  • trunk/bp-groups/bp-groups-ajax.php

    r1138 r1180  
    2424        echo $user->avatar_thumb;
    2525        echo '<h4>' . $user->user_link . '</h4>';
    26         echo '<span class="activity">' . sprintf( __( 'active %s ago', 'buddypress' ), $user->last_active ) . '</span>';
     26        echo '<span class="activity">' . $user->last_active . '</span>';
    2727        echo '<div class="action">
    2828                <a class="remove" href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->groups->slug . '/' . $_POST['group_id'] . '/invites/remove/' . $user->id, 'groups_invite_uninvite_user' ) . '" id="uid-' . $user->id . '">' . __( 'Remove Invite', 'buddypress' ) . '</a>
     
    237237            <?php echo $pag_links ?>
    238238        </div>
    239 
     239       
     240        <?php $counter = 0; ?>
    240241        <ul id="groups-list" class="item-list">
    241242        <?php foreach ( $groups['groups'] as $group ) : ?>
     243           
     244            <?php $alt = ( $counter % 2 == 1 ) ? ' class="alt"' : ''; ?>
    242245            <?php $group = new BP_Groups_Group( $group->group_id, false, false ); ?>
    243             <li>
     246           
     247            <li<?php echo $alt ?>>
    244248                <div class="item-avatar">
    245249                    <img src="<?php echo $group->avatar_thumb ?>" class="avatar" alt="<?php echo $group->name ?> <?php _e( 'Avatar', 'buddypress' ) ?>" />
     
    267271                <div class="clear"></div>
    268272            </li>
     273           
     274            <?php $counter++ ?>
    269275        <?php endforeach; ?>
    270276        </ul>   
     
    323329
    324330        check_ajax_referer( 'groups_leave_group' );
    325 
     331       
    326332        if ( !groups_leave_group( $group->id ) ) {
    327333            _e( 'Error leaving group', 'buddypress' );
  • trunk/bp-groups/bp-groups-filters.php

    r1157 r1180  
    3333add_filter( 'bp_group_name', 'stripslashes' );
    3434
     35add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
     36
    3537?>
  • trunk/bp-groups/bp-groups-templatetags.php

    r1167 r1180  
    15291529
    15301530function bp_group_has_members( $group_id = false, $num_per_page = 10, $exclude_admins_mods = true, $exclude_banned = true ) {
    1531     global $members_template, $groups_template;
    1532    
     1531    global $members_template, $groups_template, $group_obj;
     1532   
     1533    if ( !$group_id )
     1534        $group_id = $group_obj->id;
     1535       
    15331536    if ( !$groups_template )
    15341537        $groups_template->group = new BP_Groups_Group( $group_id );
    1535    
     1538       
    15361539    $members_template = new BP_Groups_Group_Members_Template( $groups_template->group->id, $num_per_page, $exclude_admins_mods, $exclude_banned );
    15371540
Note: See TracChangeset for help on using the changeset viewer.