It's a bug in the script. The script is sorting the array after the descriptions are assigned, so if the files weren't already in the final order (as in the case of Host#2) everything gets out of order. In ddphpalbum.js replace its function phpimagealbum with this one:
Code:
function phpimagealbum(setting){
this.albumvar=setting.albumvar
this.albumvar.images.pop() //remove last "dummy" array element
this.albumdivid='phpphotoalbum'+(++phpimagealbum.routines.albumcount)
this.dimensions=setting.dimensions || [3,3]
this.sortby=setting.sortby || ["file", "asc"],
this.autodesc=setting.autodesc
this.showsourceorder=setting.showsourceorder
this.onphotoclick=setting.onphotoclick || function(){}
this.photodivs=[] //array referencing each DIV that contains a slide
this.navlinks=null //HTML collection
if (setting.sortby[0]=="file") //sort by filename (asc)
this.albumvar.images.sort(function(a,b){return a[1].localeCompare(b[1])})
else //sort by date (asc)
this.albumvar.images.sort(function(a,b){return new Date(a[2])-new Date(b[2])})
if (setting.sortby[1]=="desc"){
this.albumvar.images.reverse()
}
for (var i=0; i<this.albumvar.images.length; i++){
if (this.albumvar.desc[i]) //if a manual desc exists for this image
this.albumvar.images[i][3]=this.albumvar.desc[i] //extend image array with desc
}
this.buildgallery()
this.buildnav()
}
In case you're interested, the highlighted part is where the descriptions get assigned. It had been above the section where things get sorted, much closer to the beginning of the function. I moved it to just after the sorting, so its descriptions will go with the new sort order.
Speaking of the sort order, on index2.html, the sort order will not change (it's dictated by the sorting method and the order in which the files were uploaded to Host#2), but the descriptions will now each be with the proper image.
Bookmarks