0) { $row = mysql_fetch_assoc($res); extract($row); $i = rand(1, 3); $sFile = 'images/media/youtube/'.$youtube_id.'.jpg'; $file_name = 'youtube-'.$video_id.'.jpg'; } } elseif ($section == 'transtopia') { $aTypes = AcceptableTranstopiaImageTypes(); $sql = 'SELECT gi.image, gi.file_name, g.user_id FROM transtopia__gallery_images gi, transtopia__galleries g WHERE gi.gallery_id = g.gallery_id AND gi.image_id = '.number($image_id).' LIMIT 1'; $res = mysql_query($sql) OR die(mysql_error()); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); extract($row); $sFile = 'images/transtopia/'.$user_id.'/'.$imgsize.'/'.$image; if (isEmpty($file_name)) $file_name = $image; } } elseif ($section == 'comics') { $sql = 'SELECT cc.cover_id, cc.image, c.issue_id, c.title, s.series_id, s.title AS series_title FROM tf_comic_covers cc, tf_comics c, tf_comic_series s WHERE cc.cover_id = '.number($image_id).' AND cc.comic_id = c.comic_id AND c.series_id = s.series_id LIMIT 1'; $res = mysql_query($sql) OR die(mysql_error()); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); extract($row); $sFile = 'images/comics/covers/'.sprintf("%03s", $series_id).'/'.$imgsize.'/'.$image; $file_name = sprintf("%03s", $series_id).'_'.$issue_id.'-'.$cover_id.'_'.$imgsize.'.'.GetFileExtension($image); } } elseif (in_array($section, Array('vsd', 'item'))) { $sql = 'SELECT ci.image_id, ci.image, ic.category, ic.directory, cv.version_name, cv.url FROM tf_character_images ci, tf_image_categories ic, tf_character_versions cv WHERE ci.image_id = '.number($image_id).' AND ci.cat_id = ic.cat_id AND ci.version_id = cv.version_id LIMIT 1'; /* if (isRyan()) { echo $sql; exit(); } */ $res = mysql_query($sql) OR die(mysql_error()); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); extract($row); $sFile = 'images/'.$directory.'/'.$imgsize.'/'.$image; $file_name = $url.'_'.$directory.'-'.$image_id.'-'.$imgsize.'.'.GetFileExtension($image); } } $sType = GetFileExtension($sFile); if (!is_file($_SERVER['DOCUMENT_ROOT'].'/'.$sFile)) { if (is_file(STATIC_PATH.'/'.$sFile)) { $sFile = STATIC_PATH.'/'.$sFile; } else { $sFile = $_SERVER['DOCUMENT_ROOT'].'/'.$sFile; } } else { $sFile = $_SERVER['DOCUMENT_ROOT'].'/'.$sFile; } if (isEmpty($sFile) || isEmpty($sType) || !is_file($sFile) || !in_array($sType, $aTypes)) { $sFile = $_SERVER['DOCUMENT_ROOT'].'/images/spacer.gif'; $sType = 'gif'; } GetFileHeaders($sType, $file_name); //$size = GetImageSize($sFile); if ($sType == 'gif') { $im = imagecreatefromgif($sFile); imagegif($im); } elseif ($sType == 'png') { $im = imagecreatefrompng($sFile); imagepng($im); } else { $im = imagecreatefromjpeg($sFile); imagejpeg($im); } imagedestroy($im); Flush(); Exit(); ?>