Gossamer Forum
Home : Products : DBMan : Customization :

Category Select List tweak

Quote Reply
Category Select List tweak
Regarding JPDeni's very handy mod referenced at:

http://gossamer-threads.com/...ew=&sb=&vc=1

I decided to apply the Links method of splitting the category list into two columns. It turned out to be a pretty easy change.

After:

Code:
@options = split (/\,/, $db_select_fields{'Category'});
add:

Code:
my $half = int (($#options+2) / 2);
my $i = 0;
print qq|
<table width="100%" border="1" cellspacing="0" cellpadding="0" BGCOLOR="#FFFFCC"><tr><td valign="top" width="50%">
|;
After:

Code:
$encoded = &urlencode($option);
add:

Code:
if ($i == $half) {
print qq|</td><td valign="top" width="50%">|;
}
$i++;
And, after:

Code:
#### if you only want to list categories that have matching entries, uncomment the following line
# }
}
(before the last closing } of the Category Select List section)

add:

Code:
print qq|</td></tr></table>|;
That should do it. You can see it in use at http://run-down.com/go/to.cgi?ID=faq if you would like a preview (not that it's anything earth shattering).

Dan