Tags order

I came by a strange thing, tags are displayed not always in the same order. Even using the same tags on images.

http://img.skitch.com/20091126-n7g7e1us7jwk82i71g77wdbjin.jpg

See here.

http://moment.is/galleri/

Comments

  • What functions are you using?
  • Do you mean

    `
    <?php printTags(NULL, NULL, 'taglist', ""); ?>
    `
  • Got it--a coding error in the printTags function. Will get a fix in the nightly.
  • great, thanks. I will upgrade tomorrow and see how goes.
  • I guess its worth noting as well if you use truncate on image titles.

    `
    <?php echo truncate_string(getImageTitle(), 19);?>
    `
    and the title includes ... in the name it does not truncate, funny bug I have to say.
  • acrylian Administrator, Developer
    Not sure if a bug but that function does not truncate excatly anyway as it tries to take care of spaces between words, too. (if I remember correctly).
  • Its just something I noticed, if the name of image is

    123456789

    and the code used would be

    <?php echo truncate_string(getImageTitle(), 5);?>

    the results will be

    12345...

    However if the name of the image is

    123456789...

    then the results would be

    123456789...

    I don't really see it as that much of a bug, but like I said I did notice this as a user of mine used ... in the name of a file and for some reason it did not truncate.
  • acrylian Administrator, Developer
    Well, that looks actually like a little bug. I guess we will need to take a look at it...
  • Not sure what you are seeing. The code is as follows:

    `
    function truncate_string($string, $length, $elipsis='...') {
    if (strlen($string) > $length) {
    $pos = strpos($string, ' ', $length);
    if ($pos === FALSE) return substr($string, 0, $length) . $elipsis;
    return substr($string, 0, $pos) . $elipsis;
    }
    return $string;
    }
    `
    This will find the last space prior to the designated length and truncate there or it will chop at the lenght, so I do not see how the example you show could have occurred.
Sign In or Register to comment.