Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 16,176 through 16,200 (of 94,565 total)
  • Author
    Search Results
  • #250698
    jrb9406
    Participant

    Has anyone been successful at blocking buddypress pages until PMPRO email confirmation is complete? I seem to be getting nowhere with PMPRO folks.

    I am able to block /groups/, /members/, etc., but I cannot seem to block the sub-pages (e.g. /groups/group-name/). I took the PMPRO email confirmation code and modified it as follows. Any help is greatly appreciated!

    <?php
    /*
    Plugin Name: Paid Memberships Pro – Email Confirmation Add On
    Plugin URI: http://www.paidmembershipspro.com/addons/pmpro-email-confirmation/
    Description: Require email confirmation before certain levels are enabled for members.
    Version: .3
    Author: Stranger Studios
    Author URI: http://www.strangerstudios.com
    */
    /*
    Sample use case: You have a free level but want people to use a real email address when signing up.
    */

    /*
    [Deprecated] Set this array to the include the levels which should require email confirmation.

    global $pmpro_email_confirmation_levels;
    $pmpro_email_confirmation_levels = array(6);

    Use the checkbox on the edit levels page instead.
    */

    /*
    Add checkbox to edit level page to set if level requires email confirmation.
    */
    //show the checkbox on the edit level page
    function pmproec_pmpro_membership_level_after_other_settings()
    {
    $level_id = intval($_REQUEST[‘edit’]);
    if($level_id > 0)
    $email_confirmation = get_option(‘pmproec_email_confirmation_’ . $level_id);
    else
    $email_confirmation = false;
    ?>
    <h3 class=”topborder”>Email Confirmation</h3>
    <table>
    <tbody class=”form-table”>
    <tr>
    <th scope=”row” valign=”top”><label for=”email_confirmation”><?php _e(‘Email Confirmation:’, ‘pmpro’);?></label></th>
    <td>
    <input type=”checkbox” id=”email_confirmation” name=”email_confirmation” value=”1″ <?php checked($email_confirmation, 1);?> />
    <label for=”email_confirmation”><?php _e(‘Check this to require email validation for this level.’, ‘pmpro’);?></label>
    </td>
    </tr>
    </tbody>
    </table>
    <?php
    }
    add_action(‘pmpro_membership_level_after_other_settings’, ‘pmproec_pmpro_membership_level_after_other_settings’);

    //save email_confirmation setting when the level is saved/added
    function pmproec_pmpro_save_membership_level($level_id)
    {
    if(isset($_REQUEST[’email_confirmation’]))
    $email_confirmation = intval($_REQUEST[’email_confirmation’]);
    else
    $email_confirmation = 0;
    delete_option(‘pmproec_email_confirmation_’ . $level_id);
    add_option(‘pmproec_email_confirmation_’ . $level_id, $email_confirmation, ”, ‘no’);
    }
    add_action(“pmpro_save_membership_level”, “pmproec_pmpro_save_membership_level”);

    /*
    Functions
    */
    //Check if a level id requires an invite code or should generate one
    function pmproec_isEmailConfirmationLevel($level_id)
    {
    global $pmpro_email_confirmation_levels;

    //get value from options
    $email_confirmation = get_option(‘pmproec_email_confirmation_’ . $level_id, false);

    //check option and global var
    return (!empty($email_confirmation) || !empty($pmpro_email_confirmation_levels) && in_array($level_id, $pmpro_email_confirmation_levels));
    }

    //generate a key from a user id
    function pmproec_getValidationKey($user_id)
    {
    $key = md5($user_id . AUTH_KEY . $user_id);
    if(strlen($key) > 16)
    $key = substr($key, 0, 16);

    return $key;
    }

    /*
    Save validation key in user meta after checkout.
    */
    function pmproec_pmpro_after_checkout($user_id)
    {
    global $pmpro_level;

    if(pmproec_isEmailConfirmationLevel($pmpro_level->id))
    {
    //already validated?
    $oldkey = get_user_meta($user_id, “pmpro_email_confirmation_key”, true);
    if($oldkey != “validated”)
    {
    //nope? give them a key
    $key = pmproec_getValidationKey($user_id);
    update_user_meta($user_id, “pmpro_email_confirmation_key”, $key);
    }
    }
    }
    add_action(“pmpro_after_checkout”, “pmproec_pmpro_after_checkout”);

    /*
    If a user hasn’t validated yet and needs it, don’t give them access.
    */
    function pmproec_pmpro_has_membership_access_filter($hasaccess, $mypost, $myuser, $post_membership_levels)
    {
    //hide_buddy_press_pages()
    $uri = $_SERVER[‘REQUEST_URI’];

    //lock some things for members only
    $members_only = array(
    “/members-2/”, “/activity/”, “/groups-2/”, “/forums/”, “/welcome-back/”
    );
    //if they don’t have access, ignore this
    if(!$hasaccess)
    return $hasaccess;

    //if this isn’t locked by level, ignore this
    if(empty($post_membership_levels))
    return $hasaccess;

    //does this user have a level that requires confirmation?
    $user_membership_level = pmpro_getMembershipLevelForUser($myuser->ID);
    if(pmproec_isEmailConfirmationLevel($user_membership_level->id))
    {
    //if they still have a validation key, they haven’t clicked on the validation link yet
    $validation_key = get_user_meta($myuser->ID, “pmpro_email_confirmation_key”, true);

    if(!empty($validation_key) && $validation_key != “validated”)
    {
    $hasaccess = false;
    foreach($members_only as $check)
    {
    //make sure they are a member

    if(preg_match($check, $uri))
    {
    wp_redirect(“http://www.google.com&#8221;);
    exit;
    }
    }
    }
    }
    return $hasaccess;
    }
    add_filter(“pmpro_has_membership_access_filter”, “pmproec_pmpro_has_membership_access_filter”, 10, 4);

    /*
    Add validation lik to confirmation email.
    */
    function pmproec_pmpro_email_body($body, $email)
    {
    //must be a confirmation email and checkout template
    if(!empty($email->data[‘membership_id’]) && pmproec_isEmailConfirmationLevel($email->data[‘membership_id’]) && strpos($email->template, “checkout”) !== false)
    {
    //get user
    $user = get_user_by(“login”, $email->data[‘user_login’]);

    $validated = $user->pmpro_email_confirmation_key;
    $url = home_url(“?ui=” . $user->ID . “&validate=” . $validated);

    //need validation?
    if(empty($validated) || $validated != “validated”)
    {
    //use validation_link substitute?
    if(false === stripos($body, “!!validation_link!!”))
    {
    $body = “<p>IMPORTANT! You must follow this link to confirm your email address before your membership is fully activated:<br />” . $url . “</p><hr />” . $body;
    $body = str_replace(“Your membership account is now active.”, “”, $body);
    } else
    $body = str_ireplace(“!!validation_link!!”, $url, $body);
    }
    }

    return $body;
    }
    add_filter(“pmpro_email_body”, “pmproec_pmpro_email_body”, 10, 2);

    /*
    Process validation links.
    */
    function pmproec_init_validate()
    {
    if(!empty($_REQUEST[‘validate’]) && !empty($_REQUEST[‘ui’]))
    {
    $validate = $_REQUEST[‘validate’];
    $ui = $_REQUEST[‘ui’];
    $user = get_userdata($ui);
    if($validate == $user->pmpro_email_confirmation_key)
    {
    //validate!
    update_user_meta($user->ID, “pmpro_email_confirmation_key”, “validated”);

    do_action(‘pmproec_after_validate_user’, $user->ID, $validate);

    if(is_user_logged_in())
    wp_redirect(home_url());
    else
    wp_redirect(wp_login_url());

    exit;
    }
    }
    }
    add_action(“init”, “pmproec_init_validate”);

    /*
    Update confirmation page to mention validation email if needed.
    */
    function pmproec_pmpro_confirmation_message($message)
    {
    //must be an email confirmation level
    if(!empty($_REQUEST[‘level’]) && pmproec_isEmailConfirmationLevel(intval($_REQUEST[‘level’])))
    {
    global $current_user;
    if($current_user->pmpro_email_confirmation_key != “validated”)
    {
    $message = str_replace(“is now active”, “will be activated as soon as you confirm your email address. Important! You must click on the confirmation URL sent to ” . $current_user->user_email . ” before you gain full access to your membership“, $message);
    }
    }

    return $message;
    }
    add_filter(“pmpro_confirmation_message”, “pmproec_pmpro_confirmation_message”);

    /*
    Function to add links to the plugin row meta
    */
    function pmproec_plugin_row_meta($links, $file) {
    if(strpos($file, ‘pmpro-email-confirmation.php’) !== false)
    {
    $new_links = array(
    ‘‘ . __( ‘Support’, ‘pmpro’ ) . ‘‘,
    );
    $links = array_merge($links, $new_links);
    }
    return $links;
    }
    add_filter(‘plugin_row_meta’, ‘pmproec_plugin_row_meta’, 10, 2);

    /**
    * Add link to the user action links to validate a user
    *
    * Use the pmproec_validate_user_cap filter to change the capability required to see this.
    */
    function pmproec_user_row_actions($actions, $user) {
    $cap = apply_filters(‘pmproec_validate_user_cap’, ‘edit_users’);
    if(current_user_can($cap))
    {
    //check if they still have a validation key
    $validation_key = get_user_meta($user->ID, “pmpro_email_confirmation_key”, true);
    if(!empty($validation_key) && $validation_key != “validated”)
    {
    $url = admin_url(“users.php?pmproecvalidate=” . $user->ID);
    if(!empty($_REQUEST[‘s’]))
    $url .= “&s=” . esc_attr($_REQUEST[‘s’]);
    if(!empty($_REQUEST[‘paged’]))
    $url .= “&paged=” . intval($_REQUEST[‘paged’]);
    $url = wp_nonce_url($url, ‘pmproecvalidate_’ . $user->ID);
    $actions[] = ‘Validate User‘;
    }
    else
    $actions[] = ‘Validated’;
    }

    return $actions;
    }
    add_filter(‘user_row_actions’, ‘pmproec_user_row_actions’, 10, 2);
    add_filter(‘pmpro_memberslist_user_row_actions’, ‘pmproec_user_row_actions’, 10, 2);

    /**
    * Manually validate a user. Runs on admin init. Checks for pmproecvalidate and nonce and validates that user.
    *
    */
    function pmproec_validate_user()
    {
    if(!empty($_REQUEST[‘pmproecvalidate’]))
    {
    global $pmproec_msg, $pmproec_msgt;

    //get user id
    $user_id = intval($_REQUEST[‘pmproecvalidate’]);
    $user = get_userdata($user_id);

    //no user?
    if(empty($user))
    {
    //user not found error
    $pmproec_msg = ‘Could not reset sessions. User not found.’;
    $pmproec_msgt = ‘error’;
    }
    else
    {
    //check nonce
    check_admin_referer( ‘pmproecvalidate_’.$user_id);

    //check caps
    $cap = apply_filters(‘pmproec_validate_user_cap’, ‘edit_users’);
    if(!current_user_can($cap))
    {
    //show error message
    $pmproec_msg = ‘You do not have permission to validate users.’;
    $pmproec_msgt = ‘error’;
    }
    else
    {
    //validate!
    update_user_meta($user_id, “pmpro_email_confirmation_key”, “validated”);

    //show success message
    $pmproec_msg = $user->user_email . ‘ has been validated.’;
    $pmproec_msgt = ‘updated’;
    }
    }
    }
    }
    add_action(‘admin_init’, ‘pmproec_validate_user’);

    /**
    * Show any messages generated by PMPro Email Confirmations
    */
    function pmproec_admin_notices()
    {
    global $pmproec_msg, $pmproec_msgt;
    if(!empty($pmproec_msg))
    echo “<div class=\”$pmproec_msgt\”><p>$pmproec_msg</p></div>”;
    }
    add_action(‘admin_notices’, ‘pmproec_admin_notices’);

    #250697
    tammy1999
    Participant

    Sorry I wasn’t clear.

    I have a multi site with with a main site and secondary site. I have put define ( ‘BP_ROOT_BLOG’, 2 ); in the wp-config.php. I have only activated BuddyPress on the secondary site. And everything is good with the settings.

    Except when it comes to the Groups Pages on the Dashboard of the secondary site. When I make any changes to the pages on any group and hit Save, it will go to the Main Site. It should go to the secondary site. Also any Group Page details shows up in the Group Page area on the Main site. The only reason I know this is because I activated Buddy Press on the Main site and all the groups are there. But I keep all the BuddyPress plugins off on the Main site.

    The Group Pages doesn’t have any group pages listed on the secondary site.

    I thought after making the secondary site the BuddyPress site that everything would show up there.

    #250693

    In reply to: PUBLIC MESSAGE

    danbp
    Participant

    The css tag ID #aw-whats-new-submit may exist, but if your theme use some specific height or width for it which is different from what is used by BP in the js/css file, you didn’t see the button.

    This is a very common theme issue, handled on many topics on this forum.

    @tonyxs1 logically in the template. The what’s new form is used on activity, profile and group page.

    You’ll certainly find some good information from these one or other search results:
    https://buddypress.org/support/search/what%5C’s+new+form/

    #250692
    danbp
    Participant

    Hi @tammy1999

    I have a 2 site multisite sounds a bit ambiguous.

    Do you mean 2 multisite installs or 1 multisite install with 2 sites ?

    If your config is the second option, BuddyPress should be at the root of the main site, at the same level as WordPress. Case A. of a standart network install, as explained here:

    Installation in WordPress Multisite

    Read attentively each step of your special configuration to see if you didn’t omited something in your settings.

    #250691
    tammy1999
    Participant

    I have a 2 site multisite. I put define ( ‘BP_ROOT_BLOG’, 2 ); for the secondary site to be in charge of BuddyPress.

    But the Group Pages in the Admin Panel on the secondary site shows no groups and their pages. If I turn on BuddyPress in the main site, all the Group Pages show there.

    The Groups listing shows up fine in the secondary site.

    Is there a way to make the Group Pages show up in the secondary site?

    jersey peeps
    Participant

    Hi guys I have picked up on a bug where as any emails being sent are being shown as from wordpress and not from my website.

    Being a custom website I would prefer users not to know that i’m using wordpress to run the website, plus it doesn’t look very professional.

    I was using WP Better emails plugin which fixed this issue, but it conflicts with the buddypress built in email features so have had to disable it to make every thing work as it should.

    Any ideas on how to show emails being sent as being sent from my website and not ‘wordpress’ ?

    shanebp
    Moderator

    To get rid of the bbpress notice that appears at the top of the wp-admin screen for Emails > Customize, paste this in your theme/functions.php or in plugins/bp-custom.php

    function pp_remove_bbpress_notice() {
    	
    	if ( isset( $_REQUEST['wp_customize'] ) ) {
    	
    		if ( class_exists( 'bbPress' ) ) {
    
    			remove_action( 'set_current_user', 'bbp_setup_current_user', 10 );
    			
    			add_action( 'set_current_user',  'pp_bbp_setup_current_user',  10 );
    		}
    	}
    }
    add_action( 'plugins_loaded', 'pp_remove_bbpress_notice' );
    
    function pp_bbp_setup_current_user() {
    	
    	if ( class_exists( 'bbPress' ) ) 
    		bbp_set_current_user_default_role();
    	
    }
    #250679
    edragonxx
    Participant

    Did not work either. Have tried so many different ways to get rid of that buddypress register page and use standard one. This option should be already built in to let users use do they want use buddypress one or do they want use wordpress one. So that login, register, lost password, etc forms would use same page/system and would not be different.

    #250678
    Paul Wong-Gibbs
    Keymaster

    People who are having problems: as far as I know, we have never seen this problem before during testing. If someone like you had helped us test BuddyPress 2.5 in beta or release candidate stage about four weeks ago, we’d have fixed it prior to release.

    We’ll get it fixed as soon as we figure out what the problem is.

    I was just thinking about it and have one question which would be interesting: in wp-admin Settings > General, the value for the Email Address — is it a REAL email address? For example, if you were to send an email to that address, would it receive it?

    #250674
    DCstyle
    Participant

    Im running into the same problem, But its not just the Activation mails, its any kind of mail related to buddypress thats not working anymore. My members get no updates and cant activate. Please Bring us a fix/solution Asap

    #250673
    Paul Wong-Gibbs
    Keymaster

    Thanks for your feedback, @backpackersunion. I’ll let others chime in as I spent a long time working on the email feature, so it’s close to my heart, but here’s my thoughts:

    • Decisions, not options.
    • It’s much easier to add options than it is to remove options.
    • It’s risky to add options or features unless you’re sure what your users want, so launching with a minimal feature set and listening to feedback and consensus helps us make informed decisions.

    And the template, yes — you run the risk of the template going out-of-sync with the version distributed by BuddyPress. But this isn’t specific to the email feature, and could apply to any of BuddyPress thirty or so other templates.

    We have some plans to add some communication around template changes in a feature release, like WooCommerce apparently does, which will help a bit.

    #250671

    In reply to: translation email

    Paul Wong-Gibbs
    Keymaster

    @airsid

    IF your translation file is up to date (have you re-downloaded the files to check?), those strings should be getting translated.

    Otherwise, another option is to edit the email template. Copy buddypress/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php into your theme and make whatever changes you want.

    #250669
    Paul Wong-Gibbs
    Keymaster

    If the filter bp_email_use_wp_mail returns true, it’ll grab the “plain text” version of the email from BuddyPress, and send that to wp_mail(). BuddyPress does not re-implement wp_mail().

    BuddyPress will also fall back to use wp_mail() if it detects that any other plugin has re-implemented that function (pretty common in email plugins), or if something’s configured WordPress to send HTML emails.

    BuddyPress does not stop or block any other plugins’ emails from being sent, nor any emails sent by WordPress core (with a few exceptions for multisite-specific emails, but this has been implemented for about 6 or 7 years, so it’s not a new change).

    I am just now testing this with WP Better Emails. Give me a minute.

    BackpackersUnion
    Participant

    I posted a few challenges with the new email template UI here in ‘Ideas’, but it seems using add_filter( 'bp_email_use_wp_mail', '__return_true' ); to bypass the new email template feature, also causes BuddyPress (or WordPress) to bypass other Email html plugins (Namely, ‘WP Better Emails’).

    So, the new BP email template feature lacks the flexibility I need, but the bp_custom code to turn it off breaks my current html email solution (WP Better Emails).

    Is there a different way to turn off the new email templates without bypassing other html email plugins?

    Thanks!

    BP & WP Current Versions. 2015 Theme.

    #250661

    In reply to: translation email

    airsid
    Participant

    Hello,
    @djpaul: link is not good anymore 🙁

    @danbp: thank you. I’ve buddypress in french isntalled already. Such a great plugin 😉
    But what i can’t find is how to translate the “Hi” of the “Hi {{recipient.name}},” in emails header.
    And the idem for the “unsubscribe” in bottom of emails.

    #250659
    mtraps
    Participant

    Okay thanks. I’ll have to do some more research.Do you recommend using a theme that is meant for buddy press or would any theme work perfect with buddypress?

    #250655
    BackpackersUnion
    Participant

    The new email template UI is a great idea, but the lack of flexibility seems to defeat its own purpose. Three major components cannot be altered without altering the the single-bp-email.php: What the header says, the recipient members name (Hi…) and the ‘Unsubscribe’ link in the footer.

    If an admin needs to change any of these (e.g. Change “Unsubscribe” to “Turn off notifications”) then the template needs to be altered directly (In a child theme) which seems to undermine the whole point of having the email template UI (i.e. Avoid the need to modify the emails html directly).

    Also, because the “single-bp-email.php” is a newer file, I’m assuming it may be modified as the feature is adjusted. So, modifying the html directly in a child theme will require manually checking and updating the “single-bp-email.php” file with new BuddyPress updates.

    Thoughts?

    #250650
    shanebp
    Moderator

    What you want is the ability for members to create posts in the front end.
    And have filterable activity items created for those posts.

    Both items are very doable – via other plugins or custom code.

    To see the current offerings, Google: buddypress front end post

    #250645
    Gretchen Louise
    Participant

    Yes, this is the search widget built into bbPress.

    We deactivated all plugins except for bbPress, and it worked fine. Next we activated BuddyPress, and it quit working. Even when those are the only two plugins active, it doesn’t work.

    #250641
    benkurbis
    Participant

    I am trying to add a sub navigation link to the profile page of a logged in user. Parent url is profile and I want it next to the links “View” and “Edit”

    I’ve tried using bp_core_new_subnav_item but I can’t get it to work properly.

    For some reason it is not letting me use the code here to show you what I have tried. If there is a special way please let me know.

    #250640

    In reply to: Visible profile fields

    idoobi
    Participant

    Forgot to mention: using latest BuddyPress, bbPress in Divi theme.

    #250635
    mtraps
    Participant

    Hey guys, I’ve never used buddy press before and before I dive in further I’d like to know if there is an option for users who sign up to create a post that could include text video images etc. When they are done their post they would then be able to choose 2-3 categories that their post fits in and then submit. When it gets submitted it would go to the activity loop on the home page under latest posts. Any other user who visits the site would be able to filter out all the posts created with a filter (similar to Kjiji or amazon) to find the exact posts they would like to see. Is this even possible or is this outside the scope of buddypress. Thanks in advance guys!

    Mark
    Participant

    @djpaul Hi Paul,

    I have no clue what that means! Will copy my details from this ticket into a bug report when I get a chance. It’s 3:22AM so I will do so probably tomorrow.

    So I just pieced some code from Buddypress 2.5.0 (previously used code from 2.4.0 files during testing) files together using class-bp-core-whos-online-widget.php and bp-members-widgets.php to create a generic widget containing a generic loop in it. After putting that generic widget into a dynamic sidebar and then calling that sidebar above the cover image header the loop displays and doesn’t break the private message button. Weird way about getting my custom loop to display above the cover image header on a member’s profile but works for some reason. Thought I’d let you know just in case the info helps.

    Not sure why the code I pieced together from Buddypress 2.4.0 (bp-members-widgets.php) didn’t work also when I first tried this random workaround. During that round of testing the loop displayed as intended but still broke the private message button. I’m not a coder so I have no clue what is happening, I just figured it was something to do with the loading of the code so I tried random things to try and get it to work. Noticed you no longer just use bp-members-widget.php for 2.5.0 so maybe that has something to do with my workaround working now. Weird.

    Anyways, thanks for all your help. Will be great to have one of you experts take a look and remedy this quirk.

    Have a great night.

    Regards,
    mark

    #250627
    idoobi
    Participant

    This appears to be a bit of a problem here, as there are others wondering why this is not a core function.
    I am about to launch a forum for a school class. I need forum members to be able to see and recognise both the parent’s names and their child’s (it is not always obvious who sired which sprog).
    I have set up a Child field in the extended profile, but I need that to be immediately available and visible along with the parent’s name, i.e.
    Cuthbert Longstocking | Pippi Longstocking

    Any help out there (before BuddyPress improves itself)?

    The forum page is here: Forum

    And – BuddyPress – is there any way you could maybe get rid of the HTML formatting tags and display the text properly?!

    #250625
    Paul Wong-Gibbs
    Keymaster
Viewing 25 results - 16,176 through 16,200 (of 94,565 total)
Skip to toolbar