set the permissions to " approve by administrators ".
Upload an image into the mentioned subalbum.
Go back to the categorie:
You will see :
Images: 1
Last image: "empty image name" from "Guest" at "01.01.1970"
Reason:
In " gallery/includes/functions_display.php "
we grap the "last image" in the first sql statement. ( $album[$i]['last_image'] )
But in the section:
// ------------------------------------------
// Get Last Pic of this Category
// ------------------------------------------
we are trying to grap the last_image infos, even if they are disapproved....
so, if the image is disapproved, the query will be empty.
- Code: Select all
// ----------------------------
// Check Pic Approval
// ----------------------------
if (($album[$i]['album_approval'] == ALBUM_ADMIN) || ($album[$i]['album_approval'] == ALBUM_MOD))
{
$pic_approval_sql = 'AND p.image_approval = 1';
}
else
{
$pic_approval_sql = '';
}
[.....]
WHERE p.image_id = ' . $album[$i]['last_image'] . ' ' . $pic_approval_sql . '
If we remove the $pic_approvel_sql from the sql statement, the last disapproved image will be shown correctly on the catergory index. ( image_id, image_name, user_id, username and so on )
I a user clicks now on the link to the last (disapproved) image, he will be informed, that he has not the permission to view this (disapproved) image.
So, what shall we do ?
