Posted By

labsecrets on 05/12/10


Tagged


Versions (?)

Private Social Network Site Code


 / Published in: PHP
 

  1. 1) Add this to the top of header.php
  2.  
  3. <?php do_action( 'walled_garden' ) ?>
  4.  
  5.  
  6. 2) Add this to the functions.php page (omit <?php and ?> tags if they already exist)
  7.  
  8. <?php
  9. function sh_walled_garden()
  10. {
  11. global $bp;
  12.  
  13. if (bp_is_register_page() || bp_is_activation_page())
  14. return;
  15.  
  16. if(!bp_is_blog_page() && !is_user_logged_in()) {
  17. bp_core_redirect( $bp->root_domain .'/'. BP_REGISTER_SLUG );
  18. }
  19. }
  20.  
  21. add_action( 'walled_garden', 'sh_walled_garden' );
  22. ?>

Report this snippet  

You need to login to post a comment.