MyBB Community Forums

Full Version: How to make "Welcome Back to Example, test!" a link to their profile?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Its not a link now, and I want it to link to their profile as others would see it, not their usercp. How can I do this?
Edit your global language file inc/languages/english/global.lang.php

Find (around line 34):
$l['welcome_back'] = "<strong>Welcome back, {1}</strong>. You last visited: {2}";

Replace with:
$l['welcome_back'] = "<strong>Welcome back, <a href=\"./member.php?action=profile\">{1}</a></strong>. You last visited: {2}";
Sorry but this doesnt work Sad

I think you need to do:

/member.php?action=profile&uid=<UID# HERE>

No?

What is the corresponding {#} for a user's UID?
(2011-02-07, 08:04 AM)zero_coke Wrote: [ -> ]Sorry but this doesnt work Sad

I think you need to do:

/member.php?action=profile&uid=<UID# HERE>

No?

What is the corresponding {#} for a user's UID?

How does it not work? If you visit http://community.mybb.com/member.php?action=profile it shows your profile as others would see it.
Oh, okay, so you are right about that. But when I copied and pasted what you posted above into my global language file the name doesn't still doesn't show up as a link. Did you try this on your page?
Did you replace the original language variable with the one I provided?
Don't do ./ in the URL's, as MyBB doesn't like it when you do that Toungue

Line 34, global.lang.php:
$l['welcome_back'] = "<strong>Welcome back, {1}</strong>. You last visited: {2}";

Change to:
$l['welcome_back'] = "<strong>Welcome back, <a href=\"{$mybb->settings['bburl']}/member.php?action=profile&uid={$mybb->user['uid']}\">{1}</strong>. You last visited: {2}";

May not be correct though.
(2011-02-08, 04:36 PM)Shukaku Wrote: [ -> ]Don't do ./ in the URL's, as MyBB doesn't like it when you do that Toungue

Line 34, global.lang.php:
$l['welcome_back'] = "<strong>Welcome back, {1}</strong>. You last visited: {2}";

Change to:
$l['welcome_back'] = "<strong>Welcome back, <a href=\"{$mybb->settings['bburl']}/member.php?action=profile&uid={$mybb->user['uid']}\">{1}</strong>. You last visited: {2}";

May not be correct though.

That will not work since $mybb isn't defined.
Remember, this is the language file, and these language strings are called elsewhere in other files where it is defined. I will test this on a localhost install some time to see if it'll work.
(2011-02-08, 08:29 PM)Shukaku Wrote: [ -> ]Remember, this is the language file, and these language strings are called elsewhere in other files where it is defined.

Well I tried it myself and it didn't work. They may have been defined, but when the files are getting "included", they may have not yet been defined, I don't know. Did you try it?
Pages: 1 2 3