Results 1 to 3 of 3

Thread: PHP Photo Album script v2.11 use image names as caption

  1. #1
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album script v2.11 use image names as caption

    1) Script Title: PHP Photo Album script v2.11 use image names as caption

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...album.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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You can use the 'manual' descriptions for that, ex:

    Code:
    <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.
    Last edited by jscheuer1; 11-06-2009 at 02:53 PM. Reason: minor code improvement
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much John
    your code works great

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •