Guest User

cd-avatar-bubble.php + groups functions

a guest
Dec 23rd, 2010
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('wp_ajax_the_groupinfo', 'the_groupinfo');
  2. add_action('wp_ajax_nopriv_the_groupinfo', 'the_groupinfo');
  3. function the_groupinfo(){
  4. $cd_ab = get_option( 'cd_ab' );
  5.     $ID = $_GET['ID'];
  6.     if ( $cd_ab[ 'access' ] == 'admin' && is_site_admin() ) {
  7.         get_the_groupinfo( $ID );
  8.     }elseif ( $cd_ab[ 'access' ] == 'logged_in' && is_user_logged_in() ) {
  9.         get_the_groupinfo( $ID );
  10.     }elseif ( $cd_ab[ 'access' ] == 'all' ) {
  11.         get_the_groupinfo( $ID );
  12.     }else{
  13.         echo $cd_ab['delay'].'|~|<div id="group_'.$ID.'">'.__('You don\'t have enough rights to view group data','cd_ab').'</div>';
  14.     }
  15.     die(); 
  16. }
  17.  
  18. function get_the_groupinfo($ID) {
  19.     global $bp;
  20.     $cd_ab = get_option( 'cd_ab' );
  21.     if ( !$cd_ab['delay'] ) {
  22.         echo '0|~|';
  23.     }else{
  24.         echo $cd_ab[ 'delay' ] . '|~|';
  25.     }
  26.     $i = 1;
  27.     $action = 'false';
  28.     do_action( 'cd_ab_before_default' );
  29.    
  30.     $group = new BP_Groups_Group( $ID );   
  31.     echo "<div group_id='.$ID.'>";
  32.     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>";
  33.     echo "<p class='popupLine' style='padding-top:6px;'><strong>Description:</strong> ".$group->description."</p>";
  34.     echo "<p class='popupLine' style='padding-top:6px;'><strong>Type:</strong> ".$group->status."</p>";
  35.     echo "<p class='popupLine' style='padding-top:6px;'><strong>Members:</strong> ".$group->total_member_count." members</p>";
  36.     echo "</div>";
  37.  
  38. }
RAW Paste Data