Gossamer Forum
Quote Reply
Modify Random Global
Hello all,

I used this global to show Three Random Links:

sub {
my $link_db = $DB->table('Links');
my $total = $link_db->count ( { isValidated => 'Yes' });
my $output;
for (1 .. 3) {
my $rand = int (rand() * $total);
$link_db->select_options ("LIMIT $rand, 1");
my $sth = $link_db->select ({ isValidated => 'Yes' });
my $link = $sth->fetchrow_hashref;
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}

Now I will modify these global to show only Links which the Datafield "Termin" ist greater than 00.00.0000 .
The Datafield has the Format DD.MM.YYYY
I used this on the Detail Page like:

<%if Termin eq '00.00.0000'%>Still no new date admits<%else%><%Termin%><%endif%>

Who can help me ??

Thanks from Germany,
qix
Subject Author Views Date
Thread Modify Random Global qix 2939 Apr 6, 2007, 1:01 AM
Thread Re: [qix] Modify Random Global
qix 2879 Apr 7, 2007, 9:45 AM
Post Re: [qix] Modify Random Global
Andy 2896 Apr 8, 2007, 3:34 AM