Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2008 04:37:49 AM (17 years ago)
Author:
apeatling
Message:
  • Moved all group pages to the root, rather than using a member URL
  • Introduced groupmeta support - groups_update_groupmeta / groups_delete_groupmeta / groups_get_groupmeta
  • Added widgets for site wide activity and who's online
  • Updated home theme to support display of new BuddyPress widgets
  • Added site wide activity feed support
  • Fixed bug where ajax functions would only work when logged in
  • Various other bug fixes
File:
1 edited

Legend:

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

    r373 r375  
    147147    global $groups_template;
    148148   
    149     ?><img src="<?php echo $groups_template->group->avatar_full ?>" class="avatar" alt="Group Avatar" /><?php
     149    ?><img src="<?php echo $groups_template->group->avatar_full ?>" class="avatar" alt="<?php echo $groups_template->group->name ?> Avatar" /><?php
    150150}
    151151
     
    153153    global $groups_template;
    154154   
    155     ?><img src="<?php echo $groups_template->group->avatar_thumb ?>" class="avatar" alt="Group Avatar" /><?php
    156 }
    157 
    158 
    159 function bp_group_permalink() {
    160     global $groups_template, $bp;
    161     echo $bp['current_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug;
     155    ?><img src="<?php echo $groups_template->group->avatar_thumb ?>" class="avatar" alt="<?php echo $groups_template->group->name ?> Avatar" /><?php
     156}
     157
     158
     159function bp_group_permalink( $group_obj = false, $echo = true ) {
     160    global $groups_template, $bp, $current_blog;
     161
     162    if ( !$group_obj )
     163        $group_obj = $groups_template->group;
     164   
     165    switch_to_blog(1);
     166   
     167    if ( $echo )
     168        echo site_url() . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug;
     169    else
     170        return site_url() . '/' . $bp['groups']['slug'] . '/' . $group_obj->slug;
     171       
     172    switch_to_blog($current_blog->blog_id);
    162173}
    163174
     
    244255function bp_group_all_members_permalink() {
    245256    global $groups_template, $bp;
    246     echo $bp['current_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug . '/members';
     257    echo bp_group_permalink( false, true ) . '/members';
    247258}
    248259
     
    268279
    269280    if ( $bp['current_action'] == 'my-groups' || !$bp['current_action'] ) {
    270         $action = $bp['current_domain'] . $bp['groups']['slug'] . '/my-groups/search/';
     281        $action = $bp['loggedin_domain'] . $bp['groups']['slug'] . '/my-groups/search/';
    271282        $label = __('Filter Groups');
    272283        $type = 'group';
    273284    } else {
    274         $action = $bp['current_domain'] . $bp['groups']['slug'] . '/group-finder/search/';
     285        $action = $bp['loggedin_domain'] . $bp['groups']['slug'] . '/group-finder/search/';
    275286        $label = __('Find a Group');
    276287        $type = 'groupfinder';
     
    505516    global $groups_template, $bp;
    506517   
    507     echo $bp['loggedin_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug . '/leave-group/yes';
     518    echo bp_group_permalink( false, true ) . '/leave-group/yes';   
    508519}
    509520
     
    511522    global $groups_template, $bp;
    512523   
    513     echo $bp['loggedin_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug . '/leave-group/no';
     524    echo bp_group_permalink( false, true );
    514525}
    515526
     
    559570    global $groups_template, $bp;
    560571   
    561     echo $bp['loggedin_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug . '/send-invites/send';
     572    echo bp_group_permalink( false, true ) . '/send-invites/send';
    562573}
    563574
     
    566577   
    567578    if ( is_user_logged_in() && !BP_Groups_Member::check_is_member( $bp['loggedin_userid'], $groups_template->group->id ) ) {
    568         echo '<a class="join-group" href="' . $bp['loggedin_domain'] . $bp['groups']['slug'] . '/' . $groups_template->group->slug . '/join">' . __('Join Group') . '</a>';
     579        echo '<a class="join-group" href="' . bp_group_permalink( false, false ) . '/join">' . __('Join Group') . '</a>';
    569580    }
    570581}
     
    582593                <?php $group = new BP_Groups_Group( $group_ids[$i], false, false ); ?>
    583594                <li>
    584                     <a href="<?php echo $bp['current_domain'] . $bp['groups']['slug'] . '/' . $group->slug ?>"><img src="<?php echo $group->avatar_thumb; ?>" class="avatar" alt="Group Avatar" /></a>
    585                     <h5><a href="<?php echo $bp['current_domain'] . $bp['groups']['slug'] . '/' . $group->slug ?>"><?php echo $group->name ?></a></h5>
     595                    <a href="<?php echo bp_group_permalink( $group, false ) ?>"><img src="<?php echo $group->avatar_thumb; ?>" class="avatar" alt="Group Avatar" /></a>
     596                    <h5><a href="<?php echo bp_group_permalink( $group, false ) ?>"><?php echo $group->name ?></a></h5>
    586597                </li>
    587598            <?php } ?>
Note: See TracChangeset for help on using the changeset viewer.