Файл: core/ava_users.php
Строк: 9
<?php
function ava($id, $max) {
$req = mysql_query("SELECT * FROM `users_photo` WHERE `user`='" . $id . "' and `page` = '1' LIMIT 1");
if (mysql_num_rows($req) != 0) {
$p = mysql_fetch_assoc($req);
$arhiv = intval(($id / 1000) + 1);
$w = $info[0];
$h = $info[1];
$delim = $w / $max;
$w = $max;
$h = $h * $delim;
echo '<img src= "/base/' . $arhiv . '/' . $id . '/photo_small/' . $p['id'] . '.jpg" width = "' . $w . ' height = "' . $h . '">';
} else {
$sex = mysql_result(mysql_query("SELECT `sex` FROM `users` WHERE `id` = '" . $id . "'"), 0);
echo '<img src= "/style/page/' . $sex . '.png" width = "' . $max . '">';
}
}
?>