I found the problem now that is bugging me. Haven't got a final solution yet, but at least I know now where the problem came from. It could be interesting to some of you who might come across this problem as well after they've included the same modifications as I did by now.
Besides other visual modifications I have also included the
LightBox JS for Fullsize Popup Image. But because in that thread it is is pretty chaotic to find the final solution code, I was using the following lines in
themes.php which were derived from a
post by SaWey over there:
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
//Second part of lightbox update
function lightbox_list($picId)
{ $i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
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');
}
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"Click to view full size image\" /><br />";
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}
//End of second part
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
There is a another modification needed in the same file which can be found in the
function theme_html_picture()
...
if ($mime_content['content']=='image') {
if (isset($image_size['reduced'])) {
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
//First part of lightbox update
$pic_html = lightbox_list($CURRENT_PIC_DATA['pid']);
//End of first part
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
} else {
...
I was adding a minor modification to that because I wanted some DHTML tooltip appearing on the mousepointer (fully explained
here):
function theme_html_picture()
{
global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
global $album, $comment_date_fmt, $template_display_media;
global $lang_display_image_php, $lang_picinfo, $lang_display_thumbnails;
global $mypicinfo;
the last line is added here. The next changes are followed a little further down:
if ($mime_content['content']=='image') {
$pic_title3 = $lang_picinfo['Album name']." : ". $mypicinfo['album']."\n".
$lang_display_thumbnails['filename'].$CURRENT_PIC_DATA['filename']."\n".
$lang_display_thumbnails['filesize'].($CURRENT_PIC_DATA['filesize'] >> 10).$lang_byte_units[1]." kB\n".
$lang_display_thumbnails['dimensions'].$CURRENT_PIC_DATA['pwidth']."x".$CURRENT_PIC_DATA['pheight']." Pixel\n".
$lang_picinfo['Date Added']." : ". $mypicinfo['date']."\n".
$lang_picinfo['Displayed']." : ". $mypicinfo['disp']."\n";
if ($mypicinfo['votes'] != "") {
$pic_title3.= sprintf($lang_picinfo['Rating'], $mypicinfo['votes'])." : ". str_repeat("*",(int)$mypicinfo['rating']);
$pic_title3=str_replace("(1 Stimmen","(1 Stimme",$pic_title3);
$pic_title3=str_replace("(1 Votes","(1 Vote",$pic_title3);
}
$pic_title2=str_replace("\n","<br />",$pic_title3);
$onmousetxt="Tip('$pic_title2')";
if (isset($image_size['reduced'])) {
$onmousetxt="Tip('$pic_title2"."<br /><br />".$lang_display_image_php['view_fs']."')";
$pic1_html = "onmouseover=\"" . $onmousetxt . "\" ";
// First part of lightbox update
$pic_html = lightbox_list($CURRENT_PIC_DATA['pid'],$pic1_html);
$pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
// End of first part of lightbox update
} else {
$pic_html = "<img onmouseover=\"" . $onmousetxt . "\" src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
}
} elseif ($mime_content['content']=='document') {
...
The rest remained unchanged here. My modified second part of the Lightbox JS script looks like this
//Second part of lightbox update
function lightbox_list($picId,$pic1_html) {
global $lang_display_image_php, $CONFIG;
$i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'normal');
}
$picture_url_fullsize = get_pic_url($picture, 'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($picture['pid'] == $pid) {
$picList .= "<a ".$pic1_html."href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
} //End of second part
I hope you can spot the differences and see my goal behind it. It was leading to a result that can be watched
here for example. But in the very same example you can also see the error I was talking already earlier about in the first post of this thread! If you click on the link shown underneath the image
http://www.hair-factory10.de/xg/displayimage.php?pos=-737it will tell you
The selected album/file does not exist ! in that gallery too!
So I was already having that problem before but never noticed it in that earlier adoption of my modified version of cpg 1.4.12. And I don't think that error is due to my own modifications on the code, which means it was somehow errorneous before anyhow. However it is not so easy to find, as many links will work correctly.
I still don't know exactly why that error comes up, but after I changed some bits of the code to a later adoption of the Lightbox JS mod script, it disappeared. Yet, there is another error happening right now, but I will follow that track...
After I was asking in the Lightbox thread about solution to reduce the number of images for the slideshow for those cases of large gallery libraries, he
answered and pointed me to a different implementation of the Lightbox JS script in
here:
//Second part of lightbox update
function lightbox_list($picId)
{
$i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'normal');
}
$picture_url_fullsize = get_pic_url($picture, 'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"Klik op de foto om originele grootte te bekijken\" /><br />";
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
} //End of second part
After I was using this code I don't see my initial errorneous behaviour with the message
'The selected album/file does not exist' anymore!
Instead I am now getting to see an empty image
- but I guess that should be easy to find. At least I hope that.
cu,
Roli
°¿°