hi, i don't know if any of you use coppermine, if you do, you know how their support forum makes you try to code everything yourself. Well, what if you can't do it? That's my case in this.
I am using coppermine photo gallery, and i have a page where an image is displayed.
Under the image is a filmstrip, and it shows the previous image, the current image, then the next image.
Like this: PREVIOUS IMG | CURRENT IMG | NEXT IMG
I was wandering if anyone here could help me take out the
CURRENT IMG from the filmstrip. Here is the code:
(in /include/functions.inc.php)
// Prints thumbnails of pictures in an album
function display_film_strip($album, $cat, $pos)
{
global $CONFIG, $AUTHORIZED, $HTTP_GET_VARS;
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;
$max_item=$CONFIG['max_film_strip_items'];
//$thumb_per_page = $pos+$CONFIG['max_film_strip_items'];
$thumb_per_page = $max_item*2;
$l_limit = max(0,$pos-$CONFIG['max_film_strip_items']);
$new_pos=max(0,$pos-$l_limit);
$pic_data = get_pic_data($album, $thumb_count, $album_name, $l_limit, $thumb_per_page);
if (count($pic_data) < $max_item ){
$max_item = count($pic_data);
}
$lower_limit=3;
if(!isset($pic_data[$new_pos+1])) {
$lower_limit=$new_pos-$max_item+1;
} else if(!isset($pic_data[$new_pos+2])) {
$lower_limit=$new_pos-$max_item+2;
} else if(!isset($pic_data[$new_pos-1])) {
$lower_limit=$new_pos;
} else {
$hf=$max_item/2;
$ihf=(int)($max_item/2);
if($new_pos > $hf ) {
//if($max_item%2==0) {
//$lower_limit=
//} else {
{
$lower_limit=$new_pos-$ihf;
}
}
elseif($new_pos < $hf ) { $lower_limit=0; }
}
$pic_data=array_slice($pic_data,$lower_limit,$max_item);
$i=$l_limit;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {
$hi =(($pos==($i + $lower_limit)) ? '1': '');
$i++;
$pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
$lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
$lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
$lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);
$pic_url = get_pic_url($row, 'thumb');
if (!is_image($row['filename'])) {
$image_info = getimagesize($pic_url);
$row['pwidth'] = $image_info[0];
$row['pheight'] = $image_info[1];
}
$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);
$p=$i - 1 + $lower_limit;
$p=($p < 0 ? 0 : $p);
$thumb_list[$i]['pos'] = $key < 0 ? $key : $p;
$thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['filename']}\" title=\"$pic_title\">";
$thumb_list[$i]['caption'] = $row['caption_text'];
$thumb_list[$i]['admin_menu'] = '';
}
return theme_display_film_strip($thumb_list, $thumb_count, $album_name, $album, $cat, $pos, is_numeric($album));
} else {
theme_no_img_to_display($album_name);
}
}