Link to Send Private Message / View User Profile

Permalink
Hi All,

Is it possible with a bit of php to modify an area or add to a theme a link that will send a user a private message?

Scenario: A username that once clicked, will send the user to the Send Message area with the username already filled in or something similar.

Or if that cannot be accomplished, a link to their profile. I do see that some profiles are listed via number 2, 3, 4 etc. However is it possible that they could be usernames instead?

Using 5.6

Kind Regards,

Dan

 
drm92 replied on at Permalink Best Answer Reply
Figured this out by via the following:

$u = new User();
      $userName = $u->getUserName();
      $ui = UserInfo::getByUserName('joebloggs');
      $userID = $ui->getUserID();


and then linked via

<a href="https://example.co.uk/index.php/profile/messages/write/<?php echo $userID ?>">