forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: Davis on August 23, 2009, 04:13:50 pm

Title: [Solved]: Album Thumbnail Issue
Post by: Davis on August 23, 2009, 04:13:50 pm
In my gallery I have 8 albums.  Under "Album Properties" each album is set up to use "Last Uploaded" as the Album Thumbnail.  When anyone uploads a picture I allow them to choose which of the 8 albums they feel it belongs in but I must approve it before it is posted.  

The issue I am having is that when someone uploads a picture to my gallery it automatically becomes the thumbnail for the album they choose to put it in even though I haven't approved it. I get an email that I have an upload to approve, I go to my site, the picture is indeed waiting to be approved, but it is already displaying as the thumbnail for whatever album the uploader decided it should go in.  

I have been told that it should not work this way and that something has been changed in the code of my coppermine install to make it behave this way but I have no idea where to look or how to get this issue fixed.  Can anyone help me figure this out?

Thanks
Davis
Title: Re: Album Thumbnail Issue
Post by: Nibbler on August 23, 2009, 04:27:04 pm
You need to give us more to go on. Post a link to your gallery, enable debug mode for all and have a non-approved pic displaying as album thumbnail.
Title: Re: Album Thumbnail Issue
Post by: Davis on August 23, 2009, 04:35:42 pm
Okay here is the link to my gallery http://www.bundalover.com/pics/index.php [NOT WORK SAFE]

If you look at the Album "Short Shorts" there is a picture of three girls in white shorts.  That picture is a picture that has not been posted in that album yet.  If you click on the album you will not see that picture.

I have enable debug mode for all.
Title: Re: Album Thumbnail Issue
Post by: Nibbler on August 23, 2009, 04:51:19 pm
From your debug output:

Code: [Select]
SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg15x_pictures WHERE aid = '12' ORDER BY ctime DESC LIMIT 1

That's not a normal part of Coppermine and it's not checking if the pic is approved.
Title: Re: Album Thumbnail Issue
Post by: Davis on August 23, 2009, 05:13:32 pm
Nibbler thanks for responding so quickly!  Is there something I could easily add to this line of code to make it check to see if the pic is approved?

Here is the line of code from my index.php

$sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '{$aid}' ORDER BY ctime DESC LIMIT 1";
Title: Re: Album Thumbnail Issue
Post by: Nibbler on August 23, 2009, 06:17:36 pm
Easily,

Code: [Select]
$sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '{$aid}' AND approved = 'YES' ORDER BY ctime DESC LIMIT 1";
Title: Re: Album Thumbnail Issue
Post by: Davis on August 23, 2009, 06:25:11 pm
Thank you so much my good man! That worked perfectly!  I truly appreciate your help!

Davis