2020-12-02, 11:11 AM
I'm trying to get an user profile link with username, like this:
But I need to do so for specific UIDs, like
Where
Is a specific user UID, taken from a table in mybb database.
It works, but I don't know which mybb variable should be used instead of "Username" to display the specific username, given the uid inside my table
EDIT:
Checking between Mybb functions I've come across function build_profile_link which is defined like this from functions.php
Do you think it be adapted so that only UID is passed, via $serial['uid'] ?
<a href="https://community.mybb.com/user-85856.html">ShadowOne</a>
But I need to do so for specific UIDs, like
$user= "<a href=\"{$mybb->settings['bburl']}/".get_profile_link($serial['uid'])."\">Username</a>";
Where
Quote:$serial['uid']
Is a specific user UID, taken from a table in mybb database.
It works, but I don't know which mybb variable should be used instead of "Username" to display the specific username, given the uid inside my table
EDIT:
Checking between Mybb functions I've come across function build_profile_link which is defined like this from functions.php
function build_profile_link($username="", $uid=0, $target="", $onclick="")
{
global $mybb, $lang;
if(!$username && $uid == 0)
{
// Return Guest phrase for no UID, no guest nickname
return htmlspecialchars_uni($lang->guest);
}
elseif($uid == 0)
{
// Return the guest's nickname if user is a guest but has a nickname
return $username;
}
else
{
// Build the profile link for the registered user
if(!empty($target))
{
$target = " target=\"{$target}\"";
}
if(!empty($onclick))
{
$onclick = " onclick=\"{$onclick}\"";
}
return "<a href=\"{$mybb->settings['bburl']}/".get_profile_link($uid)."\"{$target}{$onclick}>{$username}</a>";
}
}
Do you think it be adapted so that only UID is passed, via $serial['uid'] ?