coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: scottcrew on October 20, 2007, 10:23:22 PM

Title: filmstrip...
Post by: scottcrew on October 20, 2007, 10:23:22 PM
I would like to find out how to display the caption instead of the file name in the filmstrip.
Title: Re: filmstrip...
Post by: scottcrew on October 22, 2007, 11:49:49 PM
I have searched the forums bit have not found an answer to this...
Maybe I'm using the wrong search words, I don' know, but I can't find it...
So would you please give me a tip as to where I need to edit so that,
in the filmstrip, the image's "Title" is shown instead of the filename?

TIA!!
Title: Re: filmstrip...
Post by: Nibbler on October 23, 2007, 12:41:31 AM
Code is include/functions.inc.php

$thumb_list[$i]['caption'] = $CONFIG['display_film_strip_filename'] ? '<span class="thumb_filename">'.$row['filename'].'</span>' : '';

Try changing the $row['filename'] to $row['title']
Title: Re: filmstrip...
Post by: scottcrew on October 23, 2007, 01:01:46 AM
Can that be placed in the theme.php file?
Title: Re: filmstrip...
Post by: Nibbler on October 23, 2007, 01:09:03 AM
No, but there's probably a way to do it via the theme system somehow.
Title: Re: filmstrip...
Post by: scottcrew on October 23, 2007, 01:17:41 AM
Nibbler,
Your suggestion worked, thanks!
It would really be nice to be able to handle it through the themes system.
Does anyone have an idea as to how to do it through the themes?

TIA!
Title: Re: filmstrip...
Post by: Sami on October 23, 2007, 10:11:56 AM
There is a trick you can try ;)

copy theme_display_film_strip function from themes\sample\theme.php to themes\yourtheme\theme.php if don't have it already

now edit this function
find foreach statement foreach($thumb_list as $thumb) and put this line just before it

    $pic_data = get_pic_data($aid, $nbThumb, $album_name);


and then put this just after it

$thumb['caption'] = $pic_data[$thumb['pos']]['title'];


So your function should be look like this after changes


.
.
.
    $pic_data = get_pic_data($aid, $nbThumb, $album_name);
    foreach($thumb_list as $thumb) {
         $thumb['caption'] = $pic_data[$thumb['pos']]['title'];
.
.
.


It's done !

hope it works for you
Title: Re: filmstrip...
Post by: scottcrew on October 23, 2007, 02:00:34 PM
Sami,
That still showed the image file name and not the title of the image.
I don't want visitors to e able to see the file name.
Title: Re: filmstrip...
Post by: Sami on October 23, 2007, 02:36:41 PM
Oops sorry that was my miss understanding !


Check my previous post , I don't have test bed with me so please confirm if it's working
Title: Re: filmstrip...
Post by: scottcrew on October 23, 2007, 02:49:46 PM
Sami,
Yes, it does work... Yeah!
And it is confined to the theme.php file!!

Thank-you!!