Zenpage theme issue

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/

Comments

  • acrylian Administrator, Developer
    Looks like you messed up the html of the theme page somehow. Did you change anything? If use the standard file again.
  • acrylian Administrator, Developer
    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.
  • 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.

    `
    `
  • 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/
  • acrylian Administrator, Developer
    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..
  • 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.
  • ok, what if I pass the following string:

    `This is an example of a string`

    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:
    `This is an example of a string`

    Perhaps truncate_string() needs to be smarter if formatting should be allowed in the album description.
  • *edit* new example that isn't formatted:

    `This is an example of a string`

    Resulting HTML:
    `This is an example of a string</stra...`
  • acrylian Administrator, Developer
    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.
  • Thank you acrylian.

    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.
  • 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
    <br /...`)

    The difference is just one more character in the second case before the tag.

  • 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 <ba /...`)

    Replace <ba /> with
  • acrylian Administrator, Developer
    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).
  • You're right, I only made the change in gallery.php, not in album.php.

    Thanks a lot for the help!
  • `truncate_string()` was never intended for use with html tagged content. It simply shortens the string at an appropriate break point (if possible).
  • acrylian Administrator, Developer
    Yes, but `shortenContent` with its ability to "equalize" shortened tags was added much later and was originally a Zenpage specific function as well.
Sign In or Register to comment.