Gossamer Forum
Quote Reply
Multi-Select Global...
I had a look through here a second ago, for a global that would join the contents of a multi-select field, and seperate them with a comma. This is what I came up with;

Code:
sub {
my $tags = shift;
my @cut = split(/\n/, $tags->{AVS});
my $send_back = join(', ', @cut);
return $send_back;
}

Change 'AVS' to whatever the name of your array field is (.i.e as mutliselect field is stored as an array).

Any enhancements people want to make to it, feel free; oh, and enjoy Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Multi-Select Global... In reply to
Heh ;)

Code:
sub {
return join(', ', split(/\n/, $_[0]->{AVS}));
}

or:

Code:
sub {
local $" = ', ';
my @split = split /\n/, $_[0]->{AVS};
return "@split";
}

Last edited by:

Paul: Dec 18, 2002, 8:39 AM
Quote Reply
Re: [Paul] Multi-Select Global... In reply to
Like I said.,...open for improvments Laugh

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!