Plugin Directory

Changeset 997702


Ignore:
Timestamp:
09/27/2014 04:58:13 PM (12 years ago)
Author:
bphelp
Message:

Discontinued

Location:
home-page-to-bp-profile-plus-privacy
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • home-page-to-bp-profile-plus-privacy/tags/1.0/home-page-to-bp-profile-plus-privacy.php

    r774246 r997702  
    11<?php
    2 // Dashboard/Reading setting
    3 function bphelp_initialize_hptbpp_plugin_options() {
    4    
    5     add_settings_field(
    6         'bphelp_hptp_profile_redirect',
    7         'Redirect Home Page To Profile On Login?',
    8         'bphelp_hptbpp_field_one',
    9         'reading'
    10     );
    11    
    12     add_settings_field(
    13         'bphelp_hptp_privacy',
    14         'Add Sitewide Privacy?',
    15         'bphelp_hptbpp_field_two',
    16         'reading'
    17     );
    18    
    19     register_setting(
    20     'reading',
    21     'bphelp_hptbpp'
    22     );
    23    
    24     register_setting(
    25     'reading',
    26     'bphelp_hptbpp_privacy'
    27     );
    28 }
    29 add_action( 'admin_init', 'bphelp_initialize_hptbpp_plugin_options' );
    302
    31 function bphelp_hptbpp_field_one() {
    32     $options = (array)get_option( 'bphelp_hptbpp' );
    33     $settings = $options['settings'];
    34    
    35     $html = '<label for="bphelp_hptbpp[settings]">';
    36         $html .= '<input type="checkbox" name="bphelp_hptbpp[settings]" id="[settings]" value="1" ' . checked( 1, $settings, false ) . ' />';
    37         $html .= '&nbsp;';
    38         $html .= 'If checked user will be redirected to profile on login.';
    39     $html .= '</label>';
    40    
    41     echo $html;
    42 }
    43 
    44 function bphelp_hptbpp_field_two() {   
    45     $privacy = (array)get_option( 'bphelp_hptbpp_privacy');
    46     $myprivacy = $privacy['myprivacy'];
    47    
    48     $html = '<label for="bphelp_hptbpp_privacy[myprivacy]">';
    49         $html .= '<input type="checkbox" name="bphelp_hptbpp_privacy[myprivacy]" id="[myprivacy]" value="1" ' . checked( 1, $myprivacy, false ) . ' />';
    50         $html .= '&nbsp;';
    51         $html .= 'If checked site-wide privacy will be enabled.';
    52     $html .= '</label>';
    53    
    54     echo $html;
    55 }
    56 
    57 // Plugin function
    58 if( $options = get_option( 'bphelp_hptbpp' ) ) {
    59     function bp_help_redirect_to_profile(){
    60         if( is_user_logged_in() && is_home() ) {
    61             bp_core_redirect( get_option( 'home' ) . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile/' );
    62         }
    63     }
    64     add_action( 'template_redirect', 'bp_help_redirect_to_profile',1 );
    65 }
    66 
    67 if( $privacy = get_option( 'bphelp_hptbpp_privacy' ) ) {
    68     function bp_help_add_privacy() {
    69         if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() && !is_home() ) {
    70                 bp_core_redirect( get_option( 'home' ) );
    71         }
    72     }
    73     add_action( 'template_redirect', 'bp_help_add_privacy',1 );
    74 }
    75 
    76    
    77 /* Prevent RSS Feeds */
    78 function cut_nonreg_visitor_rss_feed() {
    79     if ( !is_user_logged_in() ) {
    80         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    81         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    82         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    83         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    84         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    85         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    86         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    87     }
    88 }
    89 add_action('init', 'cut_nonreg_visitor_rss_feed');
    90 /* End Prevent RSS Feeds */
    913?>
  • home-page-to-bp-profile-plus-privacy/tags/1.0/loader.php

    r774248 r997702  
    1212*/
    1313
    14 /*** Make sure BuddyPress is loaded ********************************/
    15 function bphelp_home_page_to_bp_profile_check() {
    16     if ( !class_exists( 'BuddyPress' ) ) {
    17     add_action( 'admin_notices', 'home_page_to_bp_profile_install_buddypress_notice' );
    18     }
    19 }
    20 add_action('plugins_loaded', 'bphelp_home_page_to_bp_profile_check', 999);
    21 
    22 function home_page_to_bp_profile_install_buddypress_notice() {
    23     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    24     _e('<strong>Home Page To BP Profile Plus Privacy</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 Home Page To BP Profile Plus Privacy</a>.');
    25     echo '</p></div>';
    26 }
    27 
    28 function home_page_to_bp_profile_init() {
    29     require( dirname( __FILE__ ) . '/home-page-to-bp-profile-plus-privacy.php' );
    30 }
    31 add_action( 'bp_include', 'home_page_to_bp_profile_init' );
    3214?>
  • home-page-to-bp-profile-plus-privacy/tags/1.2/home-page-to-bp-profile-plus-privacy.php

    r776161 r997702  
    11<?php
    2 // Dashboard/Reading setting
    3 function bphelp_initialize_hptbpp_plugin_options() {
    4    
    5     add_settings_field(
    6         'bphelp_hptp_profile_redirect',
    7         'Redirect Home Page To Profile On Login?',
    8         'bphelp_hptbpp_field_one',
    9         'reading'
    10     );
    11    
    12     add_settings_field(
    13         'bphelp_hptp_privacy',
    14         'Add Sitewide Privacy?',
    15         'bphelp_hptbpp_field_two',
    16         'reading'
    17     );
    18    
    19     register_setting(
    20         'reading',
    21         'bphelp_hptbpp'
    22     );
    23    
    24     register_setting(
    25         'reading',
    26         'bphelp_hptbpp_privacy'
    27     );
    28 }
    29 add_action( 'admin_init', 'bphelp_initialize_hptbpp_plugin_options' );
    302
    31 function bphelp_hptbpp_field_one() {
    32     $options = (array)get_option( 'bphelp_hptbpp' );
    33     $settings = $options['settings'];
    34    
    35     $html = '<label for="bphelp_hptbpp[settings]">';
    36         $html .= '<input type="checkbox" name="bphelp_hptbpp[settings]" id="[settings]" value="1" ' . checked( 1, $settings, false ) . ' />';
    37         $html .= '&nbsp;';
    38         $html .= 'If checked user will be redirected to profile on login.';
    39     $html .= '</label>';
    40    
    41     echo $html;
    42 }
    43 
    44 function bphelp_hptbpp_field_two() {   
    45     $privacy = (array)get_option( 'bphelp_hptbpp_privacy');
    46     $myprivacy = $privacy['myprivacy'];
    47    
    48     $html = '<label for="bphelp_hptbpp_privacy[myprivacy]">';
    49         $html .= '<input type="checkbox" name="bphelp_hptbpp_privacy[myprivacy]" id="[myprivacy]" value="1" ' . checked( 1, $myprivacy, false ) . ' />';
    50         $html .= '&nbsp;';
    51         $html .= 'If checked site-wide privacy will be enabled.';
    52     $html .= '</label>';
    53    
    54     echo $html;
    55 }
    56 
    57 // Plugin function
    58 if( $options = get_option( 'bphelp_hptbpp' ) ) {
    59     function bp_help_redirect_to_profile(){
    60         if( is_user_logged_in() && is_home() ) {
    61             bp_core_redirect( get_option( 'home' ) . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile/' );
    62         }
    63     }
    64     add_action( 'template_redirect', 'bp_help_redirect_to_profile',1 );
    65 }
    66 
    67 if( $privacy = get_option( 'bphelp_hptbpp_privacy' ) ) {
    68     function bp_help_add_privacy() {
    69         if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() && !is_home() ) {
    70                 bp_core_redirect( get_option( 'home' ) );
    71         }
    72     }
    73     add_action( 'template_redirect', 'bp_help_add_privacy',1 );
    74 }
    75 
    76    
    77 /* Prevent RSS Feeds */
    78 function hptbpp_cut_nonreg_visitor_rss_feed() {
    79     if ( !is_user_logged_in() ) {
    80         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    81         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    82         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    83         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    84         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    85         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    86         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    87     }
    88 }
    89 add_action('init', 'hptbpp_cut_nonreg_visitor_rss_feed');
    90 /* End Prevent RSS Feeds */
    913?>
  • home-page-to-bp-profile-plus-privacy/tags/1.2/loader.php

    r775347 r997702  
    1111Author URI: http://bphelpblog.wordpress.com/
    1212*/
    13 
    14 /*** Make sure BuddyPress is loaded ********************************/
    15 function bphelp_home_page_to_bp_profile_check() {
    16     if ( !class_exists( 'BuddyPress' ) ) {
    17     add_action( 'admin_notices', 'home_page_to_bp_profile_install_buddypress_notice' );
    18     }
    19 }
    20 add_action('plugins_loaded', 'bphelp_home_page_to_bp_profile_check', 999);
    21 
    22 function home_page_to_bp_profile_install_buddypress_notice() {
    23     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    24     _e('<strong>Home Page To BP Profile Plus Privacy</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 Home Page To BP Profile Plus Privacy</a>.');
    25     echo '</p></div>';
    26 }
    27 
    28 function home_page_to_bp_profile_init() {
    29     require( dirname( __FILE__ ) . '/home-page-to-bp-profile-plus-privacy.php' );
    30 }
    31 add_action( 'bp_include', 'home_page_to_bp_profile_init' );
    3213?>
  • home-page-to-bp-profile-plus-privacy/trunk/home-page-to-bp-profile-plus-privacy.php

    r776161 r997702  
    11<?php
    2 // Dashboard/Reading setting
    3 function bphelp_initialize_hptbpp_plugin_options() {
    4    
    5     add_settings_field(
    6         'bphelp_hptp_profile_redirect',
    7         'Redirect Home Page To Profile On Login?',
    8         'bphelp_hptbpp_field_one',
    9         'reading'
    10     );
    11    
    12     add_settings_field(
    13         'bphelp_hptp_privacy',
    14         'Add Sitewide Privacy?',
    15         'bphelp_hptbpp_field_two',
    16         'reading'
    17     );
    18    
    19     register_setting(
    20         'reading',
    21         'bphelp_hptbpp'
    22     );
    23    
    24     register_setting(
    25         'reading',
    26         'bphelp_hptbpp_privacy'
    27     );
    28 }
    29 add_action( 'admin_init', 'bphelp_initialize_hptbpp_plugin_options' );
    302
    31 function bphelp_hptbpp_field_one() {
    32     $options = (array)get_option( 'bphelp_hptbpp' );
    33     $settings = $options['settings'];
    34    
    35     $html = '<label for="bphelp_hptbpp[settings]">';
    36         $html .= '<input type="checkbox" name="bphelp_hptbpp[settings]" id="[settings]" value="1" ' . checked( 1, $settings, false ) . ' />';
    37         $html .= '&nbsp;';
    38         $html .= 'If checked user will be redirected to profile on login.';
    39     $html .= '</label>';
    40    
    41     echo $html;
    42 }
    43 
    44 function bphelp_hptbpp_field_two() {   
    45     $privacy = (array)get_option( 'bphelp_hptbpp_privacy');
    46     $myprivacy = $privacy['myprivacy'];
    47    
    48     $html = '<label for="bphelp_hptbpp_privacy[myprivacy]">';
    49         $html .= '<input type="checkbox" name="bphelp_hptbpp_privacy[myprivacy]" id="[myprivacy]" value="1" ' . checked( 1, $myprivacy, false ) . ' />';
    50         $html .= '&nbsp;';
    51         $html .= 'If checked site-wide privacy will be enabled.';
    52     $html .= '</label>';
    53    
    54     echo $html;
    55 }
    56 
    57 // Plugin function
    58 if( $options = get_option( 'bphelp_hptbpp' ) ) {
    59     function bp_help_redirect_to_profile(){
    60         if( is_user_logged_in() && is_home() ) {
    61             bp_core_redirect( get_option( 'home' ) . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile/' );
    62         }
    63     }
    64     add_action( 'template_redirect', 'bp_help_redirect_to_profile',1 );
    65 }
    66 
    67 if( $privacy = get_option( 'bphelp_hptbpp_privacy' ) ) {
    68     function bp_help_add_privacy() {
    69         if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() && !is_home() ) {
    70                 bp_core_redirect( get_option( 'home' ) );
    71         }
    72     }
    73     add_action( 'template_redirect', 'bp_help_add_privacy',1 );
    74 }
    75 
    76    
    77 /* Prevent RSS Feeds */
    78 function hptbpp_cut_nonreg_visitor_rss_feed() {
    79     if ( !is_user_logged_in() ) {
    80         remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ,3      );
    81         remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ,3      );
    82         remove_action( 'bp_actions', 'bp_activity_action_friends_feed'  ,3      );
    83         remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed',3      );
    84         remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ,3      );
    85         remove_action( 'bp_actions', 'bp_activity_action_favorites_feed',3      );
    86         remove_action( 'groups_action_group_feed', 'groups_action_group_feed',3 );
    87     }
    88 }
    89 add_action('init', 'hptbpp_cut_nonreg_visitor_rss_feed');
    90 /* End Prevent RSS Feeds */
    913?>
  • home-page-to-bp-profile-plus-privacy/trunk/loader.php

    r775347 r997702  
    1212*/
    1313
    14 /*** Make sure BuddyPress is loaded ********************************/
    15 function bphelp_home_page_to_bp_profile_check() {
    16     if ( !class_exists( 'BuddyPress' ) ) {
    17     add_action( 'admin_notices', 'home_page_to_bp_profile_install_buddypress_notice' );
    18     }
    19 }
    20 add_action('plugins_loaded', 'bphelp_home_page_to_bp_profile_check', 999);
    21 
    22 function home_page_to_bp_profile_install_buddypress_notice() {
    23     echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    24     _e('<strong>Home Page To BP Profile Plus Privacy</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 Home Page To BP Profile Plus Privacy</a>.');
    25     echo '</p></div>';
    26 }
    27 
    28 function home_page_to_bp_profile_init() {
    29     require( dirname( __FILE__ ) . '/home-page-to-bp-profile-plus-privacy.php' );
    30 }
    31 add_action( 'bp_include', 'home_page_to_bp_profile_init' );
    3214?>
Note: See TracChangeset for help on using the changeset viewer.