edit include/functions.inc.php, findfunction display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)
{
global $CONFIG, $AUTHORIZED;
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;
$thumb_per_page = $thumbcols * $thumbrows;
$lower_limit = ($page-1) * $thumb_per_page;
$pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
$total_pages = ceil($thumb_count / $thumb_per_page);
$i = 0;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {
$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(urldecode($pic_url));
$row['pwidth'] = $image_info[0];
$row['pheight'] = $image_info[1];
}
$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);
$thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
$thumb_list[$i]['pid'] = $row['pid'];;
$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'] = bb_decode($row['caption_text']);
$thumb_list[$i]['admin_menu'] = '';
$thumb_list[$i]['aid'] = $row['aid'];
}
theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
} else {
theme_no_img_to_display($album_name);
}
}
and replace withfunction display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)
{
global $CONFIG, $AUTHORIZED;
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;
$thumb_per_page = $thumbcols * $thumbrows;
$lower_limit = ($page-1) * $thumb_per_page;
$pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
$total_pages = ceil($thumb_count / $thumb_per_page);
$i = 0;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {
$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');
$pic_url = get_pic_url2($cat, $album, $key < 0 ? $key : $i - 1 + $lower_limit, 'thumb');
if (!is_image($row['filename'])) {
$image_info = getimagesize(urldecode($pic_url));
$row['pwidth'] = $image_info[0];
$row['pheight'] = $image_info[1];
}
$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);
$thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
$thumb_list[$i]['pid'] = $row['pid'];;
$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'] = bb_decode($row['caption_text']);
$thumb_list[$i]['admin_menu'] = '';
$thumb_list[$i]['aid'] = $row['aid'];
}
theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
} else {
theme_no_img_to_display($album_name);
}
}
Findfunction display_film_strip($album, $cat, $pos)
{
global $CONFIG, $AUTHORIZED;
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(urldecode($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'] = $CONFIG['display_film_strip_filename'] ? '<span class="thumb_filename">'.$row['filename'].'</span>' : '';
$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);
}
}
and replace withfunction display_film_strip($album, $cat, $pos)
{
global $CONFIG, $AUTHORIZED;
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');
$pic_url = get_pic_url2($cat, $album, $i-1+$lower_limit, 'thumb');
if (!is_image($row['filename'])) {
$image_info = getimagesize(urldecode($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'] = $CONFIG['display_film_strip_filename'] ? '<span class="thumb_filename">'.$row['filename'].'</span>' : '';
$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);
}
}
Find?>
and replace withfunction& get_pic_url2($cat, $album, $pos, $mode) {
return 'get_file.php?cat='.$cat.'&album='.$album.'&pos='.$pos.'&size='.$mode;
}
?>
Edit include/slideshow.inc.php, find if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'fullsize');
}
and replace with if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
//$picture_url = get_pic_url($picture, 'normal');
$picture_url = get_pic_url2($_GET['cat'], $_GET['album'], $i, 'normal');
} else {
//$picture_url = get_pic_url($picture, 'fullsize');
$picture_url = get_pic_url2($_GET['cat'], $_GET['album'], $i, 'fullsize');
}
edit include/themes.inc.php, findif (!function_exists('theme_html_picture')) { //{THEMES}
function theme_html_picture()
{
global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
and replace withif (!function_exists('theme_html_picture')) { //{THEMES}
function theme_html_picture()
{
global $cat, $pos, $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
Find if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
} else {
$picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
}
and replace with if ($CONFIG['make_intermediate'] && $condition ) {
//$picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
$picture_url = get_pic_url2($cat, $album, $pos, 'normal');
} else {
//$picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
$picture_url = get_pic_url2($cat, $album, $pos, 'fullsize');
}
Then find// Display the full size image
if (!function_exists('theme_display_fullsize_pic')) { //{THEMES}
function theme_display_fullsize_pic()
{
global $CONFIG, $THEME_DIR, $ALBUM_SET;
and replace with// Display the full size image
if (!function_exists('theme_display_fullsize_pic')) { //{THEMES}
function theme_display_fullsize_pic()
{
global $cat, $album, $pos, $CONFIG, $THEME_DIR, $ALBUM_SET;
Finally, find $row = mysql_fetch_array($result);
$pic_url = get_pic_url($row, 'fullsize');
$geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
$imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
}
and replace with $row = mysql_fetch_array($result);
//$pic_url = get_pic_url($row, 'fullsize');
$pic_url = get_pic_url2($cat, $album, $pos, 'fullsize');
$geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
$imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
}
Warning: code in include/themes.inc.php may be overridden by theme code. Theme code possibly needs editing as well.