News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Reference own user ID

Started by brettuk, July 31, 2018, 07:18:31 AM

Previous topic - Next topic

brettuk

Hi,

I have recently installed the mentions mod, and your mention are visible at the following URL:

/profile/?area=mentions;u=1

However, the u= number is your user ID.

I'd like to create a button in my nav that's called 'Mentions' and redirects the user to their mentions page, however, I need to somehow grab the user's ID to make it do-able.

Any one have any ideas?

Illori

you mean if you just go to the mentions area without the user id it fails to load correctly? usually this works without an issue on most mods.

d3vcho

Maybe with $user_info['id']?
"Greeting Death as an old friend, they departed this life as equals"

Arantor

Where are you trying to make this button?

xTyler

I have added something similar using this mod, however I just check if they are logged and then link them to the default profile area..

Example:

if ($context['user']['is_logged'])
echo'<a href="forum/index.php?action=profile;area=mentions">';

Advertisement: