# Oewgo (17.01.2016 / 19:21)http://i.imgur.com/LHeEZ8i.png
Спасибо! А можете сделать чтобы еще отображалось on off?
Oline (+/-)
echo '<style>
.new-users{
display: block;
text-align: center;
padding: 3px 3px 15px;
margin: auto;
background: #EDF7E8;
position: relative;
}
.class2{
display: inline-block;
position: relative;
background: transparent;
margin: 0;
padding: 0;
}
.class1{
display: inline-block;
position: relative;
background: transparent;
margin: 0;
padding: 0;
}
.ava{
vertical-align: middle;
border-radius: 50%;
border: 1px solid #6D6D6D;
box-shadow: 1px 1px 1px 1px rgba(70, 70, 70, 0.67);
width: 24px;
height: 24px;
padding: 0;
margin-right: 4px;
margin-left: 7px;
}
a.link-user{
text-decoration: none;
}
.online {
position: absolute;
left: 4px;
bottom: 1px;
width: 12px;
height: 12px;
border: 2px #fff solid;
border-radius: 50%;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAAH6Nf8rAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbxJREFUeNpi7jqZziDk/1WE6fXXx/xv3j6/DhBADBOvOLxlcJzH8h8ggBhzjvJ8/PPzL9+DZ/8YAAKIseywS5IoD2M9y0/mY3PPP/3HwPLkGQvDs9dfGQACACoA1f8Bd8NEXxIRxKD4+wQA8/j9APb5BQAE8vvViejkAQDy9PsA9PX/APX3+wACAGkAlv8BZrk8ACQVC9EHBvUc+fcgrfL5/GYELB7m//T76ADx9wEA7/bIZRYGSxYE4fPnAPn4AQD29/4A7/QEANfytz8E8vT9APP0AgDy9P8A9vf/AP//Bf8C9/YZye/x/QDx9PwA/PsCADEhO0oCdED2KgpDQRQ++WENQSOsiZBGQQR1293C1hfwMSys7H0CX8DelxF9AW1FBG3UeLNrnPuTu4PF4WOY4WM4zmIz9TK9X7bibEL2BCoLKGNhjA+/THB+BNsk+Bk7821vF4aHAaugDaC0xUtZ0JvAH7GVqmf/SsdUKA8vaSB5QdJCEpOPFc9KOZAmr7ixO1rdhUYm+CdhITiP3xI5l5A/NQo2thv9g/skNStkmoRed/WB9GhNdPMQ3WqV+NJpfq3rjfrwM4q//wFWOeFRbT9EDgAAAABJRU5ErkJggg==);
pointer-events: none;
}
.offline {
position: absolute;
left: 4px;
bottom: 1px;
width: 12px;
height: 12px;
border: 2px #fff solid;
border-radius: 50%;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAS9JREFUeNpUUDtug0AQHVhhhAIWSPwkmshU2J3bdLQuo+QKvkCSQ8RV0kQ5Qy5hJI6QiM5yaWzJIGIBFhiyD6VInjSrmZ23b96sQL8wDONuOp0uHceZ9X1PaZp+JUnynmXZB/oCjslk8hyG4aOmaSQIAl0uFwL5dDrRer1ebTabJ6br+u1isXgZj8ckSRIpikKMsYEsiiJ5nnez3W4/2Xw+f+OK1yDx8UMg77qOzufzkLdt64iu6wYYJ8syqapKpmkS1FGPRqPBv23bgQgvGMNfUV3XVBQFVVVFTdMMd1AGRL5dAjKaeZ5jWzoej1SW5UAG9vt9wr45fN+/h3F4QhMk5BDAlDiOHxhPEq50he1gHDYQAEhRFK12u92r8PfDgyBYWpY1Q304HP59+I8AAwCKCKbdO2uZKAAAAABJRU5ErkJggg==);
pointer-events: none;
}
</style>';
$res = mysql_query("SELECT * FROM `users` ORDER BY `id` DESC LIMIT 2");
echo '<div class="new-users">';
echo '<b>Новые на сайте</b><br />';
while ($use = mysql_fetch_assoc($res)) {
$online = (time() > $use['lastdate'] + 300 ? '<span class="offline"></span>' : '<span class="online"></span>');
echo '<span class="' . ($i % 2 ? 'class2' : 'class1') . '">';
if (file_exists((ROOTPATH . 'files/users/avatar/' . $use['id'] . '.png'))) {
echo '<img class="ava" src="' . core::$system_set['homeurl'] . '/files/users/avatar/' . $use['id'] . '.png" alt="' . $use['name'] . '"> ';
} else {
echo $online . '<img class="ava" src="' . core::$system_set['homeurl'] . '/images/empty.png" alt="" /> ';
}
if ($user_id) {
echo '<a class="link-user" href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $use['id'] . '">'
. $use['name'] . '</a>';
} else {
echo $use['name'];
}
echo '</span> ';
}
echo '</div>';