• Is there an easy way to build a page that lists all members of a certain group? and of all available groups?
    I would like to apply this in the following way:

    -situation: We have authors who are selected on a ‘per year’ base; we would like to list authorprofiles of 2011/2012/2013 . I have created groups and put the authors in a group according to the year. Now i’d like to make a template which has author profiles and then in the sidebar provide the selection 2011/2012/2013/…

    https://www.ads-software.com/extend/plugins/user-groups/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Zack Katz

    (@katzwebdesign)

    Yeah, that’s where you go to the User Groups Page: (Users > User Groups).

    To view users in a group, click on the link on the User Groups page that says “# Users”. The link ends up going to a page like: /wp-admin/users.php?user-group=my-custom-group

    Is that your question?

    thanks for the plugin. Is there a way to view the list through the front end for unregistered users or subscribers?

    Hello there,

    First of all, many thanks for this nice plugin, I could split my users between a few groups.

    What I would like is to see on the front-end is the group to which a user belongs to (maybe next to the username’s poster in a post?). Would it be possible to add this feature in a next version of the plugin?

    Many thanks again for the plugin, it’s working as a charm ??
    Xavier

    Hi Zack,

    First and foremost, thanks for making this plugin. I’m fairly new at the WordPress game and have a request similar to those above – I am trying to list users of a certain group on a page visible to anyone through the front end, along with profile picture, website, and a couple of extra fields I have added using Cimy Extra Fields.

    Quite simply, how would I go about sorting and displaying my users by group? Any advice you have is greatly appreciated!

    (A little background: I am in the process of migrating a very out-of-date Joomla page to WordPress (centralcoastgrown.net/site/). I need to be able to have farmers and retail stores create profiles, be added to a group, and have their bios, location, and website displayed on a publicly viewable list page (https://centralcoastgrown.net/site/index.php?option=com_comprofiler&task=usersList&listid=2) – that is just a basic user list, but I want to be able to sort by group as well as show profile basics on the list)

    Cheers,

    Tom

    Plugin Author Zack Katz

    (@katzwebdesign)

    Tom, you click on the group label to see the users in the specific groups.

    I’ve put together a shortcode function that will allow you to show the users of a particular user-group on the front end:

    add_shortcode('group-list', 'my_group_list_shortcode');
    function my_group_list_shortcode( $atts ) {
        // Get the global $wpdb object
        global $wpdb;
    
        // Extract the parameters and set the default
        extract ( shortcode_atts( array(
            'group' => 'No Group' // No Group is a defined user-group
            ), $atts ) );
    
        // The taxonomy name will be used to get the objects assigned to that group
        $taxonomy = 'user-group';
    
        // Use a dBase query to get the ID of the user group
        $userGroupID = $wpdb->get_var(
                        $wpdb->prepare("SELECT term_id
                            FROM {$wpdb->terms} t
                            WHERE t.name = %s", $group));
    
        // Now grab the object IDs (aka user IDs) associated with the user-group
        $userIDs = get_objects_in_term($userGroupID, $taxonomy);
    
        // Check if any user IDs were returned; if so, display!
        // If not, notify visitor none were found.
        if ($userIDs) {
            $content = "<div class='group-list'> <ul>";
            foreach( $userIDs as $userID ) {
                $user = get_user_by('id', $userID);
                $content .= "<li>";
                $content .= get_avatar( $user->ID, 70 );
                $content .= "<h3>" . $user->display_name . "</h3>";
                $content .= "<p><a href='". get_author_posts_url( $user->ID ) . "' class='more-info-icon'>More info</a>";
                $content .= "<!-- add more here --></p>";
                $content .= "</li>";
            }
            $content .= "</ul></div>";
        } else {
            $content =
            "<div class='group-list group-list-none'>Returned no results</div>";
    
        }
        return $content;
    }

    The shortcode then looks like this: [group-list group="NameOfGroup"].

    Feel free to use and modify.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: User Groups] List Group members’ is closed to new replies.