Member
Member
olihar   2009-11-26, 18:30
#1
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/
Member
Member
sbillard   2009-11-26, 19:17
#2
What functions are you using?
Member
Member
olihar   2009-11-26, 19:51
#3
Do you mean

`
<?php printTags(NULL, NULL, 'taglist', ""); ?>
`
Member
Member
sbillard   2009-11-26, 20:22
#4
Got it--a coding error in the printTags function. Will get a fix in the nightly.
Member
Member
olihar   2009-11-26, 21:05
#5
great, thanks. I will upgrade tomorrow and see how goes.
Member
Member
olihar   2009-11-26, 21:21
#6
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.
Administrator
Administrator
acrylian   2009-11-26, 21:28
#7
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).
Member
Member
olihar   2009-11-26, 21:44
#8
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.
Administrator
Administrator
acrylian   2009-11-26, 21:52
#9
Well, that looks actually like a little bug. I guess we will need to take a look at it...
Member
Member
sbillard   2009-11-27, 00:44
#10
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.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.