User Profiles - Data browser - Filter by email domain

musicianband
@musicianband
8 years ago
45 posts
Hi! I am looking for a solution to display in User Profiles - Data browser only those profiles which have used a specific email domain name for registration. Please help!
updated by @musicianband: 04/21/16 03:41:55PM
paul
@paul
8 years ago
4,330 posts
The problem with this is that emails are a User variable and not included or searchable when listing Profiles. You'll have to list users instead and link to their profiles with template manipulation. Try this -

{capture name="emails_tpl" assign="emails_tpl"}
    {literal}
	<div class="container">
    	    {if isset($_items)}
                {foreach from=$_items item="item"}
                    {if $item@first || ($item@iteration % 2) == 1}
                        <div class="row">
                    {/if}
                    <div class="col6{if $item@last || ($item@iteration % 2) == 0} last{/if}">
                        {$profile_url = jrCore_db_get_item_key('jrProfile', $item['_profile_id'], 'profile_url')}
                        <a href="{$jamroom_url}/{$profile_url}">{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$item._user_id size="large" crop="portrait" class="img_scale" style="margin:0" alt="@`$item.user_name`" title="@`$item.user_name`"}</a>
                    </div>
                    {if $item@last || ($item@iteration % 2) == 0}
                        </div>
                    {/if}
                {/foreach}
            {/if}
        </div>
    {/literal}
{/capture}

{$search_domain = 'gmail.com'}
{jrCore_list module="jrUser" search="user_email LIKE %`$search_domain`%" template=$emails_tpl}
This code displays returned users side by side whose email domain is gmail.com.
hth


--
Paul Asher - JR Developer and System Import Specialist

updated by @paul: 01/17/16 03:12:12AM
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Another 'lo tech' (and maybe slower) method which might be easy for someone like me who isn't very good at applying codes is: when in your User Account browser, click to export the .CSV file of users, then open in a spreadsheet like Excel... where you can use the excel "Find" function to find/highlight that domain name in the email address column.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
musicianband
@musicianband
8 years ago
45 posts
Actually, I need this function in order to create an automated way of deleting those filtered profiles, recording a macro using a software which records mouse and keyboards movements and actions, because I cannot stay 5 hours in front of computer to delete one by one those 1500 bots that intoxicated my site. So far, there is no ckeckbox near an user profile in data browser that would allow to select it. It would have been much more easyer to check each of them and click a button at the bottom: " delete selected profiles and their associated accounts and all the crap that they have posted on my site and in the same time block their ip's and ban their domains in order not to touch my site again! " . Unfortunately, there's not such an option and I have to improvise. Still looking for some ideas / sugestions. Thank You!
michael
@michael
8 years ago
7,743 posts
You might try installing the "Batch Item Editor"

https://www.jamroom.net/the-jamroom-network/networkmarket/236/batch-item-editor

And using it from the TOOLS menu of the profile module in the ACP, it has a delete checkbox.

ACP -> PROFILES -> PROFILE -> TOOLS -> BATCH ITEM EDITOR

Select a couple of fields so you know what you're looking at, then view the data then use the SEARCH field to filter down to what you're interested in.

Tags