[Freerealty] Another problem - deleting images..
Patrick Fleming, EA
pat at rwcinc.net
Sun May 1 15:57:33 MST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I actually was working on this early this morning - about 3am :) If you
have hacked at your admin.php file at all then you might not want the
new file (which incidentally is not yet uploaded :() Check out the
changes below - this also applies to agentadmin.php so some bug fixes
are due to be uploaded.
Actually I just realized that I hadn't applied these changes to
admin.php yet... just to agentadmin.php so it's time to edit admin.php too.
Scott Wang wrote:
| --------------------------
| This is the code I have in admin.php that does the deleting (I didn't
change
| anything from the original)
| --------------------------
|
| //DELETE A RECORD
|
| if (isset($delete) && $delete != "")
| {
| $query = "delete from ".$table_prefix."homes_features where ref_homes =
| $delete";
| mysql_query ($query, $link);
| $query = "DELETE FROM ".$table_prefix."homes WHERE (id = '$delete')";
| if (!mysql_query ($query, $link) )
| {
| die (mysql_error());
| }
| print "Listing #$delete has been removed...";
| if (isset($images_use) && $images_use == "folders" )
| {
| //Get the image information....
| $sql = "select id_files, filename from ".$table_prefix."tbl_Files where
| id_files = $deleteimage ";
$sql = "select id_files, filename from ".$table_prefix."tbl_Files where
id_files = $delete"; <- replace $deleteimage with $delete
| $image_query = mysql_query($sql, $link);
| Line 64 --> $image_result = mysql_fetch_array($image_query);
~ ^^^^^^^
~ |||||||
while ($image_result = mysql_fetch_array($image_query))
~ {
| unlink
|
("$install_path/$imageloc/listings/$image_result[id_files]"."_"."$image_resu
| lt[filename]");
| unlink
|
("$install_path/$imageloc/listings/$image_result[id_files]"."_"."thumb"."_".
| "$image_result[filename]");
~ } <-- Insert after
|
| }
|
| $query = "DELETE FROM ".$table_prefix."tbl_Files WHERE (prop_num =
| '$delete')";
This is ok... removes the db reference.
|
| if (!mysql_query ($query, $link) )
| {
| die (mysql_error());
| }
| print "Images for property #$delete have also been removed...";
|
| ------------------------------
|
| The listing itself gets deleted just fine, but the images do not get
| deleted. I do have the images folder set to 777 so permissions
shouldn't be
| a problem.
|
|
|
| - Scott Wang
| Scott's Computing
| P.O. Box 472 Thorp, WI 54771
| Office: 715-669-5412 Fax: 715-669-5413
| Email: scott at scottscomputing.com
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCdV7dGzHR7DxVKWIRAr2BAJ9D/B5lr7sWFHdYnp3dQyjRO/80PQCfcwfb
HTzQ+9IsjqP6LxxtkPEJoCo=
=iWjf
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3383 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rwcinc.net/pipermail/freerealty/attachments/20050501/032aae71/smime.bin
More information about the FreeRealty
mailing list