Search Results for 'wp user activate'
-
AuthorSearch Results
-
September 6, 2016 at 10:34 pm #258472
In reply to: Confirmation Email
roller24
ParticipantDavid Im trying to alleviate the activation process, I tried your snippet in /wp-content/plugins/bp-custom.php
I added a closing php tag because I didn’t see one, but something didn’t happen correctly.
the registration page returns to registration page and no user is activated.Are we missing something? Do I need to put the code elsewhere?
I also noticed in one file, I think it was signup that at the end of the file after submitting registration there was an if statement that asks if user activation required… send activation email..
else
echo your good go ahead and login..I was searching for the setting which makes activation required, but could not find it.
There is a strange row in the bp data tables called “registration” with only a 0 as the data.
Could this be changed to 1, I didn’t test it, but if you know.September 6, 2016 at 11:54 am #258441In reply to: Conflict between memberships paid pro and plugins
danbp
ParticipantBPB doesn’t handle with wp roles. The plugin adds only a progress % column to users admin.
Try to deactivate this column in wp-admin/users.php > screen option > Profile StatusDo you get some php errors when wp_debug is activated in wp-config ?
September 6, 2016 at 8:42 am #258434In reply to: Conflict between memberships paid pro and plugins
milena79
ParticipantGood morning,
probably I explained bad,
I try to explain better =)I installed the plugin Buddy progress bar, and I have already registered members who belong to a subscription level (created with
Paid Memberships Pro), when activated the plugin Buddy progress bar and I go to see the users I can not aveda which subscription level they have.I enclose a picture
Thank you
September 5, 2016 at 4:46 pm #258410In reply to: How to Change the From Email for Activation
steigw
ParticipantIt’s a staging site that doesn’t have public access, but I can put the code and info in here. Here is the complete code of the functions.php in the child theme. maybe I just put it all together wrong.
<?php function nisarg_enqueue_styles() { $parent_style = 'nisarg-style'; wp_enqueue_style( 'bootstrap', get_template_directory_uri().'/css/bootstrap.css' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/font-awesome/css/font-awesome.min.css' ); wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'nisarg-child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) ); } add_action( 'wp_enqueue_scripts', 'nisarg_enqueue_styles' ); ?> <?php function custom_wp_mail_from( $email ) { $handle = ‘accounts’; $find = 'http://'; $replace = ''; $link = get_bloginfo( 'url' ); $domain = str_replace( $find, $replace, $link ); return $handle . '@' . $domain ; } add_filter( 'wp_mail_from', 'custom_wp_mail_from' ); ?>The email link is:http://mydomain.com/activate/JA0BvkK1Q0DND10SYegdOtkTMemhGUF0/
When I click on it immediately, I get all this:
Fatal error: Uncaught exception ‘phpmailerException’ with message ‘Invalid address: ‘accounts’@mydomain.com’ in /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/class-phpmailer.php:946 Stack trace: #0 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/pluggable.php(352): PHPMailer->setFrom(‘\xE2\x80\x98accounts\xE2\x80\x99@…’, ‘WordPress’) #1 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/pluggable.php(1726): wp_mail(‘webmaster@arlin…’, ‘[My Dev Sit…’, ‘New user regist…’) #2 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-content/plugins/buddypress/bp-members/bp-members-functions.php(2031): wp_new_user_notification(18) #3 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-content/plugins/buddypress/bp-members/bp-members-screens.php(364): bp_core_activate_signup(‘JA0BvkK1Q0DND10…’) #4 [internal function]: bp_core_screen_activation(”) #5 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/plugin.php(524): cal in /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/class-phpmailer.php on line 946
If I wait a while, then I get the normal webpage and it says “invalid activation key”. I don’t understand the significance of an immediate click on the link in the email vs. waiting a few more seconds, but it definitely matters.
August 30, 2016 at 1:27 pm #258185In reply to: tinymce in activity replies and comments
danbp
ParticipantHi, glad it works for you.
The visual editor use TinyMCE wich comes with his own ID and class. That works with WP, but not with BP who use his own id’s and JS on activity page.
Tweaking JS files is delicate and that’s why i said “deactivate the visual tab”. You should use the filter i indicated to remove it completely (so nobody would be tempted to click it).
But if you’re comfortable with JS, feel free to do it. But without any warranty (outside some headeache) about the final result as it will be very tricky to do.The media uploader is usually reserved to site admin, editors and authors when they post on the blog from backend. In our case, adding some styling possibilities to the what’s new content from frontend, is slightly different.
Imagine all your xxx.xxxx members accessing to the media library without any control each time they write something! That’s a big security risk, because subscribers (wich is the default BP users level) could access to a part of your backend and also to your server.
If you need full publication rights, create authors and let them publish real blog posts. But don’t use the what’s new form to replace this (complex) bloging functionnality.
The text tab has already a bold button (
b– the first one, on the left ).
And you can embed links to images using theimgbutton or embed different medias like video simply by copy/pasting a youtube link or other allowed services.Take also in mind that the default form comes without any style buttons. This trick add some.
Guess you have to work with this compromise. IMO better as nothing, no ? Avoid reinventing the wheel ! Stay simple and your site will remain operable.
August 27, 2016 at 6:43 pm #258125In reply to: tinymce in activity replies and comments
danbp
ParticipantThe ultimate tutorial to add wp_editor to What’s New textarea (on Site, Members and Group Activities pages).
Warning
The What’s New feature was never intended to publish posts or formatted text. It was imagined for brief announcement or instant conversation. That’s why this textarea is texturized and doesn’t allow much HTML tags. It is also ajaxified and need the original BP ID to work.
You will use it at your own risk.The following trick will let you remove the existing textarea from the template and replace it with a custom wp_editor. And it will be very customized ! For example, you will not have the visual tab, but only his HTML version, similar to the one you see on this forum for example.
Required:
BuddyPress activated
a working child theme
some understanding of HTML and php grammarThis trick was succesfully tested on a single install with WP 4.6, BP 2.6.2 and a Twenty Sixteen child theme.
Start !
Read from here how to remove the textarea in post-form.phpThe code to remove is line 40 and looks like this:
<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10" <?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?> ><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>You replace it by:
<?php $content = ''; $editor_id = 'whats-new'; wp_editor( $content, $editor_id ); ?>As the visual edit tab doesn’t work, you must deactivate it. In your child-theme functions.php, add this:
add_filter( 'user_can_richedit' , '__return_false', 50 );And that’s it !
If you want also rich edit for activity comments, which i didn’t recommand for sites who have many comments, you can use the same technique as above, with some more settings. Note that each comment has is own ID and that each comment editor should also have an unique ID.
First, you need to remove the textarea from (child-theme/buddypress/)activity/entry.php
You remove this:
<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input bp-suggestions" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
and replace it by<?php $id = bp_get_activity_id(); $content = ''; $editor_id = 'ac-input-'. $id; $settings = array( 'textarea_name' => 'ac_input_'. $id, 'editor_class' => 'ac-input bp-suggestions' ); wp_editor( $content, $editor_id, $settings ); ?>With Twenty Sixteen, i first couldn’t see the Post Update button and the option selector. I got it with this little CSS adjustment (in child-theme/style.css).
div#whats-new-options { display: block!important;}Function reference: wp_editor.
August 18, 2016 at 5:18 pm #257753In reply to: first_name & last_name automatically altered
danbp
Participant@mugwumpman,
first and last_name fields don’t belong to BuddyPress, but to WP profiles.BP use only a field called Name at first install. User can enter their first AND last name in that field. Is this what you’re talking about ?
After reading your topic on wp.org, it seems that you use those fields to enter datas which are not first and last names, but more for company and company activity or such.
As you use BP, i would suggest you use the power of xprofile and offer to your user a much better experience by adding a field for a company and another for company activity (or something like that). So you can forget WP’s profile fields and use BP’s xprofile fields.
WP’s profile field used when BP is activated are: username, email and password.
And BP adds his mandatory Name field, which can be first, lastname, username or whatever other unique name belonging to a subscriber (which can be a human, a pet, a company….).And yo can as many fields you want to the registery or for later on profiles.
The other problem related to font case is a mistery so far. Can be related to many things such as plugins or theme or custom function. This can be determined by debuging and using one of WP’s default theme and all plugins deactivated.
No matter to know if you fill a wp or a bp field for this. Both use a textarea, so it’s probably more a css thing somewhere.
August 16, 2016 at 10:09 am #257676In reply to: Redirect does not work
danbp
ParticipantBP’s target the page, not the register process. In brief, BP shows the wp-login page. For internal purpose only, BP needs a registration page to fit with WP.
But it’s not an ordinary wp page, just a placeholder, or “internal address” if this is clearer to you.
Normally, by default, once his registration is fullfiled, the user is redirected to
your-site/register/where he see Check Your Email To Activate Your Account! .Check your theme settings or theme’s functions.php if it contains some redirect to homepage.
August 1, 2016 at 3:04 am #257144In reply to: how to add new members to groups automatically?
buddycore
ParticipantFirst you are creating a custom function called
automatic_group_membership()this takes one parameter$user_id.This function terminates if there is no
$user_idprovided, meaning you don’t run rogue code and your site is more optimised.When a
$user_idis present thegroups_accept_invite()function is run. This function is a BuddyPress core function you can find it inwp-content/plugins/buddypress/bp-groups/bp-groups-functions.phpon line 1400.It accepts two parameters a
$user_idand a$group_id. You need both in order to create the relationship.This function is “hooked” with
add_action()which is a WordPress core function. This functionadd_action()has many hooks available for various situations. You can read more about hooks here https://codex.wordpress.org/Plugin_API/Hooks.Essentially it’s an opportunity to run your own code against WordPress core, or in this case BuddyPress core. BuddyPress provides the hook and we use them to achieve cool things.
So the hook in this case is
bp_core_activated_userand the code we want to run when this hook is available would be the customer functionautomatic_group_membershipwhich is passed as a second parameter.I’m not sure where the
$user_idgets populated along the way here, nor the$group_idmaybe someone can help?Otherwise, I would do this not on activation but when a user has logged in for the first time.
Then we have access to
global $bpwhich contains aloggedin_user->idwhich can be used with this function and you could manually set the$group_idin bp-custom.phpJuly 22, 2016 at 10:04 pm #256954danbp
ParticipantSorry if this is not clear to you: i can’t explain better.
Posts, comments, or activities of the users in sites other than where you activated BuddyPress won’t be recorded in the Activity Streams when you install BuddyPress in only one site of the network.
BP should be activated on the main site where WP is installed, if you want the whole blogs activities.
your-site/ here is WP declared as network
sub-blog1/your-site/
su-blog2/your-site/ you activated BP on this secondary blog. OK fine, but it’s a sub-blog and BP will only show the activity of that sub-blog.
sub-blog1/your-site/
etc…July 22, 2016 at 7:00 am #256912danbp
Participantguess you have to follow instructions belonging to the actual WP/BP version… Haven’t you seen this notice ?
***The following pertains to administrators using WordPress 3.0 in network mode)***BP should be on the same site where WP is installed.
Follow Codex from here and note that:
One site of the Network
C. BuddyPress Activated in Main Site only
D. BuddyPress Activated in Secondary Site only
Posts, comments, or activities of the users in sites other than where you activated BuddyPress won’t be recorded in the Activity Streams when you install BuddyPress in only one site of the network.July 18, 2016 at 6:40 pm #256772danbp
ParticipantWordPress is a CMS.
Members are the heart of BuddyPress, which is a plugin.Once BP is activated, your user haven’t to go to their dashboard, as anything can be done from front-end. If you need wp’s bio field, you could recreate one with xprofile.
Suggest to read the Codex to understand how BP is working.
And if it’s not enough, see this plugin (but probably only usefull if you had a wp install running with many contributors before using BP).
July 8, 2016 at 11:37 pm #256142In reply to: BP Profile – Replacing USERNAME with NICKNAME
danbp
ParticipantHi,
if nothing made sense of what you already read, i doubt i can help you as i would certainly repeat the same things… 😉Nickname doesn’t exist in WordPress. On a WP install, a new user is only asked for a username(generally it’s a nickname like creatorsite), an email and a password. That’s all!
By convinience, a WP user can add his first and last name to his profile, but it is not an obligation.
When BP is added, he adds a mandatory field called Name which can by filled with first and last name or whatever else. Only the field is mandatory, not the content. And you can change his nale to what you want. Eg. Your dogs name. An other difference for this field is that it let you enter uppercase and space, what the WP username field doesn’t allow. BP use this field to synchronize members from WP and those registered once BP is activated.
Users are handled by WP, not by BP which is only a plugin, btw. both use the same DB user table.
Here a complete description of WP’s database, and read attentively the part related to wp_users.
Nickname = username. Your question is related to username vs. display_name.
Read here for a solution.
ps: your picture mention that nicknames can eliminate a security issue. Which one exactly ? i’m curious to learn how over 200 000 active BP sites are threatened by hackers seaking for usernames in 2016 !
July 4, 2016 at 4:09 pm #255817In reply to: Approve users by custom email
pulidomate
ParticipantFinally i have done this:
function activation_email( $subject, $message, $user_id, $user_email, $key ) { $teacher = bp_get_profile_field_data('field=Teacher&user_id='.$user_id); $activate_url = esc_url( $activate_url ); $message = sprintf( __( "Thanks for registering! To complete the activation of this account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url ); $user_email = $teacher; wp_mail( $user_email, $subject, $message ); } add_action( 'bp_core_sent_user_validation_email', 'activation_email', 10, 5 );July 1, 2016 at 11:24 pm #255647In reply to: Confirmation Email
Dono12
ParticipantThanks for your prompt response and your help but that function did not achieve the goal I was looking for. I wanted the activation Key to come from Cymi User Extra Field. I found a solution from someone with a similar problem but it is a little too extreme for me. The result you get is a Cymi User Extra Field Key/URL, Looks like This(cimy_key=88fddcb568dcf2d6). It involved editing a core Buddypress file wp-content/plugins/buddypress/bp-core/bp-core-filters.php. Can you help with a function for my functions.php or bp-custom to achieve the same goal. If it’s not too much maybe generate the Cymi-Key in the Buddypress Email Template though not a priority. I’m fully aware that editing core files is not practical, especially being that you lose it during updates.
https://buddypress.org/support/topic/activation-email-key-doesnt-work-i-may-have-the-fix/
function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { $activate_url = bp_get_activation_page() . "key=$key"; $activate_url = esc_url($activate_url); $admin_email = get_site_option( 'admin_email' ); if ( empty( $admin_email ) ) $admin_email = 'support@' . $_SERVER; // Then it ends with, on line 255 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );July 1, 2016 at 7:04 pm #255638In reply to: Confirmation Email
David Cavins
KeymasterI’m not sure what behavior you’re aiming for, but this snippet will disable the confirmation email and log the user in automatically upon successful registration.
<?php add_action( 'bp_core_signup_user', array( $this, 'disable_validation_of_new_users' ) ); add_filter( 'bp_registration_needs_activation', '__return_false' ); add_filter( 'bp_core_signup_send_activation_key', '__return_false' ); function disable_validation_of_new_users( $user_id ) { // Get the user's activation key for BP. This is the activation_key in user_meta, not the key in the user table. $user_key = get_user_meta( $user_id, 'activation_key', TRUE ); // Activate the signup $awuser = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $user_key ) ); // Automatically log the user in. // Thanks to Justin Klein's wp-fb-autoconnect plugin for the basic code to login automatically $user_info = get_userdata($user_id); wp_set_auth_cookie($user_id); do_action( 'wp_signon', $user_info->user_login ); bp_core_add_message( __( 'Your account is now active!', 'my-plugin-slug' ) ); buddypress()->activation_complete = true; }June 29, 2016 at 3:46 pm #255501In reply to: BuddyPress user login/registration issues
bogski
ParticipantEvent Espresso uses the WP login/registration, but they also check and locks a lot of the functions in wp-login.php before they can be called. This has only been recently, but i think it was done to enable users to go through the registration process without leaving the event checkout page. Before recent, when signing up for a new account and event, you would have to leave the page to activate your account and then start the process of ordering again. not ideal really.
Its not perfect in all honesty. I think il try some of the other options out on my local server see what they work like. Although i wont be using them on the website in question as we have already purchased the license for our current system. And modified it now.
Phil
June 18, 2016 at 6:58 pm #254805In reply to: A question about @mentions
danbp
ParticipantHi @binary10,
the plugin is outdated and doesn’t work with BP 2.5.3 network activated. Last update was 2 years ago and his compatibility was up to WP 3.8.14… Meantime, @mention evoluted and this plugin has no objective reason to be alive today. On BP’s side, what’s new form has now it’s own template file (post-form.php) and works a bit differently as 3 years ago.
Except if you’re still using BP 1.8, BP default theme and WP 3.8, you’re loosing your time with it.
If you need a what’s new area somewhere, you can simply call his template. Eg.
if ( is_user_logged_in() ) : bp_get_template_part( 'activity/post-form' ); endif;Successfully tested on a MS install sub blog, and @mention 100% on hand.
June 16, 2016 at 9:29 pm #254713danbp
ParticipantI tested your code and got first a page not found error while trying to send a private message from the new position.
I deactivated both action hook in cover and home files.
Disallowed cover image option. And tested again and everithing worked.
Allowed cover image and worked also.So i confirm that your code works and all buttons show up (with active href’s), at least with Twenty Sixteen theme, at the members profile page bottom.
In resume, the only thing you have to do is to deactivate the original action hook in both files (so you can allow/disallow cover images).
Forgot to mention that there is a litle error in your code line 133
<?= wpautop(xprofile_get_field_data("About me", bp_displayed_user_id() ) ); ?>Should be
<?php wpautop(xprofile_get_field_data("About me", bp_displayed_user_id() ) ); ?>June 16, 2016 at 12:11 pm #254626In reply to: Private messages isn’t working
danbp
ParticipantPrivate message
A user must have friends to send private messages or visit the profile of another user to send him a msg.
To get it to work, you need also to enable following options in BP settings:
– Friend Connections
– Private messaging
Additionnally, if you want to be notified by email
– NotificationsWhatever the option you activate, best practice is to control how it works on your config. To do that, use only WP, BP and one of Twenty’s theme before activating a third party theme and any other plugin.
This will ensure you that BP is fully working on a standart WP config.Mention
@mention use AJAX which can in some case, mostly with sophisticated themes or frameworks, lead to conflict. In that case, the culprit isn’t BP or WP, but the theme or a plugin whose code (generally) use a different standart as WP.
If you get issues with mention or messaging, activate wp_debug in wp-config and check your browser JS console to track down errors. The one or the other can give you precious debug information. You can also use a debug tool like Firebug.
June 4, 2016 at 7:30 pm #254137danbp
ParticipantGive this a try: (add to bp-custom.php) 1) & 2):
function bpfr_hide_tabs() { global $bp; if ( bp_is_user() && !is_super_admin() ) { bp_core_remove_nav_item( 'notifications' ); bp_core_remove_subnav_item( 'messages', 'compose' ); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );3) With BP and xprofile component activated, a user doesn’t need access to WP dashboard. He can change his profile credentials from front-end.
Easiest way would be to use this plugin.Retrieving them the possibility to change their email is anyway not a good idea. What happen when a user changed from yahoo to gmail, but can’t login because he lost his password ? Where will the new pwd be sent ?
Perhaps you have also to remove this from the BP usermenu on toolbar ?
Here’s how you can do it:function admin_bar_remove_this(){ global $wp_admin_bar; $wp_admin_bar->remove_node('my-account-messages-compose'); } add_action('wp_before_admin_bar_render','admin_bar_remove_this');June 3, 2016 at 12:02 am #254074In reply to: Registration and Edit Profile Issue
r-a-y
Keymasterthat worked!!
Glad to hear you’re up and running!
But should I now see 5 tabs of Field Groups that all say “Base (Primary)” when I go to Profile Fields under Users?
No, you shouldn’t.
You should leave the first “Base (Primary)” tab alone, but do delete the rest of them.
Do the same for the “Name (Primary)” field in the “Base” group. Keep the first one, but delete the rest.
Note that this is a new install. I’ve never used BuddyPress before
This does sound like a bug. It would be great to retrace your steps so we can duplicate this problem. Did you activate / deactivate / activate the plugin multiple times?
Same goes for the components list under “Settings > BuddyPress > Components” in the WP admin dashboard. Did you uncheck / check / submit certain components multiple times?
May 25, 2016 at 9:35 am #253746In reply to: BP menu on wp multisite
sharmavishal
Participantpity??? dont think so cause thats the way it works in the first place!!!!
you want the community/bp menu available on all the subsites and main site? and the user base would remain the same??
if yes then do this on a multisite network:
1. Add
define( 'BP_ENABLE_MULTIBLOG', true );in your wp-config.php file.2. install WP Multi Network and network activate it. DONT CREATE ANY NEW NETWORKS WITH THIS PLUGIN
3. install BP Multi Network and network activate it. There are no settings for this plugin.
now you would have community/bp menu avaiaible on all the subsites and main site. the userbase will be shared/common across all network
May 25, 2016 at 8:14 am #253744In reply to: BP menu on wp multisite
danbp
ParticipantSo the mainsite BP menu is not complete on subsite!
That’s right, because on a subsite, you’re on a blog.
BP is only active on the mainsite, as it’s where it is activated. On mainsite you see whole members fonctionnalities (friends, groups, messages and son on). On a blog, aka subsite, you’re like a user of a WP site whithout BP.That’s also the reason why enabling multiblog is deactivated by default and not usefull in most of case. This warning is given on the codex page i indicated you previously.
Deactivate multiblog and revert to initial default configuration.
On the toolbar, in top left corner, you have the usermenu with all BP items. This menu is accessible to logedin user, wherever he is. Mainsite or subsite. And that’s default behave !
For a bit more understanding, in case you want insist to remove that menu to get it on the main nav (beside About, Home etc), please take a look to this topic.
Cheers ! 😉
May 6, 2016 at 12:25 pm #253181In reply to: Buddypress mails get sent text-only
fidelleon
Participant“Solution” told here works fine but requires modifying core:
https://buddypress.org/support/topic/2-5-html-email-styling-not-working/
The BP Registration Options plugin forces in some way to send the emails using content_plaintext instead of content_html:
$must_use_wpmail = apply_filters( ‘bp_email_use_wp_mail’, $wp_html_emails || ! $is_default_wpmail );
It gets set to true so:
if ( $must_use_wpmail ) {
[…]
$email->get( ‘content_plaintext’, ‘replace-tokens’ )If you visit the “Manage Signups” and send an email to the user (reminding to activate their accout), the mail is 100% HTML w/o touching anything…
-
AuthorSearch Results
