Show avatar?? - Top Five
Re: Show avatar??
but how do I add them? where to get? sorry, did not quite understand your message ..
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
Read the topic and try to apply what I told you to want it is you want to achieve.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
I once did not try, I can not properly put .. Now the code such:
but I still can not see the avatar .. help please? already seething brains .. (
Code: Select all
// newest registered users
if (!function_exists('get_user_avatar'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
if (($newest_users = $cache->get('_top_five_newest_users')) === false)
{
$newest_users = array();
// grab most recent registered users
$sql = 'SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, username, user_colour, user_regdate
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_type', $ignore_users, true) . '
AND user_inactive_reason = 0
ORDER BY user_regdate DESC';
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
$newest_users[$row['user_id']] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'user_regdate' => $row['user_regdate'],
);
}
$db->sql_freeresult($result);
// cache this data for ever, cache is purged when adding or deleting users
$cache->put('_top_five_newest_users', $newest_users);
}
foreach ($newest_users as $row)
{
$username_string = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$template->assign_block_vars('top_five_newest',array(
'USER_AVATAR' => get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']),
'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '',
'REG_DATE' => $user->format_date($row['user_regdate']),
'USERNAME_FULL' => $username_string)
);
}
}
but I still can not see the avatar .. help please? already seething brains .. (
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
Code: Select all
'user_colour' => $row['user_colour'],
'user_regdate' => $row['user_regdate'],
make it like this
Code: Select all
'user_colour' => $row['user_colour'],
'user_regdate' => $row['user_regdate'],
'user_avatar' => $row['user_avatar'],
'user_avatar_type' => $row['user_avatar_type'],
'user_avatar_width' => $row['user_avatar_width'],
'user_avatar_height' => $row['user_avatar_height'],
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
Super! Thank you! From the soul! )))
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
one question), how to fix that avatars appear immediately and not after a clean cache after Admin?
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
// cache this data for ever, cache is purged when adding or deleting users
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
I tried to remove this line,
nothing has changed ..
---
Ah, no! everything is fine! Thank you very much!
Code: Select all
// cache this data for ever, cache is purged when adding or deleting users
$cache->put('_top_five_newest_users', $newest_users);
nothing has changed ..
---
Ah, no! everything is fine! Thank you very much!
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
Hello RMcGirr83 and all other forum members) tell me please some more .. how to make that users do not have the avatar does not appear on the main page, and there were those who came before them, but with the avatar?
Thank!
Thank!
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
Try changing this
to this
You may have to use a switch in the html file instead though. I haven't tested the above.
Code: Select all
'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '',
to this
Code: Select all
'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="./images/no_avatar.gif" width="25px;" height="25px;" alt="" />',
You may have to use a switch in the html file instead though. I haven't tested the above.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
Yes, this method works, thanks! but I was referring to a user without an avatar does not appear, but instead the user was registered in front of him, but with the avatar .. that is, display only those who have downloaded the avatar?
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
I'm not understanding your question. Whether a user has an avatar or not doesn't matter if they are displayed or not.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
i'm try to depict as follows:
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am
Re: Show avatar??
So you don't want them to display if they don't have an avatar? Is that correct?
WHERE ' . $db->sql_in_set('user_type', $ignore_users, true) . '
AND user_inactive_reason = 0 AND user_avatar IS NOT NULL
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22072
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: Show avatar??
Yes, only now avatar is not visible, but the name is displayed ..
And I need to and it is not, and has appeared with the previous user avatar ..
so that the user was not displayed until the upload avatar ..
I'm sorry, I use google translator)
tried so to write, nothing happened ..
And I need to and it is not, and has appeared with the previous user avatar ..
so that the user was not displayed until the upload avatar ..
I'm sorry, I use google translator)
tried so to write, nothing happened ..
Code: Select all
WHERE ' . $db->sql_in_set('user_type', $ignore_users, true) . '
AND user_inactive_reason = 0 AND user_avatar IS NOT NULL AND username IS NOT NULL
-
- Registered User
- Posts: 33
- Joined: Sat Feb 12, 2011 8:35 am