coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: FishGuy876 on September 23, 2006, 03:23:08 PM

Title: Limiting Description Length In Thumbnail Galleries
Post by: FishGuy876 on September 23, 2006, 03:23:08 PM
Hi, I hope this is the right place to put this category.

I have been using Coppermine(great program!) for a little bit now, and have a question about the thumbnail galleries. Some of the pictures I have been working with have long descriptions, which isn't a problem. What is a problem, is whwn the image thumbnails are viewed in galleries and the random files section etc. with the descriptions underneath them. The entire description is shown causing the user to have to scroll down a couple of pages to get to the end of the description (its sharnk to the width of the column for the thumbnail). Is there a way/known way to say restrict this to the first 256 characters, yet leaving the description preserved when they click to view the actual image?

I tried to search the forums and couldn't find anything that fit exactly what I was referring to. Thank-you.

Andy Kellett
Title: Re: Limiting Description Length In Thumbnail Galleries
Post by: xplicit on September 23, 2006, 05:29:13 PM
If you want to limit textual things like description, title, comment etc you can use the standard strlen to define the lengt combined with a substr function. if the lenght is longer than the desired one

Use for instance as an example for limiting a string at 200 char. called $text the following

$text = strlen($text ) > 200 ? @substr($text ,0,200)."...": $text ;[code]

the ... part is used for filling up the end of the text


[/code]
Title: Re: Limiting Description Length In Thumbnail Galleries
Post by: FishGuy876 on September 24, 2006, 04:19:35 AM
Hi,

Thats pretty much what I had figured on doing. I was hoping there was an easy way to do it, however the template files for the skin doesn't seem to make the job easy =) I don't suppose anyone knows which exact files I should be changing so I don't screw it up =)

Thanks =)
Title: Re: Limiting Description Length In Thumbnail Galleries
Post by: Sami on September 24, 2006, 06:43:37 AM
It's look like a support thread to me! posted on a No support board ...
Moving ...
Title: Re: Limiting Description Length In Thumbnail Galleries
Post by: jessemagano on January 08, 2007, 07:52:35 AM
We'll where does this code go??? What file do I edit, thanks.
Title: Re: Limiting Description Length In Thumbnail Galleries
Post by: Gizmo on January 18, 2007, 01:34:43 AM
Here, give this mod a try - Short (Truncated) Thumbnail Description and Displaying on Intermediate Page (http://forum.coppermine-gallery.net/index.php?topic=40317.0).