0) { $row[$_GET['datafield']] = $row[$_GET['datafield2']]; } //image does not exist /* if ($row === false) { $im = imagecreate(70, 20); $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 255, 0, 0); imagestring($im, 1, 1, 1, 'CANNOT GET', $textcolor); imagestring($im, 1, 1, 10, 'IMAGE [' . $_GET['id'] . ']', $textcolor); header("Content-type: image/png"); imagepng($im); imagedestroy($im); exit; } */ //header("Content-type: image/jpeg"); //todo: add if (isset($_GET['square'])) { $sq = intval($_GET['square']); $resized = false; if (isset($row[$_GET['datafield']])) { $resized = $row[$_GET['datafield']]; } if (empty($resized)) { $fity = @$row['file_type']; if (empty($fity)) if (@$_GET['source'] == 'user_images') $fity = 'user'; if (empty($fity)) if (@$_GET['source'] == 'news') $fity = 'news'; if (empty($fity)) $fity = 'other'; $resized = file_get_contents($root_address . 'images/default_' . $fity . '.png'); } $resized = resize_image($resized, $sq, $sq, 'square'); echo $resized; if (!$nocache) { $sql = "INSERT INTO image_cache ( image_cache_image_id, image_cache_w, image_cache_h, image_cache_resizetype, image_cache_data ) VALUES ( '{$_GET['id']}{$_GET['source']}', '$resizew', '$resizeh', '$resizetype', '" . addslashes($resized) . "' )"; executesql($sql, __LINE__, __FILE__); } } elseif (isset($_GET['full'])) { echo $row[$_GET['datafield']]; } elseif (isset($_GET['maxw']) && isset($_GET['maxh'])) { $w = intval($_GET['maxw']); $h = intval($_GET['maxh']); $resized = $row[$_GET['datafield']]; if (empty($resized)) { $fity = @$row['file_type']; if (empty($fity)) if (@$_GET['source'] == 'user_images') $fity = 'user'; if (empty($fity)) if (@$_GET['source'] == 'news') $fity = 'news'; if (empty($fity)) $fity = 'other'; $resized = file_get_contents($root_address . 'images/default_' . $fity . '.png'); } $resized = resize_image($resized, $w, $h); echo $resized; if (!$nocache) { $sql = "INSERT INTO image_cache ( image_cache_image_id, image_cache_w, image_cache_h, image_cache_resizetype, image_cache_data ) VALUES ( '{$_GET['id']}{$_GET['source']}', '$resizew', '$resizeh', '$resizetype', '" . addslashes($resized) . "' )"; executesql($sql, __LINE__, __FILE__); } } else { //simple show echo $row[$_GET['datafield']]; } } } ?>