OK, two problems. First, in our little added script fragment:
Code:
(function(groupName){
var d = document.createElement('div'), tmpLink = document.createElement('a'),
lbLink, arObj = window[groupName];
arObj.hiddenLinks = d.getElementsByTagName('a');
d.style.display = 'none';
tmpLink.rel = 'lightbox[' + groupName + ']';
for(var i = 0; i < arObj.images.length-1; ++i){
lbLink = tmpLink.cloneNode(false);
lbLink.href = arObj.baseurl + arObj.images[i][1];
// if(arObj.desc){
lbLink.title = arObj.images[i][2];
//}
d.appendChild(lbLink);
}
document.body.insertBefore(d, document.body.firstChild);
})('bilder');
Although, according to standards established for this method, it should create a live reference to the node list of a tags in the created divison that will always be current no matter what we do to it, in IE it apparently does not. There could be various reason for this. My bet is that the div is not attached to the DOM yet, but it could also be a failure to update, or something else. In any case, this can be fixed for IE and not adversely affect others by doing it after the links are there and after it is a part of the DOM:
Code:
(function(groupName){
var d = document.createElement('div'), tmpLink = document.createElement('a'),
lbLink, arObj = window[groupName];
d.style.display = 'none';
tmpLink.rel = 'lightbox[' + groupName + ']';
for(var i = 0; i < arObj.images.length-1; ++i){
lbLink = tmpLink.cloneNode(false);
lbLink.href = arObj.baseurl + arObj.images[i][1];
// if(arObj.desc){
lbLink.title = arObj.images[i][2];
//}
d.appendChild(lbLink);
}
document.body.insertBefore(d, document.body.firstChild);
arObj.hiddenLinks = d.getElementsByTagName('a');
})('bilder');
That will fix it for IE 8. But for IE 7, and presumably less, there is an additional problem. Though I cannot see its PHP source code, I'm betting that you've altered this line (or in some other way altered something) in the getalbumpics.php file:
PHP Code:
echo " [$curimage, \"$file\", \"$filedate\"],\n";
to somehow replace the file date reference with one to the name of the file minus its extension. But this is the date field! And you've chosen to sort your images by date:
Code:
new phpimagealbum({
albumvar: bilder, //ID of photo album to display (based on getpics.php?id=xxx)
dimensions: [4,3],
sortby: ["date", "asc"], //["file" or "date", "asc" or "desc"]
autodesc: "%d", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
showsourceorder: false, //Show source order of each picture? (helpful during set up stage)
onphotoclick:function(thumbref, thumbindex, thumbfilename){
Lightbox.box.start(bilder.hiddenLinks[thumbindex])
}
})
The function for this in ddphpalbum.js expects a number. All other browsers seem content to make some kind of accommodation to the fact that this isn't a number, but IE 7 does not. As a result it doesn't even display the thumbnails. You could just change the sort to "file":
Code:
sortby: ["file", "asc"], //["file" or "date", "asc" or "desc"]
And that will take care of that, but it will throw off the order of the link's index for next/previous. But even in those browsers that have no problem with that in the first place, they aren't sorting at all, just taking the order of the images as they were found in the folder in the first place. So, you may change it to:
sortby: ["none", "asc"], //["file" or "date", "asc" or "desc"]
But that still won't completely fix it because the ddphpalbum.js file will still attempt to sort by date unless you change this line in it:
Code:
else //sort by date (asc)
to:
Code:
else if (setting.sortby[0]=="date") //sort by date (asc)
Bookmarks