Search by Custom Field [Deleted]

Ah of course, thx MOZ & Akinak, tis now working! (and yes MOZ, I had read your technical section of your add-on, yours has been working nicely since I installed).
Akinak, are there any templates I need to edit apart from 'member_list_sort'?
And am I right in assuming that the 'Any Custom Field' is just a placeholder, and we should edit the code to remove that and/or change it to search for other things?
Some friendly feedback/suggestions for next version:
* Keep the field labels consistent, e.g. Name has '...' after it, Location does not
* When performing a search, the results return in a list on the left, but if there's more than fit on the page, as soon as you hit the 'Next' button to go to the next page of members, it ignores the custom search and just displays members based on the sort criteria (perhaps this is specific to people using the 'Member List Manager'?
* It would be useful to have some kind of heading/display showing what the search criteria was, above the list of returned members

Great work though Akinak, very useful add-on!
 
  • Like
Reactions: DRE
Quick PS to the above, re the wildcards, it would seem that the 'Name' field allows partial searches, e.g. searching for 'Fris' returns my account (ALFrisbee), which is awesome!, however the Location field doesn't seem to allow partial searches, e.g. If I search for 'bris' it gives nothing, but 'brisbane' gives a bunch of results.
Can this be changed to allow partial searching and/or wildcards?
 
  • Like
Reactions: DRE
Have installed the latest update, however it still says 1.2, instead of 1.3, in the 'Installed Addons' list (just FYI).
Nice update though Akinak! I love the enhancement to the Location search, where you now only need to enter a partial name for the city and it finds all members that have Locations containing the partial word! Nice work!
 
Sorry for my English.

You may be using some supplements that affect the members list.
Name them and I'll check compatibility.

I have member list manager installed, when I disable this addon I your find member box in the side bar but dont get advanced search link at the top
 
I have member list manager installed, when I disable this addon I your find member box in the side bar but dont get advanced search link at the top
topcat, have a peek at the previous page, the answer is there.
Here's a paste for you:
you have to make changes to member_list_sort instead of member_list. Similarly to member_list_item_sort instead of member_list_item.
Essentially the reason is because you're using the 'Member List Manager' (as am I) and so it uses a different template. The changes in the code that you need to make (manually, not with TMS) are mentioned on the previous page.
 
Sorry for my English.

You may be using some supplements that affect the members list.
Name them and I'll check compatibility.
Hi Akinak, there is a lot of potential for this modification but it isn't quite there just yet. Before I go on, do you plan on working on this further? What do you have planned?
 
ok I now no longer have the member list manager installed and I get the serh options for this mod in the sidebar.

But when doing a search I get the following

A controller for the route path /members/list was not found.

any ideas?
 
Find
Code:
        <form action="{xen:link members}" method="post" class="secondaryContent findMember">
            <h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase find_member}</a></h3>
     
            <input type="search" name="username" placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete" data-autoSubmit="true" />
            <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
        </form>
in template member_list_sort and replace
Code:
        <form action="{xen:link members/list}" method="post" class="secondaryContent findMember">
                        <h3><a href="{xen:link /members/search}" title="{xen:phrase find_member}">{xen:phrase find_member}</a></h3>
     
            <input type="search" name="username" placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete" data-autoSubmit="true" />
<input type="search" name="location" placeholder="{xen:phrase location}" results="0" class="textCtrl">
<input type="search" name="any_custom_field" placeholder="{xen:phrase any_custom_field}" results="0" class="textCtrl">
<br><input type="submit" value="{xen:phrase search}" accesskey="s" class="button primary" />
            <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
        </form>

MOZ ahead of me, he's absolutely right.
I am using TMS and I'm getting the sidebar search, but not getting the "Advanced Member Search" link under the Members link in the menu. Any ideas?

EDIT: Also, more importantly, when I access the members/search/ page, there is only text boxes displayed. Check boxes, radio boxes or any other fields other than text boxes are not compatible with this addon.

The code that I am looking at is as follows:

Code:
<xen:foreach loop="{$customFields}" value="{$customFieldName}">
    <dl class="ctrlUnit">
        <dt><label for="ctrl_keywords">{$customFieldName.field_id}:</label></dt>
        <dd>
            <ul>
                <li><input type="textbox" name={$customFieldName.field_id} value="" /></li>
            </ul>
        </dd>
    </dl>
</xen:foreach>

As you can see, it is just a loop that displays ALL custom fields. I want to not only be able to select only certain fields, but also be able to display the correct field type, such as radio or check box options.

You can see from the code below that the input type is forced as a text box for all custom user fields:

Code:
<input type="textbox" name={$customFieldName.field_id} value="" />

1. Can you please tell me how to add a radio or check box instead of a text box?
2. Can you please tell me how to select only certain fields to display?
 
I got it to work BUT only because I disabled Members List Manager.

This addon clashes with the Members List Manager. It won't work when they are both enabled.

So I basically need to decide on which addon to keep, which one I should uninstall.

Edit: Alright I decided to uninstall Members List Manager since it lacks Location search and doesn't allow you to add custom user field items to be sorted with.
 
ok I now no longer have the member list manager installed and I get the serh options for this mod in the sidebar.

But when doing a search I get the following

A controller for the route path /members/list was not found.

any ideas?

Any idea how to fix this please
 
The latest version of it which is 2.0 still doesn't allow Search by Custom User Field 1.3 to show.
The 2.0 version does allow you to sort by any custom field however ... have you had a crack at adding in your own sort entries? As long as you know the table & column names for the data you want to sort, you can sort on anything.

Personally, I only wanted the 'Search by custom field' to get access to the 'Location' data, and I tweaked the code a little so that the 'Find Member' bit on the right looks like this:

Image 020.webp

The enhancement Akinak made to also allow for partial searching (e.g. searching for members from location 'Bris' finding 'Brisbane' & 'Brissy' & 'Bris, Qld' etc) was an excellent feature, so I've found that useful also.

When I click the heading Find Member, I still get the field widths all wonky, but I'm not worried enough about it, or more accurately, don't think enough of my members would even know to do that, to bother trying to fix the code, so looks like this:

Image 021.webp
 
Top Bottom