MyBB Community Forums

Full Version: Link to profile with username in URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So he is an interesting question.  For header_welcomeback_member I added an avatar that has a link that goes to the profile of whoever clicks it.  Here is the code:

	<span style="text-align:left;"> <a href="{$mybb->settings['bburl']}/member.php?action=profile">  <img class="panelavatar" style="vertical-align: top; margin-top: 5px;" src="{$mybb->user['avatar']} /images/default_avatar.png" height="40"></a></span>

Now when you click this link it will bring you to your own profile but in the URL after the domain is this  [Image: b07b9820ca.png]

Now my question is can this be fiddled with to make it so when you click the link the URL will show your username?  For example:  www.mybb.com/user-scoopy
I have google SEO installed so profiles display the "/user-scoopy" just not for the avatar code for the header.  Any ideas?  One of these days I will decide to learn to code stuff like this...
You'll need to install Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and use something like:
<a href="<?=get_profile_link($mybb->user['uid'])?>">...</a>
(2016-04-07, 10:21 PM)Destroy666 Wrote: [ -> ]You'll need to install Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and use something like:
<a href="<?=get_profile_link($mybb->user['uid'])?>">...</a>

Wow thanks!  This worked perfectly thank you very much!
(2016-04-07, 10:21 PM)Destroy666 Wrote: [ -> ]You'll need to install Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and use something like:
<a href="<?=get_profile_link($mybb->user['uid'])?>">...</a>

Did what you said; installed the TC add-on and used <a href="<?=get_profile_link($mybb->user['uid'])?>">...</a>.. but eh, here's the link I get (remplaced the original url with website, ofc): http://website/%3C?=get_profile_link(Array[%27uid%27])?%3E
(2017-08-04, 05:41 PM)Wyvh Wrote: [ -> ]Did what you said; installed the TC add-on and used <a href="<?=get_profile_link($mybb->user['uid'])?>">...</a>.. but eh, here's the link I get (remplaced the original url with website, ofc): http://website/%3C?=get_profile_link(Array[%27uid%27])?%3E


I got same error and didn't redirect to member profile page.

Edited : Solved by Reactivate plugin.