WordPress.org

Ready to get started?Download WordPress

Forums

amr users
Real time filtering in front end (10 posts)

  1. aliferis
    Member
    Posted 2 years ago #

    I have the latest version of amr-users and the user-plus addon that allows for some extra filtering of lists.

    I need to create 3 lists (no problem), then place them into 3 separate pages

    ie

    Buyers
    Sellers
    Media

    These types correspond to WP roles / levels I have setup

    I cannot see how to filter the list in real time in the front end - so I can create 3 lists, one for each role/level/capability

    Thanks a lot

    http://wordpress.org/extend/plugins/amr-users/

  2. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Joe,
    if have/want 3 lists and you have a wp_role that has the values you use to isolate the members.

    make sure you have first created a sample user with each role (else if there is no data in the user meta table, the plugin will not know about it)

    if using wp roles, then you should see fields like
    xx-capabilities-buyer appear in the field list (after "find fields")

    then for each list in the configure page
    1) put a column no (any number) in the display order for
    xx-capabilities-buyer, UPdate. in view mode will see column with a '1' in it - don;t worry we can undisplay the column later

    2) go back to configure - now the row will be available. in the
    xx-capabilities-buyer row, look to side - see the "include" field - enter a '1'. Update. Check only buyers showing on view.

    3) go back to configure - remove the display order for xx-capabilities-buyer. Update
    Row will still be available for configuration, but will not display.

    REPEAT for other lists with other roles.

  3. aliferis
    Member
    Posted 2 years ago #

    wow - thanks for getting back to me and explaining how to do this. I suspected there might be a way.

    It sounds complicated - but, hey that's life. As long as its possible, that all I need.

    I'll follow your guide and see how I get on.

    thanks

    joe

    ps - do you think there is scope to make this a feature via a shortcode parameter ?

    [userlist list="1" filter="wp_role" value="buyer"]

  4. aliferis
    Member
    Posted 2 years ago #

    something else I just thought of:

    if I have a few roles with similar names like:

    Buyer - 1 day at event
    Buyer - 2 days at event
    Buyer - 3 days at event

    Can I use your above explanation with a group of Roles (as a single list) ?

    So I could, for example, group all the Buyer roles into a single list

    thanks again

    joe

  5. aliferis
    Member
    Posted 2 years ago #

    Hi anmari

    I have followed your steps - but come across an issue.

    "If have/want 3 lists and you have a wp_role that has the values you use to isolate the members.

    make sure you have first created a sample user with each role (else if there is no data in the user meta table, the plugin will not know about it)"

    Done

    "if using wp roles, then you should see fields like
    xx-capabilities-buyer appear in the field list (after "find fields")"

    Yep

    "then for each list in the configure page
    1) put a column no (any number) in the display order for
    xx-capabilities-buyer, UPdate. in view mode will see column with a '1' in it - don;t worry we can undisplay the column later"

    Done (I gave them nice names first)

    "2) go back to configure - now the row will be available. in the
    xx-capabilities-buyer row, look to side - see the "include" field - enter a '1'. Update."

    Done

    "Check only buyers showing on view."

    No - all members still show in list (I rebuilt cache)

    "3) go back to configure - remove the display order for xx-capabilities-buyer. Update
    Row will still be available for configuration, but will not display."

    Not done this yet because of problem above

    REPEAT for other lists with other roles.

  6. aliferis
    Member
    Posted 2 years ago #

    Users: Details - sellers

    Including where: Seller1=1, Seller2=1
    Cache sorted by: Email
    All 6 Users processed.

  7. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    You're right - there is something wrong when using capabilities,
    However I'm not sure what you are doing with your 'sellers' above - the value you use to'include' must be the stored value (if '1' is the stored value, then okay)

    Working alternative:

    In my sites the "first role" field is working for the 'include'

    eg: I tested with "Contributor" in the include field and that worked for me (ie it returned the subscribers only).

    That is also nicer to use if using amr-users-plus as a filter (ge if all your lists have the same data)

    See http://test.icalevents.com/other-testing/user-list-demo/

    will look at why the capability method is not working, - in the interim the first role method should achieve the same objective.

    RE: shortcode parameters
    I hand't set it up to work like that at moment filtering is either in the config, or using amr-users-plus or viathe passed parameters in the query string
    See
    http://test.icalevents.com/other-testing/user-list-demo/?first_role=Contributor&filter=hide

    Note since wp allows for potential multiple roles in the db, the field to use is first_role not wp_role.
    The nice name and haedisng can be whatever you want.

  8. aliferis
    Member
    Posted 2 years ago #

    thanks

    I tried to combine two roles into a single list

    ie

    seller1 = 1
    seller2 = 1.1

    Joe

  9. aliferis
    Member
    Posted 2 years ago #

    Hello

    I dont understand this - I used 1, as you told me

    "the value you use to'include' must be the stored value (if '1' is the stored value, then okay)"

    and 1.1 for a second role I wanted to include in the lost

    "since wp allows for potential multiple roles in the db, the field to use is first_role not wp_role."

    Can I use these WP roles with S2member ?
    Can I use more than one role ?

    thanks

  10. aliferis
    Member
    Posted 2 years ago #

    I have managed to make this system work for a single role, by checking the 'exclude if blank' option for that row in configure list.

    This is great but would really like to combine two roles into one list.

    Cannot work out how to do this

    thanks

    joe

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags