Hi, I bought a PHP script for property sales, the trouble I am finding is that the script uploads the images from the site OK, resizes all of the thumbnails OK but does not automatically resize the full image or the settings are too large. Once you click on any thumbnail, the image is the size tha was uploaded, enormous!!

I assume the settings for this are somewhere in the "Include" files and have found the addphoto.php file as below, I have highlighted the line that may need changing, is this the correct line to make the numerical change and in the right file to customise the uploaded images appearance after the thumbnail is clicked to view it?

<div class="content">
<?php
if ($form[email]!=""){
#check login
include ("./includes/blocks/login-check.php");
}
if (!$_SESSION[email]){
include ("./includes/blocks/login-form.php");
}
else {

Webpage start

print "<h1>Advertise with us</h1>";
print "<h2>Add a photo</h2>";
if (!$userfile){
#form for new photo
print <<< photoForm
You must complete this form to upload a photo. All photos will be immediatly visible.<br><br>
<form enctype="multipart/form-data" action="" method="POST">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="tdright">Address: </td>
<td class="td-topfield"><select name="form[property]">
photoForm;
#here we need to display all albums
$sql = "SELECT id, address FROM property_tbl WHERE lease='$lease' AND owner='$_SESSION[userid]'";
$result = mysql_query($sql) or die(mysql_error());
while ($details = mysql_fetch_array($result)){
$details[address]=str_replace("\n", ", ", $details[address]);
print "<option value=\"$details[id]\">$details[address]</option>\n";
}
print <<< photoForm
</select></td>
</tr>
<tr>
<td class="tdright">File to upload: </td>
<td class="td-midfield">
<input type="hidden" name="linkname" value="addphoto" />
<input type="hidden" name="lease" value="$lease" />
<input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
<input name="userfile" type="file" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="td-bottomfield"><input type="submit" value="Upload!" class="formsubmit" /></td>
</tr>
</table>
</form>
photoForm;
}
else{
#write to database

print "Thank you! Your photo has been uploaded to the property you chose.<br>You may <a href=\"?linkname=$linkname&lease=$lease\">upload another photo</a>.<br><br>";

$file_name = $_FILES['userfile']['tmp_name'];
$info = getimagesize ("$file_name");
$data = addslashes(fread(fopen($file_name, "r"), filesize($file_name)));

#check ownership and write if correct
$sql = mysql_query("SELECT owner FROM property_tbl WHERE id='$form[property]'");
$result = mysql_fetch_array($sql);
if ($result[owner]==$_SESSION[userid]) {
MYSQL_QUERY("INSERT INTO pictures_tbl (property,bin,x,y,type) VALUES ('$form[property]','$data','$info[0]','$info[1]','$info[mime]')");
}

}}

?><br />
<br />
<a href="./advertise.php">Back</a>
</div>

Thanks

    Write a Reply...