New Feature: Custom Member Profile URLs
August 12, 2009
by Ryan Masuga
Devot:ee now has a custom member profile URL feature. You can now optionally select what your profile URL is, which provides a little more personality, and it was fun to implement, besides.
I added a new custom member profile URL feature on devot:ee. Now you have the option to select what your profile URL is. This was done with a combination of the Solspace User module and some PHP on a couple templates. I implemented this feature for a few reasons:
1) The number of members on devot:ee is our business. Literally.
Before implementing this, anyone could just increment the number on any member profile URL to determine how many members there are (and this goes for any ExpressionEngine site using the member id in the URL of a member profile page). You just keep going until you get an error. Some sites may not want this knowledge available, and devot:ee happens to be one of those sites.
2) A wee bit more secure
Using a generated segment (using our secret homemade recipe) or letting a user pick their own helps keep member ids and usernames off the site. I thought about just using a user’s username, but that’s one half of someone’s login info, so I thought I’d push this a little further to keep both the member_id and username out of the URL. If you want to update your custom segment to match your username, go for it–that’s up to you.
3) You’re not just a number!
It’s always nice to personalize things a bit. For example, now you can find my profile at http://devot-ee.com/members/profile/ryan-masuga/ rather than the more anonymous http://devot-ee.com/members/profile/1/. I could just as easily have made my URL devot-ee.com/members/profile/monkeymaster/ (which is totally available as I write this). You can still get your member ID if you need to – it’s now listed on your member profile page if you’re logged in.
4) Because I can
Devot:ee is different things to different people, and for me it is part playground and part laboratory – a place to do things that I may not be able to do on a client site. One of the things on my to-do list was to make member profile URLs that didn’t contain a member_id or a username. I just wanted to know if I could do it.
When a user registers, they are given an automatically generated user segment similar to: devot-ee.com/members/profile/user67826190/. They can then go into their profile at any time to change this to whatever they want, provided their custom segment is available. I’ve implemented a live lookup as you type to see if the segment you’re typing is already in use. Similar to Facebook, you can update this custom URL segment once. If you need to change it again, you can just contact me and we’ll take care of it. You’ll know that you’ve updated at least once because the field will no longer be available to you on the edit page. I did this so people are thoughtful and not just changing this willy-nilly.
So, if you’ve already signed up in the past, you’ve been assigned a custom profile URL segment already. Just log in and go to your member page to change yours. If you don’t want to update it, no worries. Just carry on, and happy ExpressionEngineering!