WordPress.org

Forums

Mass Messaging in Buddypress
Is there a Way to Change the User Sort Order (2 posts)

  1. nobodymove
    Member
    Posted 1 year ago #

    Hello, is there a way to sort the user and group list order? My user and group lists just show up in descending order, oldest import is first, newest last. Is there a way to sort it by first or last name? Alphabetically or by ID for groups?

    http://wordpress.org/plugins/mass-messaging-in-buddypress/

  2. LordKhaoz
    Member
    Posted 1 year ago #

    Yes there is. You have to do the following code changes in the mass-messaging.php file.

    Sort Groups -
    Replace line 405 $groupsAll = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} WHERE status = 'public'",null ) );

    with the following:

    Sort by group name: $groupsAll = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} WHERE status = 'public' order by name",null ) );

    Sort by group id: $groupsAll = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} WHERE status = 'public' order by id",null ) );

    Sort Users -
    Replace line 445 $membersAll = $wpdb->get_results( $wpdb->prepare( "SELECT * from $wpdb->users",null ) );

    with the following:

    Sort by username: $membersAll = $wpdb->get_results( $wpdb->prepare( "SELECT * from $wpdb->users order by user_login",null ) );

    Sort by display name: $membersAll = $wpdb->get_results( $wpdb->prepare( "SELECT * from $wpdb->users order by display_name",null ) );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Mass Messaging in Buddypress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic