Here is a smal mod I have to view_album.php (gal v1.31)... It shortens the captions to 40 characters in Album mode, but still displays the full caption in Picture more.
diff format:
435c435,439
< echo($gallery->album->getCaption($i));
---
> $tmpstr = ($gallery->album->getCaption($i));
> if ( (strlen($tmpstr) > 40) ) {
> $tmpstr= substr($tmpstr,0,40) . "...";
> }
> echo "$tmpstr";
Posts: 33
Nice one. That's what I need. But your hack will not affect the subalbum title/description. If the subalbum has a very long title and/or description, I like to make it short too. Also the album at the top level. So maybe we can insert a function in util.php to do the job. And call the function from various places.
Jin
Posts: 487
If you want this to apply everywhere except the closeup of an image,
then you could try applying your length check directly in the getCaption
function of classes/Album.php. However, this may adversely affect
top-level and highlight captions if they exceed the string length
you have picked out as there is no other way to view the caption.
Posts: 33
I don't think change getCaption is good. Like you said, there is no way to display the full caption. And there may be more than one place that needs this feature: Album title, album description, subalbum description, photo caption, etc..