2014-10-30, 06:13 AM
Hey guys,
Is there a plugin out there that I can put on the portal page that can show features usrs, or 10 users I've selected to be featured?
Or maybe a way I can select certain users to display on the portal page,
any point in the right direction would b kindly appreciated..
ps. Ive spent a ton of time searching but can't seem to find anything like this,
I want to show to people I select to be featured on the portal page,
I know I can just link names,but I wanted to show the avatars of people I select
is there a php function - conditional - I can use to call a specific users avatar?
Update:I've found a way to call a specific user's avatar
here on google http://stackoverflow.com/questions/24376...erson-mybb
if it works then this will be my solution, Iwillupdate you with screenshots.
I cannot get this to work,
if($mybb->user['username'] == $username)
{
$avatar = $mybb->user['avatar'];
}
else
{
$query = $db->simple_select('users', 'avatar', "username = ".$db->escape_string($username)."'", array('LIMIT' => 1));
$avatar = $db->fetch_field($query, 'avatar');
}
or this.........
if($mybb->user['username'] == $username)
{
$avatar = $mybb->user['avatar'];
}
elseif(get_user_by_username($username, array('exists' => true)) !== False)
{
$user = get_user_by_username($username, array('fields' => array('avatar'))); // Add other fields you want to the fields array.
$avatar = $user['avatar'];
}
else
{
error('Invalid user');
}
Can someone be kind enough to tell me how to add in a user's name to either one of those codes obove to show the users avatar?
Any help would be really appreciated,
Is there a plugin out there that I can put on the portal page that can show features usrs, or 10 users I've selected to be featured?
Or maybe a way I can select certain users to display on the portal page,
any point in the right direction would b kindly appreciated..
ps. Ive spent a ton of time searching but can't seem to find anything like this,
I want to show to people I select to be featured on the portal page,
I know I can just link names,but I wanted to show the avatars of people I select
is there a php function - conditional - I can use to call a specific users avatar?
(2014-10-30, 06:13 AM)Michael2014 Wrote: [ -> ]Hey guys,
Is there a plugin out there that I can put on the portal page that can show features usrs, or 10 users I've selected to be featured?
Or maybe a way I can select certain users to display on the portal page,
any point in the right direction would b kindly appreciated..
ps. Ive spent a ton of time searching but can't seem to find anything like this,
I want to show to people I select to be featured on the portal page,
I know I can just link names,but I wanted to show the avatars of people I select
is there a php function - conditional - I can use to call a specific users avatar?
Update:I've found a way to call a specific user's avatar
here on google http://stackoverflow.com/questions/24376...erson-mybb
if it works then this will be my solution, Iwillupdate you with screenshots.
I cannot get this to work,
if($mybb->user['username'] == $username)
{
$avatar = $mybb->user['avatar'];
}
else
{
$query = $db->simple_select('users', 'avatar', "username = ".$db->escape_string($username)."'", array('LIMIT' => 1));
$avatar = $db->fetch_field($query, 'avatar');
}
or this.........
if($mybb->user['username'] == $username)
{
$avatar = $mybb->user['avatar'];
}
elseif(get_user_by_username($username, array('exists' => true)) !== False)
{
$user = get_user_by_username($username, array('fields' => array('avatar'))); // Add other fields you want to the fields array.
$avatar = $user['avatar'];
}
else
{
error('Invalid user');
}
Can someone be kind enough to tell me how to add in a user's name to either one of those codes obove to show the users avatar?
Any help would be really appreciated,