how to parse out @email.com in usernames?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xavier.vanvlasse
    New Member
    • Jun 2008
    • 2
    • 3.7.x

    how to parse out @email.com in usernames?

    Users can sign up with usernames like: [email protected]. My client wants me to display 'name' only, and not display '@url.com'.

    I know how to do this in PHP, but the templates don't accept PHP code, so how would I implement this?

    Thanks!
  • Reeve of Shinra
    Senior Member
    • Sep 2001
    • 4325
    • 4.0.0

    #2
    AdminCp - User Registration Options

    a) In the Illegal User Names field, add @ and maybe the popular .com/.org/etc

    b) Use the Username Regular Expression field for regex code so the username conforms to a certain format.

    That will be one cookie please!
    Plan, Do, Check, Act!

    Comment

    • xavier.vanvlasse
      New Member
      • Jun 2008
      • 2
      • 3.7.x

      #3
      This is a good solution. However, my client is importing 1000+ users and they all have emails as usernames.

      How hard would it be to hide everything after {including} the @? They don't want to have 1000's of emails readily available for spambots.

      Thanks.

      Comment

      • Reeve of Shinra
        Senior Member
        • Sep 2001
        • 4325
        • 4.0.0

        #4
        How are they importing?

        If its from a csv file, you can use excel (or some other spreadsheet program) to create a new column with everything before the "@".

        edit:

        In excel, you paste this into an empty column and change the two "A5" to the cell with the username. You would just copy/paste this for the entire list.

        =LEFT(A5,(FIND("@",A5)-1))


        Results:
        [email protected] = xavier.vanvlasse
        [email protected] = 12345.56789
        Attached Files
        Last edited by Reeve of Shinra; Thu 24 Jul '08, 7:25pm.
        Plan, Do, Check, Act!

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