Sort Users

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Coleen_Astalos
I'd prefer a search field at the Current Subscribers tab, but if it's easier to do it as a separate Search tab the way you did the People Search, that is fine too.
Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Coleen_Astalos
Please note that I have added to my list_subscribers macro to display both the Subscription Type and Frequency (INSTANT or DAILY_DIGEST).  So I'd like to show that information for the search results as well.
Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Pedro
Please, override your macro and create the subscription_user_row, just to make the code shorter.
<override_macro name="list_subscribers" requires="node">
    <n.if.is_submitted_form>
        <then.process_unsubscription/>
    </n.if.is_submitted_form>
    
    <n.put_in_head.>
        <style type="text/css">
            table.subscriptions {
            border-collapse:collapse;
            margin-top:1em;
            clear:both;
            width:100%
            }
            table.subscriptions th {
            padding: .3em .6em;
            text-align:left;
            border-bottom-style:solid;
            border-bottom-width:2px;
            }
            table.subscriptions td {
            padding: .5em;
            }
        </style>
    </n.put_in_head.>
    
    <n.zebra_table_javascript table_selector="table.subscriptions"/>
    
    <form method="post" action=""  class=''>        
        <div>
            <b>Name:</b> <input type='text' maxlength='30'  name="name" /><input class="sub_but"  type="submit" value="Search" />
        </div>       
    </form>
    <br/>
    
    <n.subscribers_pagination/>
    
    <div class="weak-color" style="float:left;margin:.5em 0">
        <n.one_or_many.page_node.subscription_count>
            <one_text><t>subscriber</t></one_text>
            <many_text><t>subscribers</t></many_text>
        </n.one_or_many.page_node.subscription_count>
    </div>
    
    <n.subscriptions. start="[n.subscriber_page_index_record/]" length="[n.subscriber_page_length/]">
        <n.if.has_more_elements>
            <then>
                <table class="subscriptions">
                    <tr class="shaded-bg-color">
                        <th class="medium-border-color"></th>
                        <th class="medium-border-color"><t>Name</t></th>
                        <th class="medium-border-color"><t>Email</t></th>
                        <th class="medium-border-color"><t>Subscription Type</t></th>
                        <th class="medium-border-color"><t>Frequency</t></th>
                        <th class="medium-border-color"></th>
                    </tr>             
                    
                    <n.if.is_submitted_form>        
                        <then>
                            <n.loop.>
                                <n.if.contains_substring string="[n.to_lower_case.subscription.user.name/]+[n.to_lower_case.subscription.user.user_email/]" substring="[n.to_lower_case.searchName/]">
                                    <then>
                                        <n.subscription_user_row/>
                                    </then>
                                </n.if.contains_substring>
                            </n.loop.>
                        </then>
                        <else>
                            <n.loop.>
                                <n.subscription_user_row/>
                            </n.loop.>
                        </else>
                    </n.if.is_submitted_form>                  
                    
                </table>
            </then>
        </n.if.has_more_elements>
    </n.subscriptions.>   
    <n.subscribers_pagination/>
</override_macro>

<macro name="subscription_user_row">
    <tr>
        <td style="width:30px;padding:0"><n.subscription.user.avatar/></td>
        <td class="nowrap"><n.subscription.user.user_link/></td>
        <td class="nowrap"><n.subscription.user.user_email/></td>
        <td class="nowrap"><n.subscription.type_label/></td>
        <td class="nowrap"><n.subscription.type/></td>
        <td class="nowrap"><n.subscription.unsubscribe_button/></td>
    </tr>
</macro>
Save your original code somewhere else and test it. If you see anything wrong reverse the changes.
My test forum.
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Harvey
In reply to this post by Pedro
Being able to search users would be helpful for me too.

Here's what happens overnight - it's pretty common.

A new member joins at 4am.  That's the first sign of a spammer.  I now have a way to measure forum joiners as a GOAL in Google Analytics.  I check the "conversion" and it came from China.  Looks spammy.

