Файл: sys/fnc/avatar.php
Строк: 37
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 17.11.2015
* Модифицировал densnet
*/
function avatar($id, $px = '40') {
global $set;
$ank = user::get_user($id);
if ($ank['sex'] == 0) {
$sex = 'zh.jpg';
} else {
$sex = 'm.jpg';
}
if (is_file(H . "user/avatar/$id.gif")) {
echo "<img src='/user/avatar/$id.gif' style = 'width: {$px}px;height: {$px}px' class = 'avatar'/>n";
} elseif (is_file(H . "user/avatar/$id.jpg")) {
echo "<img src='/user/avatar/$id.jpg' style = 'width: {$px}px;height: {$px}px' class = 'avatar'/>n";
} elseif (is_file(H . "user/avatar/$id.png")) {
echo "<img src='/user/avatar/$id.png' style = 'width: {$px}px;height: {$px}px' class = 'avatar'/>n";
} else {
echo "<img src='/user/avatar/$sex' style = 'width: {$px}px;height: {$px}px' class = 'avatar'/>n";
}
}
function avatars($id, $px = '40') {
global $set;
$ank = user::get_user($id);
if ($ank['sex'] == 0) {
$sex = 'zh.jpg';
} else {
$sex = 'm.jpg';
}
if (is_file(H . "user/avatar/$id.gif")) {
echo "<img src='/user/avatar/$id.gif' style = 'width: {$px}px;height: {$px}px' class = 'img-circle media-object'/>n";
} elseif (is_file(H . "user/avatar/$id.jpg")) {
echo "<img src='/user/avatar/$id.jpg' style = 'width: {$px}px;height: {$px}px' class = 'img-circle media-object'/>n";
} elseif (is_file(H . "user/avatar/$id.png")) {
echo "<img src='/user/avatar/$id.png' style = 'width: {$px}px;height: {$px}px' class = 'img-circle media-object'/>n";
} else {
echo "<img src='/user/avatar/$sex' style = 'width: {$px}px;height: {$px}px' class = 'img-circle media-object'/>n";
}
}
function avatar_p($id, $px) {
global $set;
$ank = user::get_user($id);
if ($ank['sex'] == 0) {
$sex = 'zh.jpg';
} else {
$sex = 'm.jpg';
}
if (is_file(H . "user/avatar/$id.gif")) {
echo "<img src='/user/avatar/$id.gif' style = 'width: {$px}px;height: auto' class = 'avatar'/>n";
} elseif (is_file(H . "user/avatar/$id.jpg")) {
echo "<img src='/user/avatar/$id.jpg' style = 'width: {$px}px;height: auto' class = 'avatar'/>n";
} elseif (is_file(H . "user/avatar/$id.png")) {
echo "<img src='/user/avatar/$id.png' style = 'width: {$px}px;height: auto' class = 'avatar'/>n";
} else {
echo "<img src='/user/avatar/$sex' style = 'width: {$px}px;height: auto' class = 'avatar'/>n";
}
}
function avatar_path($id_user) {
$ava = glob(H . 'user/avatar/' . $id_user . '.*');
if ($ava) {
return str_replace(H, '/', $ava[0]);
} else {
return false;
}
}