You are not logged in.

#1 2008-06-22 18:14:04

bmwiedemann
Member
Registered: 2008-06-22
Posts: 1

minor t@h CGI display bug

Description:
http://tah.openstreetmap.org/Credits/?order=date
currently shows at position #405 "1 months ago" right below "39 weeks ago" which does not make sense.
I think that this is not a sorting issue as the "Version" strings remain consistent ("Kingston").

I located the issue in the code and patched it (yet untested):

Index: Credits/index.php
===================================================================
--- Credits/index.php   (Revision 8398)
+++ Credits/index.php   (Arbeitskopie)
@@ -102,10 +102,11 @@
   $Age /= 24;
   if($Age < 7)
     return(sprintf("%d days ago", $Age));
+  $AgeDays = $Age;
   $Age /= 7;
-  if($Age < 40)
+  if($AgeDays < 40)
     return(sprintf("%d weeks ago", $Age));
-  $Age /= 30;
+  $Age = $AgeDays/30;
   if($Age < 12)
     return(sprintf("%d months ago", $Age));

alternatively, this might also do the trick:

Index: Credits/index.php
===================================================================
--- Credits/index.php   (Revision 8398)
+++ Credits/index.php   (Arbeitskopie)
@@ -102,8 +102,8 @@
   $Age /= 24;
   if($Age < 7)
     return(sprintf("%d days ago", $Age));
-  $Age /= 7;
   if($Age < 40)
+    $Age /= 7;
     return(sprintf("%d weeks ago", $Age));
   $Age /= 30;
   if($Age < 12)

Ciao
Bernhard M.

Last edited by bmwiedemann (2008-06-22 18:20:30)

Offline

#2 2008-07-02 14:24:00

emj
Member
From: .se (59.3N17.99E) 0735969076
Registered: 2006-06-18
Posts: 949

Re: minor t@h CGI display bug

Nice catch!

But; http://trac.openstreetmap.org is the bugtracker for OSM.

Offline

Board footer

Powered by FluxBB