clr_str($d[0]); $user_key = (int) $d[1]; $file_key = (int) $d[2]; if ($type and $user_key and $file_key) { $tbl = sprintf("db_%sfiles", $type); $get = $db->execute(sprintf("SELECT `db_id`, `thumb_cache`, `thumb_server` FROM `%s` WHERE `file_key`='%s' LIMIT 1;", $tbl, $file_key)); if ($get->fields["db_id"]) { $thumb_server = $get->fields["thumb_server"]; $thumb_cache = $get->fields["thumb_cache"]; $thumb_cache = $thumb_cache > 1 ? $thumb_cache : null; $thumbnail = VGenerate::thumbSigned($type, $file_key, array($user_key, $thumb_cache), (3600 * 24), 0, 0); if ($thumbnail) { header("Location: " . $thumbnail); } } } } else { header("Location: " . $cfg["global_images_url"] . '/logo-mail.png'); }