Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_ajax_the_groupinfo', 'the_groupinfo');
- add_action('wp_ajax_nopriv_the_groupinfo', 'the_groupinfo');
- function the_groupinfo(){
- $cd_ab = get_option( 'cd_ab' );
- $ID = $_GET['ID'];
- if ( $cd_ab[ 'access' ] == 'admin' && is_site_admin() ) {
- get_the_groupinfo( $ID );
- }elseif ( $cd_ab[ 'access' ] == 'logged_in' && is_user_logged_in() ) {
- get_the_groupinfo( $ID );
- }elseif ( $cd_ab[ 'access' ] == 'all' ) {
- get_the_groupinfo( $ID );
- }else{
- echo $cd_ab['delay'].'|~|<div id="group_'.$ID.'">'.__('You don\'t have enough rights to view group data','cd_ab').'</div>';
- }
- die();
- }
- function get_the_groupinfo($ID) {
- global $bp;
- $cd_ab = get_option( 'cd_ab' );
- if ( !$cd_ab['delay'] ) {
- echo '0|~|';
- }else{
- echo $cd_ab[ 'delay' ] . '|~|';
- }
- $i = 1;
- $action = 'false';
- do_action( 'cd_ab_before_default' );
- $group = new BP_Groups_Group( $ID );
- echo "<div group_id='.$ID.'>";
- echo "<p class='popupLine' style='padding-top:6px;'><strong>Team:</strong> <a href='".bp_get_root_domain()."/".BP_GROUPS_SLUG."/".$group->slug."'>".$group->name."</a></p>";
- echo "<p class='popupLine' style='padding-top:6px;'><strong>Description:</strong> ".$group->description."</p>";
- echo "<p class='popupLine' style='padding-top:6px;'><strong>Type:</strong> ".$group->status."</p>";
- echo "<p class='popupLine' style='padding-top:6px;'><strong>Members:</strong> ".$group->total_member_count." members</p>";
- echo "</div>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement