A link to visitors profile [Deleted]

Next steps i f someone wants it
  • add an option for a navtab (you can do it manually and use /you a slink
  • add a redirect for guests instead an error message or
  • add an editable link for guests instead
Suggestion: Allow the admin to change the default /you to something else from within the ACP without having to edit the route in development mode.

I can currently edit the route directly to /profile instead. But would nice to not have to do that in dev mode.
Why you need dev-mode to do?
Just set a route from you/ to /anything ?
I will try it.

But there is one reason to have you or me or something fix. To have it everywhere the same in all forums (where admins dont change it).
From my opionion this should be done from XF itself.
Now we do:
if no user_id => login!
but that's not correct, when the profiles are viewable for everyone.
But without an user_id i cant show a member_view

So what we do?
Link to /members/?
to user_id 0 => the user is not found?
just to /forums/
Last edited:
I think you do need to prompt the user to login, because redirecting them somewhere else defeats the purpose of the link.

If your sending site.com/you in an email, link it in a notice, or a message, you want them to eventually end up on their profile, if they need to login then that should be what they see to encourage them to login
Just like if you were to try and start a conversation or do anything else that requires the user to be logged in

So we can add another option for that.

Something else?

The routing seems to be more work, i will check an addon for that tomorrow probably.
But anyway we dont need it and can use the routes.
I have added the login. Maybe someone of the pros here wants to have a look.
There is probably something to do better.
Maybe someone of the pros here wants to have a look.

Doesn't hurt, but isn't really necessary - even if it was called through an embedded image it would't cause damage (unlike thread read marking).

echo "1";
echo "2";
Debug code?

Method assertViewableUser seems nonsense, you already do have the current user - doesn't make sense to query it again.
Furthermore, the code boils down to calling canViewFullProfile on the user entity which (unless there are class extensions that modify the behaviour) will always return true if called for the visitor.

I'd either scrap that check completely (who would restrict a valid user from viewing their profile?) or just call the method directly.
Working perfectly for me at the moment with the login form option and using a route filter to change /you to /profile.

Many thanks for this
Top Bottom