Файл: sys/fnc/avatar.php
Строк: 14
<?php
function avatar($id, $px) {
    global $set;
    if (is_file(H . "sys/avatar/$id.gif")) {
        echo "<img src='/sys/avatar/$id.gif' style = 'width: {$px}px;height: {$px}px;' class = 'avatar' />n";
    } elseif (is_file(H . "sys/avatar/$id.jpg")) {
        echo "<img src='/sys/avatar/$id.jpg' style = 'width: {$px}px;height: {$px}px;' class = 'avatar' />n";
    } elseif (is_file(H . "sys/avatar/$id.png")) {
        echo "<img src='/sys/avatar/$id.png' style = 'width: {$px}px;height: {$px}px;' class = 'avatar' />n";
    } else {
        echo "<img src='/sys/avatar/avatar.png' style = 'width: {$px}px;height: {$px}px;' class = 'avatar' />n";
    }
}
function avatar_path($id_user) {
    $ava = glob(H . 'sys/avatar/' . $id_user . '.*');
    if ($ava) {
        return str_replace(H, '/', $ava[0]);
    } else {
        return false;
    }
}