...in index.php related to $visibility variable
in Coppermine 1.2.1 standalone.
Where can I post the fix?
Regards :D
edited to add the row "in Coppermine 1.2.1 standalone."
Here's a good place to start. If the team agree it's a bug and fix, they will move it to the bug/fix board. Us ordinary mortals can't do that. :wink:
In /index.php in function list_albums at line 330 (look at lines between // * BUG *) :
if (isset($cross_ref[$aid])) {
$alb_stat = $cross_ref[$aid];
$count = $alb_stat['pic_count'];
} else {
$alb_stat = array();
$count = 0;
}
// Inserts a thumbnail if the album contains 1 or more images
if ($count > 0) {
// * BUG *
$visibility = $alb_thumb['visibility'];
// * BUG *
if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || strstr(USER_GROUP_SET, $visibility)) {
if ($alb_thumb['filename']) {
$picture = &$alb_thumb;
} else {
$sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
$result = db_query($sql);
$picture = mysql_fetch_array($result);
mysql_free_result($result);
}
$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . get_pic_url($picture, 'thumb') . "\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
} elseif ($CONFIG['show_private']) {
$image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/private.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
}
} else {
$image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
}
// Prepare everything
// * BUG *
if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || $visibility == $USER_DATA['group_id']) {
// * BUG *
$last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
$alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
$alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
$alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
$visibility has a value only if $count>0.
The fix (between lines // * BUG FIX *):
if (isset($cross_ref[$aid])) {
$alb_stat = $cross_ref[$aid];
$count = $alb_stat['pic_count'];
} else {
$alb_stat = array();
$count = 0;
}
// * BUG FIX *
$visibility = $alb_thumb['visibility'];
// * BUG FIX *
// Inserts a thumbnail if the album contains 1 or more images
if ($count > 0) {
// * BUG FIX *
// *moved up* $visibility = $alb_thumb['visibility'];
// * BUG FIX *
if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || strstr(USER_GROUP_SET, $visibility)) {
if ($alb_thumb['filename']) {
$picture = &$alb_thumb;
} else {
$sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
$result = db_query($sql);
$picture = mysql_fetch_array($result);
mysql_free_result($result);
}
$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . get_pic_url($picture, 'thumb') . "\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
} elseif ($CONFIG['show_private']) {
$image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/private.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
}
} else {
$image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
$alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
}
// Prepare everything
if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || $visibility == $USER_DATA['group_id']) {
$last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
$alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
$alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
$alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
That's all :)
see http://forum.coppermine-gallery.net/viewtopic.php?p=14255#14255 and http://forum.coppermine-gallery.net/index.php?topic=3238
GauGau