Tony,
I prefer using the Global methods. Go to Build>Template Globals>
change the option:
link_results
from :
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
to what andy suggested:
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
my $cnt = 0;
while (my $link = $sth->fetchrow_hashref) {
if ($cnt / 2) {
$link->{even} = 1;
} else {
$link->{odd} = 1;
}
$output .= Links::SiteHTML::display('link', $link);
$cnt++;
}
return $output;
}
Then open link.html and add the
<%if odd%> odd color <%else%> even color <%endif%>
TRY THAT
Sandra Roussel
Chonsa Group Design - Fresh Start Housing
I prefer using the Global methods. Go to Build>Template Globals>
change the option:
link_results
from :
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
to what andy suggested:
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC');
my $sth = $link_db->select;
my $output = '';
my $cnt = 0;
while (my $link = $sth->fetchrow_hashref) {
if ($cnt / 2) {
$link->{even} = 1;
} else {
$link->{odd} = 1;
}
$output .= Links::SiteHTML::display('link', $link);
$cnt++;
}
return $output;
}
Then open link.html and add the
<%if odd%> odd color <%else%> even color <%endif%>
TRY THAT
Sandra Roussel
Chonsa Group Design - Fresh Start Housing