Member
Member
crotale   25-02-2011, 09:07
#1

We're having an issue with the Zenpage theme on one page and I can not figure out why. Can someone please have a look at it?

http://www.jossanssmycken.com/bestaellnings-information/

Administrator
Administrator
acrylian   25-02-2011, 11:16
#2

Looks like you messed up the html of the theme page somehow. Did you change anything? If use the standard file again.

Administrator
Administrator
acrylian   25-02-2011, 11:16
#3

Looks like you messed up the html of the theme page somehow. Did you change anything? If use the standard file again. Try the w3 validator or firebug to find out what otherwise.

Member
Member
crotale   27-02-2011, 12:58
#4

I have done some more digging and I will not remove or try to fix it before you have a chance to look at it.

Please compare these two pages:
http://www.jossanssmycken.com/armband
http://www.jossanssmycken.com/armband/page/2/

There is something broken on the first page and looking at row 61 of the HTML source there seem to be something with the span tag. The class variable is not set correctly as far as I can tell.

`

Member
Member
crotale   27-02-2011, 13:09
#5

I've found some more issues:

Line 122 and 135 (p tags not closed):
http://www.jossanssmycken.com/armband/page/5/

Line 97 (span class name):
http://www.jossanssmycken.com/armband/page/7/

Line 167 (br tag not closed):
http://www.jossanssmycken.com/halsband/

Administrator
Administrator
acrylian   27-02-2011, 13:54
#6

I am sorry, I can't reproduce it on my test install: http://zenphoto.maltem.de/ (that is even 1.4.0.1 actually). Tried even a description of one of your albums because of the chars. All fine and valid html there...

Sure you really use the current version of the theme? Just asking..

Member
Member
crotale   27-02-2011, 14:42
#7

Further digging... I checked the HTML code of some of the (sub) album descriptions that seem to cause the trouble.

Is there some kind of shortening of the album descriptions going on somewhere? Is this shortening based on a raw character count. For example, if it cuts the output in the middle of a tag and it consequently screws up the layout?

I tried adding spaces and just changing the description of some of the troubled albums and got it to work again.

As you can tell, I'm not that into the workings of the code but I try to feed back as much information I can in order to help zenphoto getting better.

Member
Member
crotale   27-02-2011, 15:04
#8

ok, what if I pass the following string:

[b]This is an example of a string[/b]

to truncate_string(), line 46 in themes/zenpage/gallery.php

As far as I understand, it will be cut in the middle of the closing strong tag and the layout will be broken.

Resulting HTML:
`[b]This is an example of a string

Member
Member
crotale   27-02-2011, 15:05
#9

edit new example that isn't formatted:

This is an example of a string

Resulting HTML:
`This is an example of a string

Administrator
Administrator
acrylian   27-02-2011, 15:40
#10

Indeed, I can reproduce that the tag is cut. Actually the function should equalize this. Please open a ticket. Will take a while though as our chief developer is away for some time.

Meanwhile try to use strip_tags() around the truncation to workaround.

EDIT: Well, even devs loose track on functions available. Please try to replace the truncate_string(getAlbumDesc(), 45) part wiht shortenContent(getAlbumDesc(), 45, '...'). That should equalize the tags truncated and works for me. Seems we forgot a theme change... Thanks for insisting on this issue.

Member
Member
crotale   27-02-2011, 16:31
#11

Thank you [b]acrylian[/b].

I have replaced function truncate_string() with shortenContent() but there are still some issues. However, it can very well be some caching on my side. I'll do some more digging later on.

Now I have the project set up in an environment where I can more easily follow and understand the code. Hopefully I can contribute in a better way.

Member
Member
crotale   27-02-2011, 17:11
#12

There seem to be a slight difference in how these two HTML formatted descriptions are handled by the shortenContent()-function:

This works:
`abcde12345 abcde12345 abcde1234

This is a test string. (Output:abcde12345 abcde12345 abcde1234

...`)

While this does not work:
`abcde12345 abcde12345 abcde12345

This is a test string. (Output:abcde12345 abcde12345 abcde12345

Member
Member
crotale   27-02-2011, 17:13
#13

I failed...

This works:
abcde12345 abcde12345 abcde1234 This is a test string.
(Output: abcde12345 abcde12345 abcde1234 ...)

While this does not work:
abcde12345 abcde12345 abcde12345 This is a test string.
(Output: `abcde12345 abcde12345 abcde12345

Administrator
Administrator
acrylian   27-02-2011, 17:33
#14

EDIT:

Ok, I can reproduce this with 1.4.0.2 and the developent build only if you use truncate_string instead of shortenContent. With the latter it works as intendend and results in:
abcde12345 abcde12345 abcde12345 ... (dev)
or `abcde12345 abcde12345 abcde12345

...
` (1.4.0.2).

So indeed, please open a ticket and refer to this thread.

PS: Found another bug in the trunk nightlies: Seems tags are stripped from the album description when saved. No idea where this comes from. (EDIT: This is a glitch on one of my test installs only).

Member
Member
crotale   27-02-2011, 18:08
#15

You're right, I only made the change in gallery.php, not in album.php.

Thanks a lot for the help!

Member
Member
sbillard   01-03-2011, 02:25
#16

truncate_string() was never intended for use with html tagged content. It simply shortens the string at an appropriate break point (if possible).

Administrator
Administrator
acrylian   01-03-2011, 10:05
#17

Yes, but shortenContent with its ability to "equalize" shortened tags was added much later and was originally a Zenpage specific function as well.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.