Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [eupos] Displaying the age of a link

Quote Reply
Re: [eupos] Displaying the age of a link In reply to
Im using this also now, in german:

Code:
sub {
my $added = GT::Date::date_get($_[0]);
my $old = GT::Date::date_diff(GT::Date::date_get(), $added);

my $output;

if ($old == 0 ) {
$output = "heute";
}
elsif ( int ($old / 7) > 0 && int ($old / 7) < 4 ) {
my $weeks = int ($old / 7);
$output = $weeks == 1 ? "Woche" : $weeks . " Wochen";
}
elsif ( $old < 30 ) {
$output = $old == 1 ? " gestern" : $old . " Tagen";
}
elsif ( $old < 365 ) {
my $months = int ($old / 30 );
$output = $months == 1 ? "Monat" : $months . " Monaten";
}
else {
my $years = int ($old / 365 );
$output = $years == 1 ? "Jahr" : $years . " Jahren";
}

return $output;
}

call it with:

Code:
Eingetragen seit <%link_age($Add_Date_time)%>
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
Subject Author Views Date
Thread Displaying the age of a link anthonyweston 17319 Oct 18, 2012, 5:40 AM
Thread Re: [anthonyweston] Displaying the age of a link
Andy 16817 Oct 18, 2012, 6:50 AM
Thread Re: [Andy] Displaying the age of a link
anthonyweston 16817 Oct 18, 2012, 7:07 AM
Thread Re: [anthonyweston] Displaying the age of a link
eupos 16812 Oct 18, 2012, 7:13 AM
Thread Re: [eupos] Displaying the age of a link
Andy 16807 Oct 18, 2012, 7:16 AM
Post Re: [Andy] Displaying the age of a link
eupos 16776 Oct 18, 2012, 7:52 AM
Thread Re: [eupos] Displaying the age of a link
anthonyweston 16801 Oct 18, 2012, 7:24 AM
Thread Re: [anthonyweston] Displaying the age of a link
eupos 16785 Oct 18, 2012, 9:31 AM
Thread Re: [eupos] Displaying the age of a link
anthonyweston 16783 Oct 18, 2012, 9:47 AM
Thread Re: [anthonyweston] Displaying the age of a link
eupos 16718 Oct 18, 2012, 10:03 AM
Thread Re: [eupos] Displaying the age of a link
anthonyweston 16709 Oct 18, 2012, 10:25 AM
Thread Re: [anthonyweston] Displaying the age of a link
eupos 16757 Oct 18, 2012, 11:59 AM
Thread Re: [eupos] Displaying the age of a link
kailew 16499 Dec 7, 2012, 5:11 AM
Thread Re: [kailew] Displaying the age of a link
kailew 16475 Dec 11, 2012, 2:05 PM
Thread Re: [kailew] Displaying the age of a link
eupos 16410 Dec 11, 2012, 2:12 PM
Thread Re: [eupos] Displaying the age of a link
kailew 16497 Dec 11, 2012, 2:26 PM
Post Re: [kailew] Displaying the age of a link
eupos 16451 Dec 11, 2012, 2:41 PM
Thread Re: [kailew] Displaying the age of a link
eupos 16405 Dec 11, 2012, 3:10 PM
Thread Re: [eupos] Displaying the age of a link
kailew 16459 Dec 11, 2012, 3:21 PM
Thread Re: [kailew] Displaying the age of a link
Andy 16382 Dec 12, 2012, 12:50 AM
Thread Re: [Andy] Displaying the age of a link
kailew 16455 Dec 12, 2012, 1:17 AM
Thread Re: [kailew] Displaying the age of a link
Andy 16406 Dec 12, 2012, 1:19 AM
Thread Re: [Andy] Displaying the age of a link
kailew 16444 Dec 12, 2012, 1:23 AM
Thread Re: [kailew] Displaying the age of a link
eupos 4329 Dec 12, 2012, 4:44 AM
Thread Re: [eupos] Displaying the age of a link
kailew 4250 Dec 12, 2012, 4:49 AM
Post Re: [kailew] Displaying the age of a link
kailew 4282 Dec 12, 2012, 4:59 AM
Thread Re: [Andy] Displaying the age of a link
eupos 4261 Dec 12, 2012, 4:41 AM
Post Re: [eupos] Displaying the age of a link
Andy 4262 Dec 12, 2012, 4:43 AM
Post Re: [anthonyweston] Displaying the age of a link
Andy 16736 Oct 18, 2012, 7:15 AM
Post Re: [anthonyweston] Displaying the age of a link
eupos 16866 Oct 18, 2012, 7:04 AM