[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Update: gleipnir
- To: cvs@lists.cleannorth.org
- Subject: CVS Update: gleipnir
- From: Dan Brosemer <odin@cleannorth.org>
- Date: Sun, 17 Aug 2008 14:59:02 -0400 (EDT)
- List-help: <mailto:cvs-request@lists.cleannorth.org?subject=help>
- List-post: <mailto:cvs@lists.cleannorth.org>
- List-subscribe: <mailto:cvs-request@lists.cleannorth.org?subject=subscribe>
- List-unsubscribe: <mailto:cvs-request@lists.cleannorth.org?subject=unsubscribe>
- Resent-date: Sun, 17 Aug 2008 14:59:05 -0400 (EDT)
- Resent-from: cvs@lists.cleannorth.org
- Resent-message-id: <S7y2SC.A.78F.PUHqIB@skroob.cleannorth.org>
- Resent-sender: cvs-request@lists.cleannorth.org
Log Message:
-----------
I suppose I should unlink the pictures after deletion.
Modified Files:
--------------
gleipnir/public_html/gallery:
picture.pl
Revision Data
-------------
Index: picture.pl
===================================================================
RCS file: /cvs/gleipnir/public_html/gallery/picture.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lpublic_html/gallery/picture.pl -Lpublic_html/gallery/picture.pl -u -r1.7 -r1.8
--- public_html/gallery/picture.pl
+++ public_html/gallery/picture.pl
@@ -113,15 +113,19 @@
my $pictureid = $cgi->param('id')||($ENV{PATH_INFO} =~ m%/(\d+)\.(jpg|png|jpeg)$%i)[0];
my $SQL = <<EOT;
-select gp.gallery, g.gid from gallery_picture gp left join gallery g
+select gp.gallery, g.gid, thumb_path, image_path, original_path from gallery_picture gp left join gallery g
on gp.gallery = g.galleryid
where pictureid = ?
EOT
my $cursor = $dbh->prepare($SQL);
$cursor->execute($pictureid);
- my ($gallery, $gid) = $cursor->fetchrow;
+ my ($gallery, $gid, $thumb, $image, $original) = $cursor->fetchrow;
return $gleipnir->error('403') if defined($gid) and !$gleipnir->ingroup($gid);
+
+ unlink($gleipnir->cfetch(dirs => 'imagedir').'/'.$image);
+ unlink($gleipnir->cfetch(dirs => 'thumbdir').'/'.$thumb);
+ unlink($gleipnir->cfetch(dirs => 'originals').'/'.$original);
$SQL = <<EOT;
delete from gallery_picture
- Prev by Date: CVS Update: gleipnir
- Next by Date: CVS Update: gleipnir
- Previous by thread: CVS Update: gleipnir
- Next by thread: CVS Update: gleipnir
- Index(es):