PDA

View Full Version : Image Thumbnail Viewer II-help with title length



genia
01-26-2008, 11:11 PM
1) Script Title: Image Thumbnail Viewer II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem:
is it possible to change the length of the title that is showed beneath the enlarged image?

jscheuer1
01-27-2008, 04:17 AM
It can be as long as you want it to be.

Nile
01-27-2008, 04:34 AM
I think he wants to know how..

jscheuer1
01-27-2008, 04:46 AM
I think he wants to know how..

This would be short:


title="Short One"

This would be long:


title="A rather long title that can be even longer if want it to be longer"

genia
01-27-2008, 10:39 AM
i see,but for some reason it cut the text string

ok thank you all for your time and the great script,i forgot that the string in the db can contain double quotes,thats the reason.


thanks again.

jscheuer1
01-27-2008, 05:50 PM
Ugh, can it contain single quotes or an apostrophe, basically this character:

'

If not, you could delimit with that:


title='Some title'

Otherwise, you would need to escape whatever you use as a delimiter. The most convenient way of doing this that I can think of would be on the server side, like converting all " to \" before passing the value for title off to the page.

genia
01-27-2008, 07:26 PM
your solution is not right because the problem was that in the html code the text string was with " so it looked like:
title="text"dsfkjkljlsf"hsdfjkhdsfw'"

and as result it showed only text.
to solve this i made the string to output the spiceal chars as codes like: > and stuff like this so that the html parser wont be confused with the original quotes

jscheuer1
01-27-2008, 09:02 PM
Ooops, I confused a javascript string with an HTML one. I'm just glad you found a way that works for you.

genia
01-28-2008, 01:53 PM
thanks anyway for the help and for everything you do here.