Search Results for 'buddypress'
-
AuthorSearch Results
-
January 25, 2015 at 1:47 am #232906
In reply to: How To bp_set_member_type?
Henry Wright
ModeratorIf you look at my snippet here, you will see that I’ve hooked the
my_set_default_member_type()function tobp_core_signup_user. Now,bp_core_signup_userfires each time a new user registers on your website. This means thatbp_set_member_type( $user_id, 'student' )executes each time a new user registers on your site.Then if you look here, you’ll see I’ve hooked my
youmin_set_role()function to thebp_set_member_typehook (note that thebp_set_member_typehook and thebp_set_member_type()function are different things). This means that when thebp_set_member_typehook fires, the code insideyoumin_set_role()will execute.So as you can see, you have to use both snippets together, exactly as I’ve written them, in order for things to work.
January 25, 2015 at 12:45 am #232901In reply to: How To bp_set_member_type?
Henry Wright
ModeratorHi @youmin
If you don’t already have your roles set-up then this is how you’d add them:
add_role( 'student', __( 'Student' ), array( 'read' => true, // true allows this capability 'edit_posts' => true, 'delete_posts' => false, // Use false to explicitly deny ) );The 3rd parameter is where you’d put your capabilities. In my example above, I’ve created a ‘student’ role which can read and edit posts but can’t delete posts. Feel free to amend these capabilities.
Ref: https://codex.wordpress.org/Function_Reference/add_role
Then to pick up on Boone’s suggestion in the Trac ticket, you could do this:
function youmin_set_role( $user_id, $member_type, $append ) { $userdata = array( 'ID' => $user_id, 'role' => $member_type ); wp_update_user( $userdata ); } add_action( 'bp_set_member_type', 'youmin_set_role', 10, 3 );When you use the
bp_set_member_type()function like I have done here, this code will assign a role to the user who is signing up. The role that is assigned will be the type you use inbp_set_member_type().Hope this helps you.
January 25, 2015 at 12:31 am #232900In reply to: How to assign a WP user role based on a registration
youmin
ParticipantHey guys dev Henry Wright had replied to this topic but its not showing here strange!!
https://buddypress.org/members/henrywrightBut you can see his solution in his profile link provided above, he rectified error
January 25, 2015 at 12:17 am #232899In reply to: How to assign a WP user role based on a registration
youmin
ParticipantThank you mcpeanut for you research and work, I am glad to see details of your work since I am struck at this point I am willing to impliment it soon. Plz make a time to explain in details.
BTW have you seen the ticket I had raised ? I am curious about that ticket just because of the new introduced api
member_typeand the person who reviewed ticket is respectable Chief Dev of buddypress, as per his comment its take 6 lines of codes, to tie WP roles with member_type code. So it means Two solutions at one shot.Thank you again.
January 24, 2015 at 10:38 pm #232897In reply to: How to assign a WP user role based on a registration
mcpeanut
ParticipantHey @youmin and @spiritix i hear you both on this matter, after much testing myself on how to do this i have realized the best way to do this is via a few other plugins.
firstly i would recommend using a membership plugin and a plugin to create your own registration forms as well as a roles capability management plugin, you can then overide the buddypress registration process (but you will lose the ability of integrating the custom fields you create for the buddypress registration unless you tie them into your own registration forms)
but the way i got around this myself without the problem of having to tie them with my registration forms was to add a buddypress profile progression plugin so once they have registered they will see a notice in the header showing the percentage of the profile they have completed encouraging them to fill the fields in “you could even integrate it with an awards system the more they fill in” its up to you. (to me this works perfectly fine as i can still add as many buddypress fields as an when i want and have a simple registration process to boot).if you mess around with this idea you will see that assigning a user to a specific role does infact work with the right combo of plugins and effort, i know this seems a long haul work around but the way i have set it up works fine for me. i may go into more detail for you guys when i have more time and explain exactly how mine works. plus this way if you do decide to implement some kind of pay per view membership for higher levels in the future your ready to go!
January 24, 2015 at 9:05 pm #232892shanebp
ModeratorPlease do not double post. Duplicate here.
January 24, 2015 at 8:48 pm #232891youmin
ParticipantTry editing buddypress/activity/home.php , after copying these files from buddypress plugin to your theme. If you have already copied files from plugin then search the files from activity folder and edit it from there.
January 24, 2015 at 7:58 pm #232889In reply to: How to assign a WP user role based on a registration
youmin
ParticipantSee this ticket.
https://buddypress.trac.wordpress.org/ticket/6154#ticket
Since buddypress 2.2 released we can tightly integrate user roles based on their profile selected. As well their is a hook . if you know php you can create a snippet so that others can get benefits along with you.
I think same above codes with a little modifications we can hook it tobp_set_members_typeat line 2576.January 24, 2015 at 7:05 pm #232885In reply to: How to assign a WP user role based on a registration
January 24, 2015 at 5:09 pm #232883shanebp
ModeratorRefer to the usage in this file:
\buddypress\bp-templates\bp-legacy\buddypress\members\index.phpOr review
function bp_directory_members_search_form()in this file and maybe write your own:
\buddypress\bp-members\bp-members-template.phpJanuary 24, 2015 at 1:17 pm #232881In reply to: Custom verification for profile fields
mahdiar
ParticipantThanks but I mean I use this code for CF7 plugin successfully . I’d like to use it for buddypress . Is it related to wordpress ?
January 24, 2015 at 12:39 pm #232880In reply to: How to Show bbPress User Role on BP Profile Page?
Stagger Lee
Participantadd_action( 'bp_before_member_header_meta', 'devb_show_role_on_profile'); function devb_show_role_on_profile(){ global $wp_roles; $user_id = bp_displayed_user_id(); $user = get_userdata( $user_id ); $roles = $user->roles; if( !$roles) return ; if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles(); $named_roles = array(); foreach( $roles as $role ){ $named_roles [] = $wp_roles->role_names[$role]; } if( $named_roles ) echo '<span class="user-role activity">'. join( ', ', $named_roles ) . '</span>'; }January 24, 2015 at 11:38 am #232878In reply to: Custom verification for profile fields
danbp
ParticipantThat’s not a BuddyPress related question. BP provides already a few checks over xprofile fields, but not strict security checking.
As you use contact form 7 plugin to build your fields, you have to check this plugin documentation to achieve this.January 24, 2015 at 11:34 am #232877In reply to: How do i harmonizing to my wordpress theme?
danbp
ParticipantBP works on almost any WP theme, under one condition. the theme should respect the WP rules for themes.
From this codex page you’ll able to find all documentation around BP themes.
January 23, 2015 at 9:09 pm #232853In reply to: must refresh the page after login
Yann Spect-Acteur
ParticipantI’ve just install wordpress, then buddypress.
So same issue.spect-acteur.eu
id : test
pass : testJanuary 23, 2015 at 7:11 pm #232842kashmiri
ParticipantBug report filed here:
https://buddypress.trac.wordpress.org/ticket/6160
This has also been pointed out a few years back but issue seems stalled:
January 23, 2015 at 7:04 pm #232841In reply to: How to Show bbPress User Role on BP Profile Page?
shanebp
ModeratorThis works properly on my test install, put in bp-custom.php
function laddi_show_user_role () { $abc_role = bbp_get_user_display_role( bp_displayed_user_id() ); echo '<br/><span class="profile-role ' . $abc_role . '"><i class="fa fa-star"></i><em>'; echo $abc_role; echo '</em></span>'; } add_action( 'bp_before_member_header_meta', 'laddi_show_user_role' );January 23, 2015 at 2:11 pm #232831In reply to: My horizontal form don't work in "members" page
patlol
ParticipantHello danbp,
Which plugin do you use for your custom search form ?
Is your plugin! Isn’t a custom form is the horizontal form proposed in sweetdate->buddypress menu (see first attached file in first message)
I try disabled all plugin except sweetdate and budypress (if not the “members” and horizontal form no longer exists):
the first fiels of horizontal form “name” is ok
the 2 next fields are not okSo there are two problems:
1/ the “name” field does not work due to WordPress SEO plugin, I deleted it. why? I don’t know!
2/ The others fields are extended fields, fields created by me, “Départements” and “Domaine d’activité” does not even work by removing all plugins except sweetdate and buddypress (if not the “memebers” and horizontal form no longer exists)It is for the second case I would need your help
Thanks
Where i create the 2 extended fields
January 23, 2015 at 12:52 pm #232829In reply to: I am lost lol I need your help
youmin
ParticipantIs it buddypress related question or BBPRESS related one ? Be clear in the question.
January 23, 2015 at 11:48 am #232827In reply to: How To bp_set_member_type?
youmin
ParticipantWill you kindly provide me the snippet based on this ticket, as you directed I had raised this ticket and I am happy that their is a solution.
https://buddypress.trac.wordpress.org/ticket/6154#ticket”
Thank you once again.
January 23, 2015 at 11:14 am #232824In reply to: Link to members /members/member-name
youmin
ParticipantSo I think its a bbpress related widget,
Try this one, when you install buddypress you need to set the permalink, try changing this options in settings of buddypress or in bbpress.
January 23, 2015 at 8:20 am #232818In reply to: Pagination no-ajax bug
ripulkr
ParticipantFor now, I have implemented this fix :
add_filter('bp_get_messages_pagination','correct_buddypress_pagination'); add_filter('bp_get_members_pagination_links','correct_buddypress_pagination'); add_filter('bp_course_get_item_pagination','correct_buddypress_pagination'); function correct_buddypress_pagination($pagination){ global $items_template; if($_GET['items_page'] || $_GET['mlpage'] || $_GET['mpage']){ preg_match_all('/.+(mlpage|items_page|mpage).([1-9]+).+([1-9]+).+/',$pagination, $matches); if(isset($matches[2]) && isset($matches[3])){ if(is_array($matches[2]) && count($matches[2])){ foreach($matches[2] as $k=>$match){ if($match != $matches[3][$k]){ $search =$matches[1][$k]."=".$match."'>".$matches[3][$k]; $replace=$matches[1][$k]."=".$matches[3][$k]."'>".$matches[3][$k]; $pagination = str_replace($search,$replace,$pagination); } } } } } return $pagination; }I guess it should not have any impact when BuddyPress 2.2 update is released.
January 23, 2015 at 8:15 am #232817In reply to: Link to members /members/member-name
mvaneijgen
Participant@Ahir Hermant that is not really my question.
There are users on the forum, so when I click on there name (lets say user ‘Youmin) I want the site to link to the users page (and that would be this URL /members/Youmin) this works without BuddyPress, but when I have BuddyPress installed all users name get the link /members (and this is just a page with a list of all users.
So there is no way to get to a users page.
January 23, 2015 at 5:28 am #232816In reply to: Link to members /members/member-name
Ahir Hemant
Participanti have used bbpress and buddypress, there is one widget like Forum Statistics, it will display like total member count, total topic, total forum like that, there is no link i mean total forum 120 then when i click on 120 it will redirect to forum list page. have you got my question now ?
Thank you
January 22, 2015 at 11:26 pm #232806r-a-y
KeymasterI’ve taken a look at the ticket and have proposed a fix that may not make it to BuddyPress 2.2, but you can patch temporarily:
https://buddypress.trac.wordpress.org/attachment/ticket/6153/6153.01.patchThank the Atahualpa dev for posting a detailed bug report!
-
AuthorSearch Results