I check the email address and it's registered as a spammer in Stop Forum Spam.

I have well over a hundred, maybe 200 members who have 0 posts.  I have to work my way through the pages to find the user to ban him. It may be hard to believe but often I have to go through these pages more than once to find the right person.  I just miss them somehow.

What I do instead is I have created a subgroup called spammers and I add them to that group. It's a short list, I find them and ban them from there.  

Being able to search the main list would save me some steps.
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Pedro
Please, try to use this code:
<override_macro name="people_tabbed_pane">
    <div style="margin:.5em 0">
        <n.horizontal_tab_control.>
            <n.add_horizontal_tab
            url="[n.page_node.people_path/]"
            text="[t]Users & Groups[/t]"
            selected="[n.is_people_default/]"
            details="[n.visible_users_table.people_columns/]"
            />
            <n.add_horizontal_tab
            url="[n.page_node.people_path filter='online-users'/]"
            text="[t]Online Users[/t]"
            selected="[n.is_online_users/]"
            details="[n.online_users_table.people_columns/]"
            />
            <n.add_horizontal_tab
            url="[n.page_node.people_path filter='list'/]"
            text="[t]Search[/t]"
            selected="[n.is_people_filter value='list'/]"
            details="[n.page_node.people_search_list.people_columns/]"
            />
        </n.horizontal_tab_control.>
    </div>
</override_macro>


<macro name='is_people_search'>
    <n.is_people_filter value='list' />
</macro>

<macro name='is_people_default'>
    <n.both condition1="[n.not.is_online_users/]" condition2="[n.not.is_people_search/]"/>
</macro>

<macro name="people_search_list" requires="node" dot_parameter="columns">  
    <n.put_in_head.>
        <style type="text/css">           
        </style>
    </n.put_in_head.>
    
    <n.zebra_table_javascript table_selector="table.subscriptions"/>
    
    <form method="post" action=""  class=''>        
        <div>
            <b>Name:</b> <input type='text' maxlength='30'  name="name" /><input class="sub_but"  type="submit" value="Search" />
        </div>       
    </form>
    <br/>
    <n.if.is_submitted_form>        
        <then>
            <n.searched_users_list.>
                <n.people_table.>
                    <n.columns/>
                </n.people_table.>
            </n.searched_users_list.>
        </then>
    </n.if.is_submitted_form>    
</macro>

<macro name="searched_users_list" dot_parameter="do" requires="node_page">   
    <n.site_users. start="0" length="999">
        <n.filter_by.contains_substring string="[n.to_lower_case.current_user.name/]+[n.to_lower_case.current_user.user_email/]" substring="[n.to_lower_case.searchName/]"/>
        <n.do/>
    </n.site_users.>
</macro>

<macro name='searchName'>    
    <n.get_parameter name='name' />
</macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Coleen_Astalos
In reply to this post by Pedro
Thanks.  Works great!
Coleen
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Coleen_Astalos
Now that I've got a lot of users in my system and they're starting to subscribe, I'm seeing a problem with the search for subscribers.  It only seems to search the page that is currently displayed.

For example one user dfoor is subscribed to the main SUDSOL section.  When I bring up the manage subscribers for that section and select search for "dfoor" it doesn't show any results.  If I scroll to page 2 and repeat the search - still no results.  But when I scroll to page 3 where she is listed and search, then she shows.

Coleen
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Pedro
I can't do it now because this part of code is not in Naml.
But you can show everybody at the same page, so that, the search will work.
At the macro list_subscribers, replace this line:
<n.subscriptions. start="[n.subscriber_page_index_record/]" length="[n.subscriber_page_length/]">
  with:
<n.subscriptions. start="[n.subscriber_page_index_record/]" length="[n.page_node.subscription_count/]">
and delete the pagination links: "n.subscribers_pagination"
My test forum.
Reply | Threaded
Open this post in threaded view
|

RE: Search Users

Coleen_Astalos
Perfect!  That works for me as I don't really care how long the page is and would prefer to see all subscribers at once.
Coleen
12