MyBB Community Forums

Full Version: Featured Users Plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?

(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,
(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?


(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,

For this I'm going to assume you are using the 1.8 series.

if($mybb->user['username'] == $username)
{
$avatarurl = $mybb->user['avatar'];
$avatardims = $mybb->user['avatardimensions'];
}
else
{
$query = $db->simple_select('users', 'avatar,avatardimensions', "username = ".$db->escape_string($username)."'", array('LIMIT' => 1));
$avatar = $db->fetch_array($query);
$avatarurl = $avatar['avatar'];
$avatardims = $avatar['avatardimensions'];
}
$avatarproperties = format_avatar($avatarurl, $avatardims);

You will then use the following variables in templates or in an echo.
$avatarproperties['image'] - The avatar url. Uses the default avatar url if the user does not have an avatar specified.
$avatarproperties['width_height'] - This part will be the following string:
width="$x" height="$y"
Quote:For this I'm going to assume you are using the 1.8 series.


if($mybb->user['username'] == $username)
{
$avatarurl = $mybb->user['avatar'];
$avatardims = $mybb->user['avatardimensions'];
}
else
{
$query = $db->simple_select('users', 'avatar,avatardimensions', "username = ".$db->escape_string($username)."'", array('LIMIT' => 1));
$avatar = $db->fetch_array($query);
$avatarurl = $avatar['avatar'];
$avatardims = $avatar['avatardimensions'];
}
$avatarproperties = format_avatar($avatarurl, $avatardims);

You will then use the following variables in templates or in an echo.
$avatarproperties['image'] - The avatar url.  Uses the default avatar url if the user does not have an avatar specified.
$avatarproperties['width_height'] - This part will be the following string:
width="$x" height="$y"

Wow, you are tops! Thank you so very much for taking the time to respond to this question Dragon, without a doubt it is people like you who make dreams come true for people like me!
I can't wait to try and impliment this! Again, thank you! Brilliant!