Problem, big problem. It throws a generic database error for guests/people not logged in. Works fine if you're logged in.
This is the code causing the problem:
Code:
if(!(can_moderate(0, 'caneditalbumpicture')) OR !(can_moderate(0, 'candeletealbumpicture')))
{ $getpicturesstate = (($getpicturesuser) ? ' AND' : '') . ' (album.state = \'public\' OR (NOT ISNULL(userlist.relationid) AND album.state = \'private\'))'; }