Highlighted picture

phgrove

Joined: 2002-10-10
Posts: 101
Posted: Thu, 2003-06-05 07:44

Hi,

I am sure this has been covered before, but when searching i couldn't seem to get a conclusive answer. I have the problem like other that occasionally the random-block choses a highlighted picture, which means the links created don't work. Is there a work around for this? The only way i could see a work around form my simply undertsanding of how php works is to do a check at the beginning of choosing a picture to see
makeAlbumUrl($album->fields["name"], $id)
returns unkown or not. Surely there must be a way this can be done in the scanAlbums() function, the same as only choosin a portrait picture.

Could anyone enlighten me how this function chooses the random picture from the gallery to start off with?

function scanAlbums() { 
    global $cache; 
    global $gallery; 

    $cache = array(); 
    $everybody = $gallery->userDB->getEverybody(); 
    $albumDB = new AlbumDB(); 
    foreach ($albumDB->albumList as $tmpAlbum) { 
    if ($everybody->canReadAlbum($tmpAlbum)) { 
        $seeHidden = $everybody->canWriteToAlbum($tmpAlbum); 
        $numPhotos = $tmpAlbum->numPhotos($seeHidden); 
        $name = $tmpAlbum->fields["name"]; 
        if ($numPhotos > 0) { 
        $cache[$name] = $numPhotos; 
        } 
    } 
    } 
} 

Peter