include("inc/sys.php"); $id = $_REQUEST['id']; $sn = $_REQUEST['sn']; $zoom = $_REQUEST['zoom']; $query = ''; $PATH_TO_FILES = "/home/alwesign/public_html/fiord"; if (isset($id) || isset($sn) || isset($zoom)) { if (isset($sn)) $query = "select i.* from images i, articles a where i.id = a.icon and a.sysname = '".safeStr($sn)."'"; else if (isset($id)) $query = "select * from images where id = ".safeId($id); else { $query1 = "select ai.image from articles a, articleimages ai where ai.article = a.id and a.sysname = '".safeStr($zoom)."' order by ai.id asc"; $result = mysql_query($query1) or die("> error: ".mysql_error()); $row = mysql_fetch_array($result); $zoomimg = safeId($row['image']); } if ($query) { $result = mysql_query($query) or die("> error: ".mysql_error()); $row = mysql_fetch_array($result); if ($row["path"] && !$row["filename"]) { $zoompath = $row["path"]; } else { if ($row["path"]) { if ($row['id'] && !isset($noclick)) click("image", safeId($row['id'])); $subpath = $row["path"]; if (strpos($subpath, 'db/auto') != false) $subpath = str_replace('db/auto', 'auto', $subpath); header("Location: http://fiord.org/img/".$subpath); exit(); } // if (!isset($noclick)) click("image", safeId($row['id'])); // if ($row['type']) header("Content-type: ".$row['type']); // if ($row['filename']) header('Content-Disposition: attachment; filename="'.$row['filename'].'"'); // if ($row['time']) header("Last-Modified: " . $row['time'] . " GMT"); // $data = str_replace("%%!00!%%", "\\", str_replace("%%!99!%%", "'", $row['data'])); // print($data); } } } if ($zoomimg || $zoompath) { header('Content-Type: text/html; charset=windows-1251'); include("inc/funcs.php"); $fpath = $zoompath?$zoompath:getImagePath($zoomimg); if ($fpath) { $src = "/imgs/".$fpath; if (!file_exists($PATH_TO_FILES.$fpath)) $src = "/img/".$fpath; } else $src = "/image=".$zoomimg; // $src = $fpath?("/imgs/".$fpath):("/image=".$zoomimg); ?>