Файл: vsime.com/system/functions/ffs_screen.php
Строк: 33
<?
function ffs_screen($id_ffs, $type, $w, $h, $with_code = 1, $param=NULL) {
global $dbi, $config;
if ($type == 'foto') {
@$foto = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `foto` WHERE `id` = '$id_ffs' AND `type` = 'foto'"));
if ($foto['id']) {
if (is_file(H."i/ffs_screen/foto_".md5($foto['id'])."_".$w."_".$h.".png"))$src = "$config[http_site]/i/ffs_screen/foto_".md5($foto['id'])."_".$w."_".$h.".png";
elseif (create_screen(H."system/files/fotos/d$foto[id_dir]/".$foto['id'].".dat", H."i/ffs_screen/", $w, $h, NULL, "foto_".md5($foto['id'])."_".$w."_".$h.".png")) {
$src = "$config[http_site]/i/ffs_screen/foto_".md5($foto['id'])."_".$w."_".$h.".png";
}
if (isset($src)) {
if ($with_code == 1)return "<img src='$src'$param />n";
else return $src;
}
}
}
elseif ($type == 'file') {
@$file = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `files` WHERE `id` = '$id_ffs' AND `type` = 'file'"));
if ($file['id']) {
if (is_file(H."i/ffs_screen/file_".md5($file['id'])."_".$w."_".$h.".png"))$src = "$config[http_site]/i/ffs_screen/file_".md5($file['id'])."_".$w."_".$h.".png";
elseif (create_screen(H."system/files/files/users/user$file[id_user]/dir$file[id_dir]/".$file['id'].".dat", H."i/ffs_screen/", $w, $h, NULL, "file_".md5($file['id'])."_".$w."_".$h.".png")) {
$src = "$config[http_site]/i/ffs_screen/file_".md5($file['id'])."_".$w."_".$h.".png";
}
if (isset($src)) {
if ($with_code == 1)return "<img src='$src'$param />n";
else return $src;
}
}
}
}
?>