Glad it worked.
Regarding your other question - try this revised version:
my @split = split /,/, $_[0];
my @return_loop;
my @tmp_vals;
my $i = 0 ;
foreach (@split) {
$i++;
if ($i == $#split) {
push @tmp_vals, { Value => $_, isLast => 1 };
} else {
push @tmp_vals, { Value => $_};
}
}
if ($tmp_vals[0]) {
my $num;
if ($#tmp_vals > 0) { $num = 1; }
return { outputted => \@tmp_vals, outputted_number => $num };
}
}
..then call with:
<%if outputted.length%>
<h2>English Title<%if outputted_number%>s<%endif%></h2>
<%loop outputted%>
<%if isLast%> and <%endif%><i><%Value%></i>
<%endloop%>
<%endif%>
That should do the job :)
Cheers
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!
Regarding your other question - try this revised version:
Code:
sub { my @split = split /,/, $_[0];
my @return_loop;
my @tmp_vals;
my $i = 0 ;
foreach (@split) {
$i++;
if ($i == $#split) {
push @tmp_vals, { Value => $_, isLast => 1 };
} else {
push @tmp_vals, { Value => $_};
}
}
if ($tmp_vals[0]) {
my $num;
if ($#tmp_vals > 0) { $num = 1; }
return { outputted => \@tmp_vals, outputted_number => $num };
}
}
..then call with:
Code:
<%your_global_name($Eng_Title)%> <%if outputted.length%>
<h2>English Title<%if outputted_number%>s<%endif%></h2>
<%loop outputted%>
<%if isLast%> and <%endif%><i><%Value%></i>
<%endloop%>
<%endif%>
That should do the job :)
Cheers
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!