Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 6 Months ago Link to profile with username in URL
#1
Solved: 3 Years, 6 Months ago
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...
Reply
#2
Solved: 3 Years, 6 Months ago
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>
Reply
#3
Solved: 3 Years, 6 Months ago
(04-07-2016, 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!
Reply
#4
Solved: 3 Years, 6 Months ago
(04-07-2016, 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
Reply
#5
Solved: 3 Years, 6 Months ago
(08-04-2017, 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.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)