groups->image_base = BP_PLUGIN_URL . '/bp-groups/deprecated/images'; } add_action( 'plugins_loaded', 'groups_deprecated_globals', 5 ); add_action( 'admin_menu', 'groups_deprecated_globals', 2 ); function groups_avatar_upload( $deprecated = true ) { ?>

<?php _e( 'Avatar to crop', 'buddypress' ) ?> root_domain . '/'; $thumb_href = str_replace( ABSPATH, $src, stripslashes( $avatars['v1_out'] ) ); $full_href = str_replace( ABSPATH, $src, stripslashes ( $avatars['v2_out'] ) ); return array( 'thumb_href' => $thumb_href, 'full_href' => $full_href ); } function groups_get_avatar_path( $avatar ) { global $bp; $src = $bp->root_domain . '/'; $path = str_replace( $src, ABSPATH, stripslashes( $avatar ) ); return $path; } function bp_new_group_avatar_upload_form() { groups_avatar_upload(); } /* DEPRECATED - BuddyPress templates are now merged with WordPress themes */ function groups_force_buddypress_theme( $template ) { global $bp; /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return $template; if ( $bp->current_component != $bp->groups->slug ) return $template; $member_theme = get_site_option('active-member-theme'); if ( empty($member_theme) ) $member_theme = 'bpmember'; add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); return $member_theme; } add_filter( 'template', 'groups_force_buddypress_theme' ); /* DEPRECATED - BuddyPress templates are now merged with WordPress themes */ function groups_force_buddypress_stylesheet( $stylesheet ) { global $bp; /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return $stylesheet; if ( $bp->current_component != $bp->groups->slug ) return $stylesheet; $member_theme = get_site_option('active-member-theme'); if ( empty( $member_theme ) ) $member_theme = 'bpmember'; add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' ); add_filter( 'theme_root_uri', 'bp_core_filter_buddypress_theme_root_uri' ); return $member_theme; } add_filter( 'stylesheet', 'groups_force_buddypress_stylesheet' ); function groups_add_js() { global $bp; /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return false; if ( $bp->current_component == $bp->groups->slug ) wp_enqueue_script( 'bp-groups-js', BP_PLUGIN_URL . '/bp-groups/deprecated/js/general.js' ); } add_action( 'template_redirect', 'groups_add_js', 1 ); function groups_add_structure_css() { /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return false; /* Enqueue the structure CSS file to give basic positional formatting for components */ wp_enqueue_style( 'bp-groups-structure', BP_PLUGIN_URL . '/bp-groups/deprecated/css/structure.css' ); } add_action( 'bp_styles', 'groups_add_structure_css' ); function groups_add_directory_js() { /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return false; wp_enqueue_script( 'bp-groups-directory-groups', BP_PLUGIN_URL . '/bp-groups/deprecated/js/directory-groups.js', array( 'jquery', 'jquery-livequery-pack' ) ); } add_action( 'groups_directory_groups_setup', 'groups_add_directory_js' ); /* DEPRECATED - use bp_has_groups( 'type=random' ) template loop */ function bp_groups_random_selection( $total_groups = 5 ) { global $bp; if ( !$group_ids = wp_cache_get( 'groups_random_groups', 'bp' ) ) { $group_ids = BP_Groups_Group::get_random( $total_groups, 1 ); wp_cache_set( 'groups_random_groups', $group_ids, 'bp' ); } ?>

displayed_user->id . '_' . $total_groups, 'bp' ) ) { $group_ids = groups_get_random_groups_for_user( $bp->displayed_user->id, $total_groups, 1 ); wp_cache_set( 'groups_random_user_groups_' . $bp->displayed_user->id . '_' . $total_groups, $group_ids, 'bp' ); } ?>

() »

group; $forum_id = groups_get_groupmeta( $group->id, 'forum_id' ); if ( $forum_id && $forum_id != '' ) { if ( function_exists( 'bp_forums_setup' ) ) { $latest_topics = bp_forums_get_forum_topics( array( 'forum_id' => $forum_id ) ); if ( $latest_topics ) { ?>

group; ?>

loggedin_user->id, $group->id ) ?>
loggedin_user->id, $bp->groups->current_group->id ); if ( $friends ) { $invites = groups_get_invites_for_group( $bp->loggedin_user->id, $bp->groups->current_group->id ); ?>
group; $members = &$group->random_members; ?>
member->user_id; echo bp_get_group_member_promote_link( $user_id ); } function bp_get_group_member_promote_link( $user_id = false, $group = false ) { global $members_template, $groups_template, $bp; if ( !$user_id ) $user_id = $members_template->member->user_id; if ( !$group ) $group =& $groups_template->group; return apply_filters( 'bp_get_group_member_promote_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) ); } /* DEPRECATED - see latest default BuddyPress theme /groups/create.php for replacement template tags */ function bp_group_create_form() { global $bp, $invites; ?>
groups->current_create_step ) { case 'group-details': ?>
groups->current_group->enable_photos ) { ?> style="display: none;">

groups->new_group ); if ( function_exists('friends_install') ) { if ( friends_get_friend_count_for_user( $bp->loggedin_user->id ) ) { bp_group_send_invite_form( $bp->groups->new_group ); } else { ?>

 
loggedin_user->id, $_POST['group_id'] ) ) return false; if ( !friends_check_friendship( $bp->loggedin_user->id, $_POST['friend_id'] ) ) return false; if ( 'invite' == $_POST['friend_action'] ) { if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) ) return false; $user = new BP_Core_User( $_POST['friend_id'] ); echo '
  • '; echo $user->avatar_thumb; echo '

    ' . $user->user_link . '

    '; echo '' . attribute_escape( $user->last_active ) . ''; echo '
    ' . __( 'Remove Invite', 'buddypress' ) . '
    '; echo '
  • '; } else if ( 'uninvite' == $_POST['friend_action'] ) { if ( !groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) ) return false; return true; } else { return false; } } add_action( 'wp_ajax_groups_invite_user', 'groups_ajax_invite_user' ); function groups_ajax_group_filter() { global $bp; /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return false; check_ajax_referer( 'group-filter-box' ); locate_template( array( 'groups/group-loop.php' ), true ); } add_action( 'wp_ajax_group_filter', 'groups_ajax_group_filter' ); function groups_ajax_member_list() { global $bp; /* If we are using a BuddyPress 1.1+ theme ignore this. */ if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) return false; ?>

    loggedin_user->id, $_POST['gid'] ) ) return false; if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) ) return false; if ( 'hidden' == $group->status ) return false; if ( !groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) { if ( 'public' == $group->status ) { check_ajax_referer( 'groups_join_group' ); if ( !groups_join_group( $group->id ) ) { _e( 'Error joining group', 'buddypress' ); } else { echo '' . __( 'Leave Group', 'buddypress' ) . ''; } } else if ( 'private' == $group->status ) { check_ajax_referer( 'groups_request_membership' ); if ( !groups_send_membership_request( $bp->loggedin_user->id, $group->id ) ) { _e( 'Error requesting membership', 'buddypress' ); } else { echo '' . __( 'Membership Requested', 'buddypress' ) . ''; } } } else { check_ajax_referer( 'groups_leave_group' ); if ( !groups_leave_group( $group->id ) ) { _e( 'Error leaving group', 'buddypress' ); } else { if ( 'public' == $group->status ) { echo '' . __( 'Join Group', 'buddypress' ) . ''; } else if ( 'private' == $group->status ) { echo '' . __( 'Request Membership', 'buddypress' ) . ''; } } } } add_action( 'wp_ajax_joinleave_group', 'groups_ajax_joinleave_group' ); ?>