[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] sorted (translated) categories - better ideas?


Hi, Here some lines I wrote to show categories on the page in alphabetical order, also when they have been translated. It works fine, so no problems there. Just curious if anybody has any better/shorter/more efficient ideas to get the same result.
CU,
Gert
[seti catlist][/seti]
[query sql="select category from products group by category" type=list]
[list]
[seti catlist][msg][sql-param category][/msg]==[sql-param category],[scratch catlist][/seti]
[/list]
[/query]
[calcn]
my @list = split(/\,/,$Scratch->{catlist});
my ($trans,$orig,$output);
foreach my $tmpit (sort @list) {
  ($trans,$orig) = split(/\=\=/,$tmpit);
  $output .= '> [page search="se='. $orig .' sf=category"]'
             . $trans . '[/page]<br>';
}
return $output;
[/calcn]

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.