SHARE
TWEET

Untitled

a guest Jun 19th, 2013 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function redirect_group_home() {
  3.   global $bp;
  4.   $path = clean_url( $_SERVER['REQUEST_URI'] );
  5.   $path = apply_filters( 'bp_uri', $path );
  6.   if (bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false ) {
  7.    
  8.     echo "HERE WE GO...";
  9.     echo "<PRE>"; print_r($bp->groups->current_group); echo "</PRE>";
  10.     echo $bp->groups->current_group->status;
  11.     echo $bp->groups->current_group->is_user_member;
  12.    
  13.     if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
  14.       echo "<PRE>"; print_r($bp->bp_options_nav); echo "</pre>";
  15.       exit();
  16.       if ($bp->bp_options_nav['groups']['announcements']['slug']) {
  17.         bp_core_redirect( $path . $bp->bp_options_nav['groups']['announcements']['slug'] . '/' );
  18.       } else {
  19.         bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
  20.       }
  21.       bp_core_redirect( $path . 'welcome/' ); //quick hack for some other tab
  22.     }
  23.   }
  24. }
  25.  
  26.  
  27. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top