Open include/search.inc.php, find
starttable('100%', $lang_meta_album_names['album_search'],2);
while ($alb = mysql_fetch_assoc($result)) {
$thumb_query = "SELECT filepath, filename, url_prefix, pwidth, pheight "
." FROM `{$CONFIG['TABLE_PICTURES']}` "
." WHERE (`aid` = '{$alb['aid']}') "
." AND approved = 'YES' "
." ORDER BY `pid` DESC";
$thumb_result = cpg_db_query($thumb_query);
$thumb = mysql_fetch_assoc($thumb_result);
// TODO: query above only pulls in last_pid in each album, not correct album thumb as set by user
$thumb_url = get_pic_url($thumb, 'thumb');
$thumb_size = compute_img_size($thumb['pwidth'], $thumb['pheight'], $CONFIG['alb_list_thumb_size'], true, 'cat_thumb');
?>
<tr>
<td colspan="3" height="1" valign="top" class="tableh2">
<span class="alblink"><a href="<?php printf("thumbnails.php?album=%u", $alb['aid']); ?>"><?php echo $alb['title'] ?></a></span>
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
</td>
</tr>
<tr>
<td>
<a href="<?php printf("thumbnails.php?album=%u", $alb['aid']); ?> ">
<img src="<?php echo $thumb_url?>" class="image" <?php echo $thumb_size['geom'] ?> border="0" alt="<?php echo $thumb['filename'] ?>">
</a>
</td>
<td width="100%" valign=top>
<?php if ($alb['description'] == "") { echo ' '; } else { echo $alb['description']; } ?>
</td>
</tr>
<?php
}
endtable();
echo '<br/>';
and replace with
global $template_thumbnail_view;
$template_thumbnail_view_tmp = $template_thumbnail_view;
$thumb_cell = template_extract_block($template_thumbnail_view_tmp, 'thumb_cell');
$empty_cell = template_extract_block($template_thumbnail_view_tmp, 'empty_cell');
$row_separator = template_extract_block($template_thumbnail_view_tmp, 'row_separator');
$i = 0;
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
starttable('100%', $lang_meta_album_names['album_search'], $thumbcols);
while ($alb = mysql_fetch_assoc($result)) {
$thumb_query = "SELECT filepath, filename, url_prefix, pwidth, pheight "
." FROM `{$CONFIG['TABLE_PICTURES']}` "
." WHERE (`aid` = '{$alb['aid']}') "
." AND approved = 'YES' "
." ORDER BY `pid` DESC";
$thumb_result = cpg_db_query($thumb_query);
$thumb = mysql_fetch_assoc($thumb_result);
// TODO: query above only pulls in last_pid in each album, not correct album thumb as set by user
$thumb_url = get_pic_url($thumb, 'thumb');
$thumb_size = compute_img_size($thumb['pwidth'], $thumb['pheight'], $CONFIG['thumb_width'], true, 'cat_thumb');
$params = array(
'{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => 'thumbnails.php?album='.$alb['aid'],
'{THUMB}' => '<img src="'.$thumb_url.'" class="image thumbnail" '.$thumb_size['geom'].' border="0" alt="'.$thumb['filename'].'">',
'{CAPTION}' => '<span class="thumb_title thumb_title_title">'.$alb['title'].'</span>',
'{ADMIN_MENU}' => '',
);
echo template_eval($thumb_cell, $params);
if ((($i % $thumbcols) == 0) && ($i < mysql_num_rows($result))) {
echo $row_separator;
}
$i++;
}
for (;($i % $thumbcols); $i++) {
echo $empty_cell;
}
endtable();
echo '<br/>';