Preview picture in upload window.
-
Hello everyone. Made a change to the b2upload.php so that the image being uploaded can be previewed. The width and height is also grabbed and added to the code that is fed back to the post page.
if ( ereg('image/',$img1_type)) {
list($width, $height)=getimagesize("/your/path/to/images/$img1_name");
$piece_of_code = "<div align="center"><img src="$fileupload_url/$img1_name" border="0" width="$width" height="$height" alt="$imgdesc" /></div>";
} else {
$piece_of_code = "$imgdesc";
};
?>
<form>
<input type="button" name="close" value="Now add the code to your post" class="search" onClick="targetopener('<?php echo $piece_of_code; ?>')" style="margin: 2px;" />
</form>
<?php echo "<img src=\"$fileupload_url/$img1_name\" border=\"0\" width=\"$width\" height=\"$height\" alt=\"$imgdesc\" />
"; ?>
- The topic ‘Preview picture in upload window.’ is closed to new replies.