Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Image captions shown in slideshow mode  (Read 41052 times)

0 Members and 1 Guest are viewing this topic.

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Image captions shown in slideshow mode
« on: September 24, 2004, 03:36:02 pm »

For me there are very few new additional features required in future releases of Coppermine. :)

I would like to see the whole thing XHTML-compliant (I think v1.4 will be  ;D), and it would be nice to see a caption shown for images shown in slideshow mode.  ::)

I know there is a hack for this but it seems a tad clumsy and I can't seem to get it to work with my installation of v.1.3.2  ???
« Last Edit: March 02, 2006, 08:19:04 am by GauGau »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Image captions shown in slideshow mode
« Reply #1 on: September 24, 2004, 03:46:53 pm »

A bit demanding, no? ;) This is a volunteer effort and the developers do have other priorities beyond CPG. They still try hard to produce a great application with features that benefit a big enough number of people. Beyond that, there are people who create mods/hacks to build upon CPG's core code. Perhaps you should try to help the developers out so that they can focus on development rather than support. :)
Logged

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Re: Image captions shown in slideshow mode
« Reply #2 on: September 27, 2004, 12:56:57 pm »

Quote
A bit demanding, no?

Hardly demanding. :( Just something to make the slidewhow feature more complete. As far as XHTML is concerned I understood that v1.4 when released it is complete will be compliant.


Coppermine is excellent in my view and this addition to the slideshow would (in my mind) make it complete...
Logged

mstralka

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 178
Re: Image captions shown in slideshow mode
« Reply #3 on: September 27, 2004, 02:19:09 pm »

The "clumsy" caption mod http://forum.coppermine-gallery.net/index.php?topic=9247.0 works fine for 1.3.2, so if you had problems with it then you didn't follow the instructions correctly.  I agree that displaying the caption in a text box is not ideal, but I could not find another way that worked.  Maybe you can work on and post an improvement?

-Mark
Logged
GO IRISH

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Image captions shown in slideshow mode
« Reply #4 on: September 29, 2004, 09:23:08 pm »

FOR 1.4.9 USERS please see my last post about this on page 2 http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257


A neater solution to this issue isn't that hard.....

In functions.inc.php change this line:
Code: [Select]
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid';to
Code: [Select]
            $select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, title';
then in slideshow.inc.php below:
Code: [Select]
var Pic = new Array() // don't touch thisadd
Code: [Select]
var Title = new Array() // don't touch this
change:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        echo "Pic[$i] = '" . $picture_url . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}
to:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . $picture_url . "'\n";
        echo "Title[$i] = '" . $Title . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

change:
Code: [Select]
function runSlideShow(){
   if (xIE4Up){
     document.images.SlideShow.style.filter="blendTrans(duration=2)"
     document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
     document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (xIE4Up){
     document.images.SlideShow.filters.blendTrans.Play()
   }

   pos = j

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
   preLoadPic(j)
}
to
Code: [Select]
function runSlideShow(){
   if (xIE4Up){
     document.images.SlideShow.style.filter="blendTrans(duration=2)"
     document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
     document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.getElementById('Title').innerHTML = Title[j];
   document.images.SlideShow.src = preLoad[j].src;
   if (xIE4Up){
     document.images.SlideShow.filters.blendTrans.Play()
   }

   pos = j

   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
   preLoadPic(j)
}

And in displayimage.php below:
Code: [Select]
    $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100,
        '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" /><br />',
        '{ADMIN_MENU}' => '',
        );
add
Code: [Select]
    starttable();
    echo <<<EOT
        <tr><td align="center" class="navmenu" style="white-space: nowrap;"><div id=Title></div></td></tr>

EOT;
    endtable();

That will do the trick and will work in every single theme.... :)
« Last Edit: October 01, 2006, 10:18:14 am by RatKing »
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Image captions shown in slideshow mode
« Reply #5 on: September 29, 2004, 09:27:03 pm »

If you want to see a working version go to http://www.ratking.net
Logged

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Re: Image captions shown in slideshow mode
« Reply #6 on: October 04, 2004, 06:08:58 pm »

@RatKing - many, many thanks for this hack - it works like a dream  ;D

Could this be included in any future releases?  :)
Logged

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Re: Image captions shown in slideshow mode
« Reply #7 on: October 05, 2004, 10:24:38 am »

...although I've just noticed that does not seem to work on all my albums? I can't seem to work out why  :\'(


Check out http://cgi.martinhart.force9.co.uk/
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Image captions shown in slideshow mode
« Reply #8 on: October 05, 2004, 12:09:34 pm »

FOR 1.4.9 USERS please see my last post about this on page 2 http://forum.coppermine-gallery.net/index.php?topic=10265.msg173257#msg173257


I had a little look and the problem is in the names used for the title's in your: Home > Holidays Abroad > 2002 The Splendours of Venice & Lombardy

