PDA

View Full Version : PHP Photo Album script v2.11 use image names as caption



hecctor
11-06-2009, 01:15 AM
1) Script Title: PHP Photo Album script v2.11 use image names as caption

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm#note

3) Describe problem: is there way to use the image name as caption in the thumbnail?, but without the file extensions, .jpg, .gif, ETC.

Thank You

jscheuer1
11-06-2009, 02:42 PM
You can use the 'manual' descriptions for that, ex:


<script type="text/javascript">

//Optional, manual description for particular pictures inside album
//Syntax: albumid.desc[index]="Picture description here"
//eg: myvacation.desc[2]="This is description for the 3rd picture in the album"
//eg: myvacation.desc[6]="This is description for the 7th picture in the album"

;(function(id){
for(var i = 0; i < id.images.length; ++i){
id.desc[i] = id.images[i][1].replace(/\.[^\.]+$/, '');
}
})(myvacation);

</script>

Where myvacation is the albumid for that album.

hecctor
11-08-2009, 09:15 PM
Thank you very much John
your code works great :)