MyBB Community Forums

Full Version: MyBB User Link to Profile Not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to learn as much as I can about MyBB, skinning, and the variables used when skinning.

I've come across a problem that google isn't helping me out with so I'm asking y'all.

I'm trying to display this when a member is logged in in the 'panel' bar:
"Welcome back, [username & link to profile]  || [logout key]"

What I have in the coding is:
<span class="welcome">? <a href="$mybb->user['uid']">{$mybb->user['username']}</a> || <a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}"><i>{$lang->welcome_logout}</i></a></span>

Problem is when they click their name it goes to a page saying:
URL
http://nikitesting.icyboards.net/Array['uid']

And then has an error message:
404 Not Found




How do I get the url to be for their user id to link to their profile?
My forum --> http://nikitesting.icyboards.net/index.php

This is what the userlinks bar looks like:
http://i.imgur.com/5fe6Aar.jpg

This is what happens when the persons name is clicked:
http://i.imgur.com/rPFFt7o.png
Well, the href attribute is just invalid. Firstly, it's better to wrap the variable with {} - {$mybb->user['uid']} - to ensure proper interpolation. Secondly, there's no sign of the profile page in your URL. You're directing users relatively to their UID, but that page doesn't exist. http://nikitesting.icyboards.net/member....file&uid=3 - as you can see in your browser, it's member.php?action=profile&amp;uid=[UID] and you need to include that in the link.

Keep in mind it's not the best solution if you're using MyBB SEF/Google SEO URLs. get_profile_link() is better to use in that case - you need a plugin like Template Conditionals: http://mybbhacks.zingaburga.com/showthre...464&page=9 to be able to use that functions in templates.
Unfortunately I'm using MyBB through Icyboards so I cannot download any plugins other than the few they have 'ready' to use.

But this is the error message I get when entering what you suggested to:
http://i.imgur.com/nkuQz3D.png


Is there any other possible way to do this? Without downloading a plugin..
I didn't suggest that.. member.php?action=profile&amp;uid=[UID] is the page + parameter you need to link, where [UID] should be user's UID, so {$mybb->user['uid']}.

href="{$mybb->settings['bburl']}/member.php?action=profile&amp;uid={$mybb->user['uid']}"
Oh, okay that makes a whole lot more sense.

Thank you VERY much for the help!
Greatly appreciated!!