A link to visitors profile

A link to visitors profile 1.0.6

No permission to download

Robert9

Well-known member
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
 

RobinHood

Well-known member
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.
 

Robert9

Well-known member
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.
 

Robert9

Well-known member
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/?
or
to user_id 0 => the user is not found?
or
just to /forums/
 
Last edited:

RobinHood

Well-known member
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
 

RobinHood

Well-known member
Just like if you were to try and start a conversation or do anything else that requires the user to be logged in

1619715999235.png
 

Robert9

Well-known member
So we can add another option for that.
forums
members
login

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.
 

Robert9

Well-known member
I have added the login. Maybe someone of the pros here wants to have a look.
There is probably something to do better.
 

Kirby

Well-known member
Maybe someone of the pros here wants to have a look.
PHP:
$this->assertNotEmbeddedImageRequest();

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).

PHP:
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.
 

RobinHood

Well-known member
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
 

FrancescoL

New member
A suggestion.
Create in admincp a space where decide any link where user should be redirected, after registration or login.
 
Top