Access Denied\n"; echo"You do not have access to this item."; include"$page_footer"; echo"\n"; exit; } } //List Page Preview Variables // defaults $preview_width = "200"; $preview_height = "150"; // limits $preview_width_max = "690"; $preview_height_max = "520"; ?>

Item Previews ::

\n"; } unset($i); $sql = "SELECT * FROM `previews` TP WHERE `ID`='$id' ORDER BY `PreviewID`"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $num_results = mysql_num_rows($sql_result); if ($num_results>"0") { ?>
&function=updatepreviews"> $dest_height_fixed) { $dest_height = $dest_height_fixed; $dest_width = ($src_width * $dest_height) / $src_height; } } echo"

Preview #$i - $caption

\n"; echo"$filename ($src_width x $src_height) $filesize"."Kb"; if ($preview=="YES") {echo" (List Page Preview)";}echo"
\n"; if ($nopopup != "true") {echo"";} echo"\"$caption\""; if ($nopopup != "true") {echo"";} echo"
\n"; echo"\n"; echo"Edit Caption: "; if ($preview == "YES" OR ( $src_width<="$preview_width" AND $src_height <="$preview_height")) { echo"  List Page Preview?
\n"; } else { echo"List Item Preview?
\n"; } echo"Delete File?
\n"; } ?> "0") { ?> ">

Add Preview

$preview_width_max) {$width=$preview_width_max;} if ($height > $preview_height_max) {$height=$preview_height_max;} $dest_width="$width"; // Destination Width /$tn_size_width $dest_height_fixed="$height"; // Destination Height / $tn_size_height (Fixed) $dest_height= ($src_height * $dest_width) / $src_width; // (Aspect Ratio Variable Height if ($dest_height>$dest_height_fixed) { $dest_height = $dest_height_fixed; $dest_width = ($src_width * $dest_height) / $src_height; } $quality="80"; // JPEG Image Quality $outputpath="$websitepath/$previewpath"; //path of output image ;-) if ($type=="2") { $src_img = imagecreatefromjpeg("$sourcepath"); } else if ($type=="3") { $src_img = imagecreatefrompng("$sourcepath"); $quality="95"; } $dst_img = imagecreatetruecolor($dest_width,$dest_height); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height); imageinterlace($dst_img, 1); $white = ImageColorAllocate($dst_img, 255, 255, 255); //Make a couple of size corrections for the auto-border feature.. $dest_width = $dest_width-1; $dest_height = $dest_height-1; imagerectangle ($dst_img, 0, 0, $dest_width, $dest_height, $white); $status = imagejpeg($dst_img, "$outputpath", $quality); imagedestroy($src_img); imagedestroy($dst_img); if ($status=="1") { //Lets attempt to add the record to the DB. if (checkFormKey()) { $sql = "INSERT INTO `previews` (`PreviewURI`,`ID`,`caption`,`preview`) VALUES ('/$previewpath','$id','$caption','$preview');"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result=="1") { echo"Your File $filename ($filesize bytes) has been successfully uploaded and added to the database. Click here to refresh this page to show the added entry for editing.

"; } } } } else { echo"The image you uploaded has errors and could not be processed successfully. The image may be corrupt or not in the correct format. This tool only supports jpeg and png images. Please try your operation again.

\n"; } } ?>
&function=addpreview" enctype="multipart/form-data"> Only PNG or JPG images are supported for addition to the preview screenshots page for your item. Check the "List Page Preview" box if you'd like the image to be featured on the list and the top of the item details pages. To just have it added to your screenshots page, leave the box unchecked
List Page Preview?
Image Width: x Height:
Fill in the image width and height fields above to have the site resize your image for you. Otherwise, leave Width and Height as 0 (the default) for full-size (limited to , anything larger will be auto-resized). This setting is ignored for preview images, which have strict size requirements of .

Image Caption: