Hi,

I was wondering how to set up a view to show users with certain pattern in username.

I wanted to look for users who have used their email addresses as their username and wanted to add a filter that shows any username with the @ character in it.

How is this done?

thanks in advance for any info on this.

CommentFileSizeAuthor
#6 views-660140.patch774 bytesdagmar
#4 filter_user_name.png13.99 KBh3000
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tanveer_2030’s picture

Hi,

You mean you want to show logged user name on site?

tanveer_2030’s picture

Hi,

If you want to show logged user name then you can use this variable to get logged user name.

echo $user->name;

Let me know if you will feel some problem with this.

Best Regards,
Tanveer Hussain

dagmar’s picture

Status: Active » Fixed

You can apply a filter in the view:

Filter: User name.
Operator: Contains
Value: '@'

h3000’s picture

FileSize
13.99 KB

@dagmar - I have tried that but I don't see the Contains operator - how do I make it appear?

Attached is a screenshot of the User name filter.

dagmar’s picture

Status: Fixed » Active

Sorry, my mistake.

dagmar’s picture

Title: How to show users with a certain pattern in username » Filter users with a certain pattern in username
Version: 6.x-2.8 » 6.x-3.x-dev
Component: Miscellaneous » user data
Category: support » feature
Status: Active » Needs review
FileSize
774 bytes

Here is a patch.

h3000’s picture

ok - works - thanks!

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Patch works fine

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 3.x in both d6 and d7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Nigel Cunningham’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Closed (fixed) » Active

Could this also be applied to the 6.x-2.x line, please? I've manually done so, and it works fine.

Nigel

dawehner’s picture

Status: Active » Reviewed & tested by the community

.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Ok, committed.

Nigel Cunningham’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sukameister’s picture

When are we going to see this fix available in the 6.x-2.x line? The latest in that line is from June 16, before this fix was generated, and the current 2.x version still contains this issue.

paolomainardi’s picture

Subscribe, is the issue fixed also for 2.x version ?

Thanks a lot.

[EDIT] I confirm that the feature is available on 6.x-dev branch.

Gabriel R.’s picture

The fix at #6 from Dagmar does not work with 6.2.x
Please advise.

Nigel Cunningham’s picture

Status: Closed (fixed) » Reviewed & tested by the community

I've been slow to look at the newest version, but have just gotten around to that. Despite the posts above, it doesn't seem to be applied in 6.x-2.12.

dawehner’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Why should we write release announcement when noone reads them :)

6.x-2.12 is a security only release. The changes are in 6.x-2.x-dev.

Nigel Cunningham’s picture

But there is no 6.x-2.x-dev any more, and 6.x-2.12 was released in December, nearly six months after comment 13. It's not that unreasonable to think that it might be in 2.12 :).

That said, yes - I didn't read the release notes for 2.12 when submitting the bug (though I would have at the time).

Could we please have a 2.x dev line back?

Regards,

Nigel

merlinofchaos’s picture

6.x-2.x-dev is http://drupal.org/node/95897 -- it's not gone, just not listed on the project page.

Nigel Cunningham’s picture

Thanks.