Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'display user role on profile page'

Viewing 8 results - 76 through 83 (of 83 total)
  • Author
    Search Results
  • #82429
    Nahum
    Participant

    @r-a-y i have a tough time understanding it myself! just crazy tinkering I guess, there is probably a simple solution….

    I think you’re right about super admin.

    I’m talking more about other members, who have posted on other network blogs. If you look at my profile sidebar, you’ll see “my videos” and “my posts” links. Each should take you to the author template page for those members on the corresponding blogs.

    My Videos ==> site.com/author/ray
    My Posts ==> site2.com/author/ray

    get_blogs_of_user method works to display only the sites members have posted on sitewide – it will however show primary site of a member regardless of posts.

    get_blog_details method forces all member profiles to display the links regardless of having posts or not. It will just link to the author page with “no posts for this author’ message as part of the author.php template.

    the issue i’m having with get_blogs_of user, I have users who make one time posts by way of a frontend form. They own that post but they don’t have a role on the blog. I think that is the reason why on some users, the links don’t display even if they do have posts.

    both methods are useful depending on how you want to use them.

    i’d like to be able to use the get_blog_details method because it lets me define what links to display. and the issue i have with that is that the links are always present, I’d like for them to only show up if the user has posts.

    make less sense now! hehe, anyway it is a very specific feature, some people may like to do something like this.

    foodin65
    Participant

    First off, I’ve just installed Justin Tadock’s Members Plugin to get access to the Restrict Roles Template tags. What I’d like to do is make it so that specific components of my BP install are only available to certain roles.

    This is the code I’ve come up with so far:

    if ( bp_is_active( ‘profile’ | ‘activity’ | ‘messages’ | ‘friends’ | ‘groups’ | ‘settings’ ) && function_exists( ‘current_user_has_role’ ) && current_user_has_role( ‘subscriber’ | ‘moderator’ | ‘administrator’ ) ) {
    // the BP Component is “Profile, Activity, Messages, Friends, Groups, or Settings”, and the users role is “Subscriber, Moderator, or Administrator”

    display the component; // I don’t know what to put here so that the component is displayed if the user has the right role.
    }

    else {
    wp_redirect(get_option(‘siteurl’) . ‘/page-of-my-choice.php’);; // redirects user who don’t have the correct role to my page of my choice
    }

    Any Ideas on how to make this work?

    #57919
    designodyssey
    Participant

    I’m no guru, so I hope someone else comes along to help more. However, what Justin indicated in his post should work for BP just like WP. In fact the “role” is created in WP through Members Plugin anyway.

    I would play with echoing the member role name (assuming you’ve assigned one). Once that is echoed, you should be able to use a function based off the thread to assign a ‘$role’.’.png’ file for the icon. It shouldn’t matter that it’s the profile page unless there is a loop problem with that page.

    If you have an appropriate development environment, Justin will probably help you get the Members plugin to echo the role on a WP page , but he’s not a BP guru, so you may be back here for the second step.

    I needed certain BuddyPress members to have specific member levels, such as bronze, silver, and gold. To create these new user roles, I installed Justin Tadlock’s Members plugin: http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin

    How would I go about displaying the user role on each user’s public profile page, such as under their name (and above their status)? I’m more of an xhtml/css person rather than PHP, so I’m a bit lost. I’ve read the WordPress support topic for how to display certain icons based on user role, but it didn’t help much: http://wordpress.org/support/topic/313901

    It doesn’t seem like a super complicated thing, but I have yet to find any real documentation on it with BuddyPress. Any help would be greatly appreciated. Thanks!

    I needed certain BuddyPress members to have specific member levels, such as bronze, silver, and gold. To create these new user roles, I installed Justin Tadlock’s Members plugin: http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin

    How would I go about displaying the user role on each user’s public profile page, such as under their name (and above their status)? I’m more of an xhtml/css person rather than PHP, so I’m a bit lost. I’ve read the WordPress support topic for how to display certain icons based on user role, but it didn’t help much: http://wordpress.org/support/topic/313901

    It doesn’t seem like a super complicated thing, but I have yet to find any real documentation on it with BuddyPress. Any help would be greatly appreciated. Thanks!

    #55377
    buzz2050
    Participant

    Well, I would be happy to share the solution, but I don’t really think my way is all that elegant, there’s got to be a better way and I’m waiting for someone to suggest it to me.

    Meanwhile, I am still using the old 2-theme model. I made some customizations in my bpmember theme to achieve this and put in some code in plugins/bp-custom.php as well.

    Firstly, we have a custom profile field called ‘Role’. And we wanted to have separate Role-tabs (as you can see on our site) to list all members for THAT role.

    To achieve this, I completely changed the bpmember/directories/members/index.php code and put in my ‘Role’ tab-structure there. Then, instead of making the members index file call the members-loop, I wrote a modified version of the members-loop, made it as a function and put it in my bp-custom.php. Now I make a call to this function (which is basically the members-loop) from my bpmember/directories/members/index.php page.

    To give you an eg of how we display all companies under the Company tab:

    In my bpmember/directories/members/index.php, under the code section for ‘Company’ tab I make a call like:

    display_members_by_role(‘Company’);

    In my bp-custom.php, I have written a function display_members_by_role($role) which is nothing but a slightly modified version of the members-loop.

    Here, in the ‘while’ for members-loop, I check for the Role field for that user-id. For this eg, if the Role is ‘Company’, print that member in the company-listing, else not.

    This is the code I have put in the members-loop which checks the custom profile field (which is this case is ‘Role’) and it’s value for that user-id:

    ...
    ...
    <?php while ( bp_site_members() ) : bp_the_site_member(); ?>

    <?php
    global $site_members_template ;

    $arr = BP_XProfile_ProfileData::get_value_byfieldname(array('Role'), $site_members_template->member->id) ;

    if( $arr['Role'] == $role) //$role is the role value received by the function, in this eg - Company
    {
    //do whatever
    }
    <?php endwhile; ?>
    ....
    ....

    Same logic is used for all other roles.

    BTW, get_value_byfieldname() can return values for multiple fields too. In case you want to retrieve values of more than one profile fields, its easily possible. Say I want the ‘City’ custom field value too, then I would pass something like –

    $arr = BP_XProfile_ProfileData::get_value_byfieldname(array(‘Role’,’City’)

    and access the ‘City’ value using $arr[‘City’]

    This function is pretty handy.

    While I am able to print the members belonging to that corresponding role using this logic, what I can’t get into place is the pagination part. The pagination still takes into account ‘All’ members since the members-loop technically does retrieve all members.

    All I have done is put a condition in order to just get the members for that role displayed. I was wondering if I should put in a separate pagination module, or if there is any other way of achieving this whole thing.

    -Sib

    #6898
    Boris
    Participant

    Hey everybody,

    I did a quick search about group types and it looks like this hasn’t come up yet. I basically want there to be a few different types of groups, e.g. normal user groups like we have now and then a special type for organizations (or even more types for different kinds of organizations). Advantage would be that we then could filter for one group type and display the returned data on the homepage for example.

    Ideally I’d like to be able to give people the option to register as a normal user or as an organization. When an organization registers, they automatically get a group set up for them with some extra information to be filled out, like their adress.

    Does anybody know of any component that does this or something similar? No point in reinventing the wheel! I guess I could assign different roles to the various group types and then show extra group profile fields depending on the role. I’d imagine there are plenty of hooks provided for such a case (I’ll have to look into that…).

    Anyways, I’ll be glad for any pointers in the right direction!

    Cheers,

    Boris

    #49346

    In reply to: New Groupblog Plugin

    Mariusooms
    Participant

    Good idea r-a-y! It is summer vacation now, but I will definitely include some as our users start building their profile and groups with this plugin. These are some upcoming feautures:

    * Construct the group_id, this allows us to switch blogs in the group and pull in the relevant information. (done)

    * Construct the reverse blog_id, this allows us to have group based loops in the blog to display members, profile, activity etc based on the group id. (done)

    * Allow blog registration at group sign up, much like how you can create a blog at site registration.

    * Add members silently to the blog when they become group members.

    * Different role caps depending on role within the group. By default members are authors, mods are editors and admins are admins.

    * Allow the admin set role caps on group roles, e.g. the group admin only want its members to be subscribers. Or editors for a wiki type solution.

    * Have an option to disable silent adding of members in case the group admin only wants (or needs) the group blog be accessible by him (or her).

    * Create more templates. One we have now is a simple template that creates a menu from the page titles, which allows the group to behave like a cms.

    We will also offer some blog templates to help make the blog look transparent to the information you display within the group so its transition from group to blog nad vice versa is seemless.

    Thanks for your interests already.

Viewing 8 results - 76 through 83 (of 83 total)
Skip to toolbar