There is a title by the name of: Title[13] = 'Gondolas outside St Mark's Square, Venice' that causes an issue because of the Mark's

Now you can solve this in several ways but the best would be to make a change in the PHP (it was my bad not to think of this before)...

This code in slideshow.inc.php should be:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . htmlspecialchars($picture_url, ENT_QUOTES) . "'\n";
        echo "Title[$i] = '" . htmlspecialchars($Title, ENT_QUOTES) . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

instead of:
Code: [Select]
    if (is_image($picture['filename'])) {
        if ($CONFIG['make_intermediate'] && $condition ) {
            $picture_url = get_pic_url($picture, 'normal');
        } else {
            $picture_url = get_pic_url($picture, 'fullsize');
        }

        if ( $picture['title'] ) $Title = $picture['title']; else $Title = $picture['filename'];
        echo "Pic[$i] = '" . $picture_url . "'\n";
        echo "Title[$i] = '" . $Title . "'\n";
        if ($picture['pid'] == $pid) {
            $j = $i;
            $start_img = $picture_url;
        }
        $i++;
    }
}

I have not tested this but I am pretty sure this will do the trick. :-)
« Last Edit: October 01, 2006, 10:18:38 am by RatKing »
Logged

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Re: Image captions shown in slideshow mode
« Reply #9 on: October 05, 2004, 06:59:31 pm »

Gr8 -  now works perfectly with all albums (including those containing images with quotes et al.)  8) 8) 8)
Logged

poubao

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: la
  • Offline Offline
  • Gender: Male
  • Posts: 277
    • Collections du Laos
Re: Image captions shown in slideshow mode
« Reply #10 on: October 05, 2004, 10:59:03 pm »

bonjour,
i test your mod, but it seem not working, the slideshow stay at the first pic and dont run without error, ???
any idea to solve
poubao
Logged
L'incohérence de ceux qui nous dirigent, l'incompétence de ceux qui nous commandent,sont un vibrant hommage pour ceux qui exécutent.
                                          **Général Patton**

martinha

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • Online Digital Image Gallery
Re: Image captions shown in slideshow mode
« Reply #11 on: October 06, 2004, 02:45:05 pm »

poubao:

First apply the changes listed by RatKing at the start of this thread and then make the change he suggests further down. Your problme possibly lies in your images having titles with apostrophies ( 's) in their titles?

This solved the problem on mine.... :)

martin
Logged

morphob

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Image captions shown in slideshow mode
« Reply #12 on: October 26, 2004, 08:08:56 pm »

Is this supposed to show the caption as well as the title? 

Works great for showing the title, but I'm not sure if I missed something.
Logged

RatKing

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Personal website
Re: Image captions shown in slideshow mode
« Reply #13 on: November 02, 2004, 01:11:35 pm »

The trick is it shows the caption if available and the file name if there is no caption. That way you will always see something, and the slide show does work have a look at my site (it usses the cade shown above)
Logged

slfear

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Image captions shown in slideshow mode
« Reply #14 on: March 23, 2005, 03:23:57 pm »

Thanks Ratking for the mod...works great!

steve
Logged

caplan8293

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Image captions shown in slideshow mode
« Reply #15 on: August 26, 2005, 03:55:01 pm »

Works for me too, this is great.  I suggest that this be part of the core application.  Thanks a lot.
Logged
caplan8293

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: Image captions shown in slideshow mode
« Reply #16 on: October 29, 2005, 11:29:32 pm »

hmm seems to be working for everybody else, i tried two times, and must be doing something wrong.

I'm not getting any errors, just the slidehshow isn't running. Any suggestions?
Logged

Rallemann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: Image captions shown in slideshow mode
« Reply #17 on: January 02, 2006, 03:33:02 am »

Well
This mod has worked under 1.3x really good. Today I installed 1.43 and I noticed that in displayimage.php is not the code I have to add to:
And in displayimage.php below:
Code: [Select]
   $params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100,
        '{IMAGE}' => '<img src="' . $start_img . '" name="SlideShow" class="image" /><br />',
        '{ADMIN_MENU}' => '',
        );
add
Code: [Select]
   starttable();
    echo <<<EOT
        <tr><td align="center" class="navmenu" style="white-space: nowrap;"><div id=Title></div></td></tr>

EOT;
    endtable();

I think this code was changed because of any reason, so this mod has to be overworked.
Sorry but I am not able to do this - can you help me?
I suppose that it won't be very difficult
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Logged

phatbloke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Image captions shown in slideshow mode
« Reply #19 on: February 23, 2006, 01:47:16 pm »

Rallemann

You will now find the missing line of code in includes/themes.inc.php and you can add the line in below it as noted in the instructions.
This fix now works for me in v1.4.3


Also the line in functions.inc.php has a couple extra values, just add title to the line inside the quotes as indicated.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 19 queries.