1. Prima data o sa va arat cum sa afisati avatarul la ultimul inregistrat
Intram in index.php si cautam
a)
Code: Select all
// Assign index specific vars
Code: Select all
// Obtine avatarul celui mai recent utilizator inregistrat (C) Dolores
$sql = 'SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height
FROM ' . USERS_TABLE . '
WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
ORDER BY user_id DESC';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
set_config('newest_user_id', $row['user_id'], true);
set_config('newest_user_avatar', $row['user_avatar'], true);
set_config('newest_user_avatar_type', $row['user_avatar_type'], true);
set_config('newest_user_avatar_width', $row['user_avatar_width'], true);
set_config('newest_user_avatar_height', $row['user_avatar_height'], true);
}
b)
Code: Select all
'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
Code: Select all
'NEWEST_USER_AVATAR' => ($config['newest_user_avatar']) ? get_user_avatar($config['newest_user_avatar'], $config['newest_user_avatar_type'], ($config['newest_user_avatar_width'] > $config['newest_user_avatar_height']) ? 25 : (25 / $config['newest_user_avatar_height']) * $config['newest_user_avatar_width'], ($config['newest_user_avatar_height'] > $config['newest_user_avatar_width']) ? 25 : (25 / $config['newest_user_avatar_width']) * $config['newest_user_avatar_height']) : '<img src="http://i.epvpimg.com/SMyTc.png" width="25px;" height="25px;" alt="" />',
c)
Code: Select all
ACP-Styles-Tema ta- index_body.html
Code: Select all
{NEWEST_USER}
Code: Select all
{NEWEST_USER_AVATAR}
Code: Select all
<!-- IF NEWEST_USER -->
<center><font size="4"><i class="fa fa-info-circle" aria-hidden="true"></i></i> <b>Statistici</b></center></font>
<div class="stat-block statistics">
<p>
<span><i class="fa fa-comment-o" aria-hidden="true"></i><strong>{TOTAL_POSTS}</strong></span><span><i class="fa fa-comments-o" aria-hidden="true"></i><strong>{TOTAL_TOPICS}</strong></span><span><i class="fa fa-users" aria-hidden="true"></i><strong>{TOTAL_USERS}</strong></span><span><i class="fa fa-user-plus" aria-hidden="true"></i><strong>{NEWEST_USER}{NEWEST_USER_AVATAR}</strong></span>
</p>
</div>
<!-- ENDIF -->