Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Link sort order in categorys

Quote Reply
Re: Link sort order in categorys In reply to
sub build_sort_links {
# --------------------------------------------------------
# Merges two array refs into one link list.
#
my ($arr_a, $arr_b) = @_;
my @names = split /,/, $LINKS{build_sort_order_category};
my @fields = map { $LINKDB->position($_) - 1 } @names;
my @c = sort { lc join ("", @{$a}[@fields]) cmp lc join ("", @{$b}[@fields]) } @{$arr_b}, @{$arr_a};
return \@c;
}

The problem i see: If you convert this to compare numbers; you will get for all strings the value of 0.
So there must be an "if then" like:
if the string is only 1,2,3,4,5,6,7,8,9,0,. #then its a number
else do normal.
The rexep for this should be something like: ^\d*\.?\d*$

Robert



Subject Author Views Date
Thread Link sort order in categorys Alex404 3400 Jun 2, 2000, 1:18 PM
Thread Re: Link sort order in categorys
pugdog 3317 Jun 2, 2000, 8:15 PM
Thread Re: Link sort order in categorys
Alex404 3285 Jun 5, 2000, 6:59 AM
Post Re: Link sort order in categorys
pugdog 3284 Jun 7, 2000, 6:02 AM
Thread Re: Link sort order in categorys
pugdog 3269 Jun 7, 2000, 6:07 AM
Thread Re: Link sort order in categorys
Robert 3281 Jun 7, 2000, 7:23 AM
Post Re: Link sort order in categorys
pugdog 3262 Jun 7, 2000, 10:08 PM