Display member url permalink

I couldn't find how to give my members their perma-link to their profile to share so I wrote this little change to display it in the dashboard and thought to share it with everyone.  It will show as the picture, nicely in the account info.  It's important for our site where we allow users to change their username at any time and if they change from site.com/AAA to site.com/AAB then anywhere they shared site.com/AAA will no longer point to a valid profile.


Remember to make a backup of all files before proceeding in case you need to revert back.

Step 1. Create a language key _ProfileShareLink with this text (or any text you want): Share your profile with this URL

Step 2. Open member.php

Step 3. Around line 274, below "$sCustomC = _t('_Custom');" add this "$sLinkC = _t('_ProfileShareLink');" without the quotes

Step 4. Go to around line 550 and find this codeset:

'Registration' => array(

'type' => 'custom',

'name' => 'Registration',

'content' => '<b>' . $sRegistrationC . ':</b> ' . $sRegistration,

'colspan' => true

),

Add this code on a new line after ")," to start a new line

'Linkback' => array(

'type' => 'custom',

'name' => 'Linkback',

'content' => '<b>' . $sLinkC . ':</b> <br />' . $site['url'] . 'profile.php?ID=' . ($this->aMemberInfo['ID']),

'colspan' => true

),

Step 5. Upload new member.php and when a ueser hits their dashboard they will see the perma link location to share.

Quote · 13 Jan 2010

But it is showing the ugly url - shouldn't it show: www.mysite.com/username  - and not that php stuff.

Quote · 13 Jan 2010

I origionally did the pretty url but that isn't permanent.

If my username is Maurice my url is site.com/Maurice.  I link that to facebook and such.  Now months later I change my username to Cano, so my new link is site.com/Cano.  Anyone who goes to site.com/Maurice will get a "profile not found" or someone else may take my old user name and now my facebook link would point to someone else's profile entirely.  Using the "ugly" url ensures that no matter what someone uses as a username, the link will take the browser to the correct profil.

If you want to make it with the username as you typed change the 'content' line to this:

'content' => '<b>' . $sLinkC . ':</b> <br />' . $sUserLink,

Quote · 13 Jan 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.