In modifyalb.php, in function form_alb_thumb($text, $name)
REPLACE:
echo <<<EOT
<tr>
<td class="tableb" valign="top">
$text
</td>
<td class="tableb" valign="top">
<i>{$lang_modifyalb_php['alb_empty']}</i>
<input type="hidden" name="$name" value="0">
</td>
</tr>
EOT;
return;
WITH:
$results = cpg_db_query("SELECT pid, filepath, filename, url_prefix FROM {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' AND keywords like '%{$ALBUM_DATA['keyword']}%' ORDER BY filename");
/* echo <<<EOT
<tr>
<td class="tableb" valign="top">
$text
</td>
<td class="tableb" valign="top">
<i>{$lang_modifyalb_php['alb_empty']}</i>
<input type="hidden" name="$name" value="0">
</td>
</tr>
EOT;
return;*/
The functions to work with in index.php are list_albums() and list_cat_albums($cat = 0).
I managed to fix the "no thumbnail selected" issue for thumbnails that belong to categories to show up when the thumbnails are from keyword albums. However, I don't know how to make it work when an album is not in a category, or is $cat=0. Basically, list_albums() seems to work as it should, but I don't know how to get the same result from list_cat_albums($cat = 0).
edits for list_albums():
FIND:
global $cat;
REPLACE with:
global $cat, $link_pic_count;
FIND:
} else { // Inserts an empty thumbnail if the album contains 0 images
BEFORE it, ADD:
} elseif ($link_pic_count > 0) {
if ($alb_thumb['filename']) {
$picture = &$alb_thumb;
$pic_url = get_pic_url($picture, 'thumb');
$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$picture['filename']}\" />";
} else {
$cpg_nopic_data = cpg_get_system_thumb('nopic.jpg', $alb_thumb['category']);
$alb_list[$alb_idx]['thumb_pic'] = '<img src="' . $cpg_nopic_data['thumb'] . '" ' . $cpg_nopic_data['whole'] . ' class="image" border="0" alt="" />';
}
To see a keyword album with a thumbnail in cat 0, edit the function:
FIND:
if ($count > 0)
REPLACE with:
if ($count >= 0)
That's not good code since it doesn't take into account when no thumbnail is assigned. However, it's good for troubleshooting to make sure that the assigned thumbnail is being recognized.