Plugin Directory

Changeset 997706


Ignore:
Timestamp:
09/27/2014 05:17:07 PM (12 years ago)
Author:
bphelp
Message:

Discontinued

Location:
private-bp-pages
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • private-bp-pages/tags/1.0/loader.php

    r771810 r997706  
    1414*/
    1515
    16 /*** Make sure BuddyPress is loaded ********************************/
    17 function bphelp_private_bp_pages_check() {
    18     if ( !class_exists( 'BuddyPress' ) ) {
    19     add_action( 'admin_notices', 'private_bp_pages_install_buddypress_notice' );
    20     }
    21 }
    22 add_action('plugins_loaded', 'bphelp_private_bp_pages_check', 999);
    23 
    24 function private_bp_pages_install_buddypress_notice() {
    25     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    26     _e('<strong>Private BP Pages</strong></a> requires the BuddyPress plugin to work. Please <a href="http://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private BP Pages</a>.');
    27     echo '</p></div>';
    28 }
    29 
    30 function private_bp_pages_init() {
    31     require( dirname( __FILE__ ) . '/private-bp-pages.php' );
    32 }
    33 add_action( 'bp_include', 'private_bp_pages_init' );
    3416?>
  • private-bp-pages/tags/1.0/private-bp-pages.php

    r774696 r997706  
    11<?php
    2 /* Prevent logged out users from accessing bp pages */
    3 function nonreg_visitor_redirect() {
    4 global $bp;
    5 //IMPORTANT: Do not alter the following line.
    6 $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    72
    8 if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_profile_component() ) {
    9 
    10     if(!is_user_logged_in()) {
    11         bp_core_redirect( get_option('home') . '/' .  $bphelp_my_redirect_slug );
    12     }
    13 }
    14 }
    15 add_filter('template_redirect','nonreg_visitor_redirect',1);
    16 /* End Prevent logged out users from accessing bp pages */
    17 
    18 /* Prevent RSS Feeds */
    19 function cut_nonreg_visitor_rss_feed() {
    20     if ( !is_user_logged_in() ) {
    21         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    22         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    23         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    24         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    25         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    26         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    27         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    28     }
    29 }
    30 add_action('init', 'cut_nonreg_visitor_rss_feed');
    31 /* End Prevent RSS Feeds */
    32 
    33 /////////////////////////////// Dashboard Settings //////////////////////////////////
    34 
    35 function bphelp_pbp_add_admin_menu() {
    36     global $bp;
    37 
    38     if ( !is_super_admin() )
    39         return false;
    40 
    41     add_options_page( __( 'Private BP Pages', 'bphelp_pbp' ), __( 'Private BP Pages', 'bphelp_pbp' ), 'manage_options', 'bphelp-pbp-settings', 'bphelp_pbp_admin' );
    42 }
    43 
    44 add_action( 'admin_menu', 'bphelp_pbp_add_admin_menu' );
    45 
    46 function bphelp_pbp_admin() {
    47     global $bp;
    48 
    49     if ( isset( $_POST['submit'] ) && check_admin_referer('pbp-bphelp-settings') ) {
    50         update_option( 'bphelp-my-redirect-slug', $_POST['bphelp-my-redirect-slug'] );
    51 
    52         $updated = true;
    53     }
    54    
    55     $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    563?>
    57     <div class="wrap">
    58         <?php screen_icon(); ?>
    59         <h2><?php _e( 'Private BP Pages Settings', 'bphelp_pbp' ) ?></h2>
    60         <br />
    61         <p>
    62         <?php _e( 'Enter the slug of the page you would like logged out visitors to be redirected to in the below option.', 'bphelp_pbp' ) ?>
    63         </p>
    64         <br />
    65        
    66         <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bphelp_pbp' ) . "</p></div>" ?><?php endif; ?>
    67 
    68         <form action="<?php echo site_url() . '/wp-admin/admin.php?page=bphelp-pbp-settings' ?>" name="pbp-bphelp-settings-form" id="pbp-bphelp-settings-form" method="post">
    69 
    70             <table class="form-table">
    71                 <tr valign="top">
    72                     <th scope="row"><label for="target_uri"><?php _e( '<b>Define Your Redirect Slug<br /> Choices are:<br />register, sign-up, or wp-login.php.</b>', 'bphelp_pbp' ) ?></label></th>
    73                     <td>
    74                         <input name="bphelp-my-redirect-slug" type="text" id="bphelp-my-redirect-slug"          value="<?php echo esc_attr( $bphelp_my_redirect_slug ); ?>" size="60" />
    75                     </td>
    76                 </tr>
    77             </table>
    78            
    79             <p class="submit">
    80                 &nbsp;&nbsp;&nbsp;<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'bphelp_pbp' ) ?>"/>
    81             </p>
    82 
    83             <?php
    84             wp_nonce_field( 'pbp-bphelp-settings' );
    85             ?>
    86         </form>
    87     </div>
    88 <?php
    89 }
    90 ///Love, Peace, and Geese!
    91 ?>
  • private-bp-pages/tags/1.2.5/loader.php

    r775346 r997706  
    1414*/
    1515
    16 /*** Make sure BuddyPress is loaded ********************************/
    17 function bphelp_private_bp_pages_check() {
    18     if ( !class_exists( 'BuddyPress' ) ) {
    19     add_action( 'admin_notices', 'private_bp_pages_install_buddypress_notice' );
    20     }
    21 }
    22 add_action('plugins_loaded', 'bphelp_private_bp_pages_check', 999);
    23 
    24 function private_bp_pages_install_buddypress_notice() {
    25     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    26     _e('<strong>Private BP Pages</strong></a> requires the BuddyPress plugin to work. Please <a href="http://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private BP Pages</a>.');
    27     echo '</p></div>';
    28 }
    29 
    30 function private_bp_pages_init() {
    31     require( dirname( __FILE__ ) . '/private-bp-pages.php' );
    32 }
    33 add_action( 'bp_include', 'private_bp_pages_init' );
    3416?>
  • private-bp-pages/tags/1.2.5/private-bp-pages.php

    r775346 r997706  
    11<?php
    2 /* Prevent logged out users from accessing bp pages */
    3 function nonreg_visitor_redirect() {
    4 global $bp;
    5 //IMPORTANT: Do not alter the following line.
    6 $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    72
    8 if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component() ) {
    9 
    10     if(!is_user_logged_in()) {
    11         bp_core_redirect( get_option('home') . '/' .  $bphelp_my_redirect_slug );
    12     }
    13 }
    14 }
    15 add_filter('template_redirect','nonreg_visitor_redirect',1);
    16 /* End Prevent logged out users from accessing bp pages */
    17 
    18 /* Prevent RSS Feeds */
    19 function pbpp_cut_nonreg_visitor_rss_feed() {
    20     if ( !is_user_logged_in() ) {
    21         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    22         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    23         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    24         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    25         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    26         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    27         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    28     }
    29 }
    30 add_action('init', 'pbpp_cut_nonreg_visitor_rss_feed');
    31 /* End Prevent RSS Feeds */
    32 
    33 /////////////////////////////// Dashboard Settings //////////////////////////////////
    34 
    35 function bphelp_pbp_add_admin_menu() {
    36     global $bp;
    37 
    38     if ( !is_super_admin() )
    39         return false;
    40 
    41     add_options_page( __( 'Private BP Pages', 'bphelp_pbp' ), __( 'Private BP Pages', 'bphelp_pbp' ), 'manage_options', 'bphelp-pbp-settings', 'bphelp_pbp_admin' );
    42 }
    43 
    44 add_action( 'admin_menu', 'bphelp_pbp_add_admin_menu' );
    45 
    46 function bphelp_pbp_admin() {
    47     global $bp;
    48 
    49     if ( isset( $_POST['submit'] ) && check_admin_referer('pbp-bphelp-settings') ) {
    50         update_option( 'bphelp-my-redirect-slug', $_POST['bphelp-my-redirect-slug'] );
    51 
    52         $updated = true;
    53     }
    54    
    55     $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    563?>
    57     <div class="wrap">
    58         <?php screen_icon(); ?>
    59         <h2><?php _e( 'Private BP Pages Settings', 'bphelp_pbp' ) ?></h2>
    60         <br />
    61         <p>
    62         <?php _e( 'Enter the slug of the page you would like logged out visitors to be redirected to in the below option.', 'bphelp_pbp' ) ?>
    63         </p>
    64         <br />
    65        
    66         <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bphelp_pbp' ) . "</p></div>" ?><?php endif; ?>
    67 
    68         <form action="<?php echo site_url() . '/wp-admin/admin.php?page=bphelp-pbp-settings' ?>" name="pbp-bphelp-settings-form" id="pbp-bphelp-settings-form" method="post">
    69 
    70             <table class="form-table">
    71                 <tr valign="top">
    72                     <th scope="row"><label for="target_uri"><?php _e( '<b>Define Your Redirect Slug<br /> Choices are:<br />register, sign-up, or wp-login.php.</b>', 'bphelp_pbp' ) ?></label></th>
    73                     <td>
    74                         <input name="bphelp-my-redirect-slug" type="text" id="bphelp-my-redirect-slug"          value="<?php echo esc_attr( $bphelp_my_redirect_slug ); ?>" size="60" />
    75                     </td>
    76                 </tr>
    77             </table>
    78            
    79             <p class="submit">
    80                 &nbsp;&nbsp;&nbsp;<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'bphelp_pbp' ) ?>"/>
    81             </p>
    82 
    83             <?php
    84             wp_nonce_field( 'pbp-bphelp-settings' );
    85             ?>
    86         </form>
    87     </div>
    88 <?php
    89 }
    90 ///Love, Peace, and Geese!
    91 ?>
  • private-bp-pages/tags/1.2/loader.php

    r774696 r997706  
    1414*/
    1515
    16 /*** Make sure BuddyPress is loaded ********************************/
    17 function bphelp_private_bp_pages_check() {
    18     if ( !class_exists( 'BuddyPress' ) ) {
    19     add_action( 'admin_notices', 'private_bp_pages_install_buddypress_notice' );
    20     }
    21 }
    22 add_action('plugins_loaded', 'bphelp_private_bp_pages_check', 999);
    23 
    24 function private_bp_pages_install_buddypress_notice() {
    25     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    26     _e('<strong>Private BP Pages</strong></a> requires the BuddyPress plugin to work. Please <a href="http://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private BP Pages</a>.');
    27     echo '</p></div>';
    28 }
    29 
    30 function private_bp_pages_init() {
    31     require( dirname( __FILE__ ) . '/private-bp-pages.php' );
    32 }
    33 add_action( 'bp_include', 'private_bp_pages_init' );
    3416?>
  • private-bp-pages/tags/1.2/private-bp-pages.php

    r774696 r997706  
    11<?php
    2 /* Prevent logged out users from accessing bp pages */
    3 function nonreg_visitor_redirect() {
    4 global $bp;
    5 //IMPORTANT: Do not alter the following line.
    6 $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    72
    8 if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component() ) {
    9 
    10     if(!is_user_logged_in()) {
    11         bp_core_redirect( get_option('home') . '/' .  $bphelp_my_redirect_slug );
    12     }
    13 }
    14 }
    15 add_filter('template_redirect','nonreg_visitor_redirect',1);
    16 /* End Prevent logged out users from accessing bp pages */
    17 
    18 /* Prevent RSS Feeds */
    19 function cut_nonreg_visitor_rss_feed() {
    20     if ( !is_user_logged_in() ) {
    21         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    22         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    23         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    24         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    25         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    26         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    27         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    28     }
    29 }
    30 add_action('init', 'cut_nonreg_visitor_rss_feed');
    31 /* End Prevent RSS Feeds */
    32 
    33 /////////////////////////////// Dashboard Settings //////////////////////////////////
    34 
    35 function bphelp_pbp_add_admin_menu() {
    36     global $bp;
    37 
    38     if ( !is_super_admin() )
    39         return false;
    40 
    41     add_options_page( __( 'Private BP Pages', 'bphelp_pbp' ), __( 'Private BP Pages', 'bphelp_pbp' ), 'manage_options', 'bphelp-pbp-settings', 'bphelp_pbp_admin' );
    42 }
    43 
    44 add_action( 'admin_menu', 'bphelp_pbp_add_admin_menu' );
    45 
    46 function bphelp_pbp_admin() {
    47     global $bp;
    48 
    49     if ( isset( $_POST['submit'] ) && check_admin_referer('pbp-bphelp-settings') ) {
    50         update_option( 'bphelp-my-redirect-slug', $_POST['bphelp-my-redirect-slug'] );
    51 
    52         $updated = true;
    53     }
    54    
    55     $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    563?>
    57     <div class="wrap">
    58         <?php screen_icon(); ?>
    59         <h2><?php _e( 'Private BP Pages Settings', 'bphelp_pbp' ) ?></h2>
    60         <br />
    61         <p>
    62         <?php _e( 'Enter the slug of the page you would like logged out visitors to be redirected to in the below option.', 'bphelp_pbp' ) ?>
    63         </p>
    64         <br />
    65        
    66         <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bphelp_pbp' ) . "</p></div>" ?><?php endif; ?>
    67 
    68         <form action="<?php echo site_url() . '/wp-admin/admin.php?page=bphelp-pbp-settings' ?>" name="pbp-bphelp-settings-form" id="pbp-bphelp-settings-form" method="post">
    69 
    70             <table class="form-table">
    71                 <tr valign="top">
    72                     <th scope="row"><label for="target_uri"><?php _e( '<b>Define Your Redirect Slug<br /> Choices are:<br />register, sign-up, or wp-login.php.</b>', 'bphelp_pbp' ) ?></label></th>
    73                     <td>
    74                         <input name="bphelp-my-redirect-slug" type="text" id="bphelp-my-redirect-slug"          value="<?php echo esc_attr( $bphelp_my_redirect_slug ); ?>" size="60" />
    75                     </td>
    76                 </tr>
    77             </table>
    78            
    79             <p class="submit">
    80                 &nbsp;&nbsp;&nbsp;<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'bphelp_pbp' ) ?>"/>
    81             </p>
    82 
    83             <?php
    84             wp_nonce_field( 'pbp-bphelp-settings' );
    85             ?>
    86         </form>
    87     </div>
    88 <?php
    89 }
    90 ///Love, Peace, and Geese!
    91 ?>
  • private-bp-pages/tags/1.3/loader.php

    r980164 r997706  
    1414*/
    1515
    16 /*** Make sure BuddyPress is loaded ********************************/
    17 function bphelp_private_bp_pages_check() {
    18     if ( !class_exists( 'BuddyPress' ) ) {
    19     add_action( 'admin_notices', 'private_bp_pages_install_buddypress_notice' );
    20     }
    21 }
    22 add_action('plugins_loaded', 'bphelp_private_bp_pages_check', 999);
    23 
    24 function private_bp_pages_install_buddypress_notice() {
    25     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    26     _e('<strong>Private BP Pages</strong></a> requires the BuddyPress plugin to work. Please <a href="http://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private BP Pages</a>.');
    27     echo '</p></div>';
    28 }
    29 
    30 function private_bp_pages_init() {
    31     require( dirname( __FILE__ ) . '/private-bp-pages.php' );
    32 }
    33 add_action( 'bp_include', 'private_bp_pages_init' );
    3416?>
  • private-bp-pages/tags/1.3/private-bp-pages.php

    r779070 r997706  
    11<?php
    2 /* Prevent logged out users from accessing bp pages */
    3 function bphelp_pbpp_redirect() {
    4 global $bp;
    5 //IMPORTANT: Do not alter the following line.
    6 $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    72
    8 if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component() ) {
    9 
    10     if(!is_user_logged_in()) {
    11         bp_core_redirect( get_option('home') . '/' .  $bphelp_my_redirect_slug );
    12     }
    13 }
    14 }
    15 add_filter('template_redirect','bphelp_pbpp_redirect',1);
    16 /* End Prevent logged out users from accessing bp pages */
    17 
    18 /* Prevent RSS Feeds */
    19 function pbpp_remove_visitor_rss_feed() {
    20     if ( !is_user_logged_in() ) {
    21         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    22         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    23         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    24         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    25         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    26         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    27         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    28     }
    29 }
    30 add_action('init', 'pbpp_remove_visitor_rss_feed');
    31 /* End Prevent RSS Feeds */
    32 
    33 /////////////////////////////// Dashboard Settings //////////////////////////////////
    34 
    35 function bphelp_pbp_add_admin_menu() {
    36     global $bp;
    37 
    38     if ( !is_super_admin() )
    39         return false;
    40        
    41     // Add translation
    42     load_plugin_textdomain( 'bphelp_pbp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    43 
    44     add_options_page( __( 'Private BP Pages', 'bphelp_pbp' ), __( 'Private BP Pages', 'bphelp_pbp' ), 'manage_options', 'bphelp-pbp-settings', 'bphelp_pbp_admin' );
    45 }
    46 
    47 add_action( 'admin_menu', 'bphelp_pbp_add_admin_menu' );
    48 
    49 function bphelp_pbp_admin() {
    50     global $bp;
    51 
    52     if ( isset( $_POST['submit'] ) && check_admin_referer('pbp-bphelp-settings') ) {
    53         update_option( 'bphelp-my-redirect-slug', $_POST['bphelp-my-redirect-slug'] );
    54 
    55         $updated = true;
    56     }
    57    
    58     $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    593?>
    60     <div class="wrap">
    61         <?php screen_icon(); ?>
    62         <h2><?php _e( 'Private BP Pages Settings', 'bphelp_pbp' ) ?></h2>
    63         <br />
    64         <p>
    65         <?php _e( 'Enter the slug of the page you would like logged out visitors to be redirected to in the below option.', 'bphelp_pbp' ) ?>
    66         </p>
    67         <br />
    68        
    69         <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bphelp_pbp' ) . "</p></div>" ?><?php endif; ?>
    70 
    71         <form action="<?php echo site_url() . '/wp-admin/admin.php?page=bphelp-pbp-settings' ?>" name="pbp-bphelp-settings-form" id="pbp-bphelp-settings-form" method="post">
    72 
    73             <table class="form-table">
    74                 <tr valign="top">
    75                     <th scope="row"><label for="target_uri"><?php _e( '<b>Define Your Redirect Slug<br /> Choices are:<br />register, sign-up, or wp-login.php.</b>', 'bphelp_pbp' ) ?></label></th>
    76                     <td>
    77                         <input name="bphelp-my-redirect-slug" type="text" id="bphelp-my-redirect-slug"          value="<?php echo esc_attr( $bphelp_my_redirect_slug ); ?>" size="60" />
    78                     </td>
    79                 </tr>
    80             </table>
    81            
    82             <p class="submit">
    83                 &nbsp;&nbsp;&nbsp;<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'bphelp_pbp' ) ?>"/>
    84             </p>
    85 
    86             <?php
    87             wp_nonce_field( 'pbp-bphelp-settings' );
    88             ?>
    89         </form>
    90     </div>
    91 <?php
    92 }
    93 ///Love, Peace, and Geese!
    94 ?>
  • private-bp-pages/tags/1.3/readme.txt

    r980164 r997706  
    1212
    1313== Description ==
     14Notice: No Longer Available As A Free Download.
    1415
    1516This plugin will make all BuddyPress/bbPress pages private while
  • private-bp-pages/trunk/loader.php

    r980164 r997706  
    1414*/
    1515
    16 /*** Make sure BuddyPress is loaded ********************************/
    17 function bphelp_private_bp_pages_check() {
    18     if ( !class_exists( 'BuddyPress' ) ) {
    19     add_action( 'admin_notices', 'private_bp_pages_install_buddypress_notice' );
    20     }
    21 }
    22 add_action('plugins_loaded', 'bphelp_private_bp_pages_check', 999);
    23 
    24 function private_bp_pages_install_buddypress_notice() {
    25     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    26     _e('<strong>Private BP Pages</strong></a> requires the BuddyPress plugin to work. Please <a href="http://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private BP Pages</a>.');
    27     echo '</p></div>';
    28 }
    29 
    30 function private_bp_pages_init() {
    31     require( dirname( __FILE__ ) . '/private-bp-pages.php' );
    32 }
    33 add_action( 'bp_include', 'private_bp_pages_init' );
    3416?>
  • private-bp-pages/trunk/private-bp-pages.php

    r779070 r997706  
    11<?php
    2 /* Prevent logged out users from accessing bp pages */
    3 function bphelp_pbpp_redirect() {
    4 global $bp;
    5 //IMPORTANT: Do not alter the following line.
    6 $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    72
    8 if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component() ) {
    9 
    10     if(!is_user_logged_in()) {
    11         bp_core_redirect( get_option('home') . '/' .  $bphelp_my_redirect_slug );
    12     }
    13 }
    14 }
    15 add_filter('template_redirect','bphelp_pbpp_redirect',1);
    16 /* End Prevent logged out users from accessing bp pages */
    17 
    18 /* Prevent RSS Feeds */
    19 function pbpp_remove_visitor_rss_feed() {
    20     if ( !is_user_logged_in() ) {
    21         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    22         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    23         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    24         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    25         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    26         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    27         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    28     }
    29 }
    30 add_action('init', 'pbpp_remove_visitor_rss_feed');
    31 /* End Prevent RSS Feeds */
    32 
    33 /////////////////////////////// Dashboard Settings //////////////////////////////////
    34 
    35 function bphelp_pbp_add_admin_menu() {
    36     global $bp;
    37 
    38     if ( !is_super_admin() )
    39         return false;
    40        
    41     // Add translation
    42     load_plugin_textdomain( 'bphelp_pbp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    43 
    44     add_options_page( __( 'Private BP Pages', 'bphelp_pbp' ), __( 'Private BP Pages', 'bphelp_pbp' ), 'manage_options', 'bphelp-pbp-settings', 'bphelp_pbp_admin' );
    45 }
    46 
    47 add_action( 'admin_menu', 'bphelp_pbp_add_admin_menu' );
    48 
    49 function bphelp_pbp_admin() {
    50     global $bp;
    51 
    52     if ( isset( $_POST['submit'] ) && check_admin_referer('pbp-bphelp-settings') ) {
    53         update_option( 'bphelp-my-redirect-slug', $_POST['bphelp-my-redirect-slug'] );
    54 
    55         $updated = true;
    56     }
    57    
    58     $bphelp_my_redirect_slug = get_option( 'bphelp-my-redirect-slug', 'register' );
    593?>
    60     <div class="wrap">
    61         <?php screen_icon(); ?>
    62         <h2><?php _e( 'Private BP Pages Settings', 'bphelp_pbp' ) ?></h2>
    63         <br />
    64         <p>
    65         <?php _e( 'Enter the slug of the page you would like logged out visitors to be redirected to in the below option.', 'bphelp_pbp' ) ?>
    66         </p>
    67         <br />
    68        
    69         <?php if ( isset($updated) ) : ?><?php echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bphelp_pbp' ) . "</p></div>" ?><?php endif; ?>
    70 
    71         <form action="<?php echo site_url() . '/wp-admin/admin.php?page=bphelp-pbp-settings' ?>" name="pbp-bphelp-settings-form" id="pbp-bphelp-settings-form" method="post">
    72 
    73             <table class="form-table">
    74                 <tr valign="top">
    75                     <th scope="row"><label for="target_uri"><?php _e( '<b>Define Your Redirect Slug<br /> Choices are:<br />register, sign-up, or wp-login.php.</b>', 'bphelp_pbp' ) ?></label></th>
    76                     <td>
    77                         <input name="bphelp-my-redirect-slug" type="text" id="bphelp-my-redirect-slug"          value="<?php echo esc_attr( $bphelp_my_redirect_slug ); ?>" size="60" />
    78                     </td>
    79                 </tr>
    80             </table>
    81            
    82             <p class="submit">
    83                 &nbsp;&nbsp;&nbsp;<input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'bphelp_pbp' ) ?>"/>
    84             </p>
    85 
    86             <?php
    87             wp_nonce_field( 'pbp-bphelp-settings' );
    88             ?>
    89         </form>
    90     </div>
    91 <?php
    92 }
    93 ///Love, Peace, and Geese!
    94 ?>
  • private-bp-pages/trunk/readme.txt

    r980164 r997706  
    1212
    1313== Description ==
     14Notice: No Longer Available As A Free Download.
    1415
    1516This plugin will make all BuddyPress/bbPress pages private while
Note: See TracChangeset for help on using the changeset viewer.