Replies
Dear Brajesh!
Last night I was successfull and got my “conditional advanced search” up and running 🙂
Its not pure static anymore 😀
But its still not as dynamic as i want 🙁
(But Im still a learning noob, so thats ok for me)what does that mean:
I modified the form template and injected some css and js.
So the form is generated dymanically (with my extra divs classes)
BUT the conditions are hardcoded. (machting my ids,values, names and classes)
Since I don’t know anything about creating an own plug-in (yet),
its hard for me to think, how the communication between admin-ui and code is done.Thats also the reason, why I couldn’t just use the conditions created with your plug-in.
So I “recreated” all conditions – I know, im such a nap – sorry.I need to figuere out some more things, like replacing hardcoded texts with change-able variables.
example:var yzposition = $('#bps_directory14 input:radio[name=field_29]');
bps_directory14 and field_29 only works for my specific case of course.
I know that there must be far more efficient ways solving this problem, but never the less, this way I learn a lot of stuff about wordpress/buddypress, and perhaps some day I could also create such amazing things like you do every day 🙂
If you want to take a look at my current state, You can gladly have access to my computer via teamviewer. (since its a local development)
Cheers
BladeP.S.: Any chance I could apply your awesome dropdown2radio hack of membertype for the profile search?
It was already astonishing, seeing that it also applied on the admin backend and not “only” for the registration front end <3Master Brajesh <3
Thank you soo much. Your support is as always outstanding!!!
Off-topic:
Right now I’m working on a conditional front for “BP Profile Search”.
(using a static search form for the beginning)
If I achieve this dynamically, I would gladly share it with you.
(Perhaps you [or someone else] could use it)Your
BladeYou give us so much l0ve and I just wanted to give some back 🙂
Do you know how to trigger this redirect at click on “edit profile”?
I found a perfect solution ( of course from you, from whom else ):
<?php global $bp; if(bp_get_current_profile_group_id()==1) bp_core_redirect($bp->displayed_user->domain."profile/edit/group/2"); ?>
Sadly its 5 years old, and implementing this gives me following error:
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-includes\class.wp-styles.php:172 in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 1228
I checked everything, there is no newline or space 🙁
Somehow I cant call a redirect at that time.Afterwords:
Using my code might be less characters, but i’m using your code, because having the proper $user_id is much better for modifications.
Here are my modifications to your solution to also differentiate between member-types and redirecting to the “detailed” edit profile page. (not the general)
Perhaps someone find this useful:function redirect_to_edit_profile( $profile_url, $user_id ) { if( bp_get_member_type($user_id) == 'your-member-type-1' ) { return $profile_url .'profile/edit/group/2/'; } else if( bp_get_member_type($user_id) == 'your-member-type-2' ) { return $profile_url .'profile/edit/group/5/'; } }
You have to change:
– “your-member-type-1” & “your-member-type-2” to match your membertype-names
– group-number to redirect to [varies with the amount of field-groups you created per member-type]Cheers
Blade- This reply was modified 8 years, 9 months ago by blade.
Hey my master!
I just solved it via trial&error like a stupid xDadd_filter('bpdev_autoactivate_redirect_url','redirect_to_edit_profile'); function redirect_to_edit_profile($user_id){ return $user_id.'profile/edit/'; }
I found out (at least think i did) that $user_id at this specific hook time is already the full url,
thats why bp_core_get_user_domain($user_id) can’t find the “user_id”, thus returning the url without the name.
I dont know if it makes any sense, but that was my noob-logic (and i’m a very beginner in wordpress)Never the less I will test your solution asap, and report back to you.
Million thanks for being like you are Brajesh!!!
GratefullyBlade
oh, cant edit OP. Doublepost for format – sorry all:
Dear Brajesh,
Im using your old but very awesome plugin:
BP Autologin on Activation1) Still works perfectly! Thank you very much!
2) I tried adding your code from the comment to redirect to /profile/edit (functions.php):
add_fllter(‘bpdev_autoactivate_redirect_url’,’redirect_to_edit_profile’); function redirect_to_edit_profile($user_id){ return bp_core_get_user_domain($user_id ).”profile/edit/”; }
But $user_id seems to empty at this time.
I also tried following code:add_fllter(‘bpdev_autoactivate_redirect_url’,’redirect_to_edit_profile’); function redirect_to_edit_profile($user_id){ return get_option( ‘home’ ) . ‘/members/’ . bp_core_get_username( $user_id ) . ‘/profile/edit/’; }
same results.
3) My goal: redirect on activation dependant on the member-type.
I wrote the following script for a redirect plugin, which i would like to replace with yours:$member_type = bp_get_member_type($user->ID); if( $member_type == ‘Student’ || $member_type == ‘student’ ) { $redirect_url = ‘/wordpress/members/’.$user->user_login.’/profile/edit/group/6/#edit-personal-li’; } else if( $member_type == ‘Teacher’ || $member_type == ‘techer’ ) { $redirect_url = ‘/wordpress/members/’.$user->user_login.’/profile/edit/group/5/#edit-personal-li’; } else { $redirect_url = ‘/wordpress/members/’.$user->user_login.’/profile/’; }
Perhaps this snippet could be useful to someone 🙂
Gratefully
BladeDear Brajesh!
You are absolutely right! EVERYTHING WORKS PERFECT!!!
At this point I wanted to also thank you for your “username availability checker”.
Together with some snippets I got a nice multi-step-registration without any extra plugins:
I styled a little bit and made the “available” message an icon.
(i know it still looks noobish, but im not a designer and still a beginner in wordpress)
Here are my pics for you. (i would send you signup3.png – but in privat 😉 )Just your plug-ins, css-js-toolbox and my own childtheme:
P.S.:Here is signup3.png – password via PM 😉