• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Link to Profile-pages ?

erich37

Well-known member
#1
I have a Notice which welcomes the user and I am linking from there to the "User-Account-page" via www.domain.com/account/ in order for the user to easier find his Account.

Is there a way to also link to the user's "Profile-page" ?


Many thanks!
 

oman

Well-known member
#2
Yep, it is. I tested around and came up with something that worked:

HTML:
Check out your <a href="http://localhost/community/members/{name}.{user_id}">profile</a>!
Notice the dot between {name} and {user_id}.

:)
 

erich37

Well-known member
#3
Yep, it is. I tested around and came up with something that worked:

HTML:
Check out your <a href="http://localhost/community/members/{name}.{user_id}">profile</a>!
Notice the dot between {name} and {user_id}.

:)
Nope, that does not work.

Error: "page could not be found"
 

erich37

Well-known member
#8
ohhh..... sorry.

It works fine now (y)

question:
Is there any reason why the first letter of the username is capitalised in the Link ?
 

erich37

Well-known member
#10
yeah, the first letter of the username is in capital.

I am just wondering, because the default XF-Links to the user-profile-page do not show the first letter capitalised.
So there is a difference in the link-URL....

Does this matter or is it irrelevant ?
 

oman

Well-known member
#11
yeah, the first letter of the username is in capital.

I am just wondering, because the default XF-Links to the user-profile-page do not show the first letter capitalised.
So there is a difference in the link-URL....

Does this matter or is it irrelevant ?
Shouldn't matter. I'll see if there is a way to make it lowercase.
 

oman

Well-known member
#12
Tried adding this, but it didn't make it lowercase unfortunately.

HTML:
Check out your <font style="text-transform: lowercase;"><a href="http://localhost/community/members/{name}.{user_id}">profile</a></font>!
 

erich37

Well-known member
#13
well, I mean the first capital of the username is capitalized in the Link-URL itself.

example: username = Zaki

the URL from your code shows like this:
www.domain.com/members/Zaki.1

but the URL for the username at the top-right XF-default user-box shows like this:
www.domain.com/members/zaki.1

not sure why is this, as your code is just using the normal {name} code..... ?
 

LPH

Well-known member
#14
I link to profile page using this code. The strtolower may be the missing piece.

PHP:
<a href="/community/members/' . strtolower($XF->visitor->get('username')) . '.' . $XF->visitor->get('user_id') .'"> '. $current_user->display_name .'</a>
 

erich37

Well-known member
#15
I link to profile page using this code. The strtolower may be the missing piece.

PHP:
<a href="/community/members/' . strtolower($XF->visitor->get('username')) . '.' . $XF->visitor->get('user_id') .'"> '. $current_user->display_name .'</a>
huh, that is a long code :eek: :confused:

you can put this stuff into a "Notice" and it works ?